Prompt:
/// Create a function which returns the largest index of an element which
/// is not greater than or equal to the element immediately preceding it. If
/// no such element exists then return -1. The given vector will not contain
/// duplicate values.
/// Examples:
/// >>> can_arrange(vec![1, 2, 4, 3, 5])
/// 3
/// >>> can_arrange(vec![1, 2, 3])
/// -1
fn can_arrange(arr: Vec<isize>) -> isize {

}

fn main() {
    let candidate = can_arrange;
    assert_eq!(candidate(vec![1, 2, 4, 3, 5]), 3);
    assert_eq!(candidate(vec![1, 2, 4, 5]), -1);
    assert_eq!(candidate(vec![1, 4, 2, 5, 6, 7, 8, 9, 10]), 2);
    assert_eq!(candidate(vec![4, 8, 5, 7, 3]), 4);
    assert_eq!(candidate(Vec::<isize>::new()), -1);
}


Prompt:
/// Input is a space-delimited string of numberals from 'zero' to 'nine'.
/// Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.
/// Return the string with numbers sorted from smallest to largest
/// >>> sort_numbers(String::from("three one five"))
/// String::from("one three five")
fn sort_numbers(numbers: String) -> String {

}

fn main() {
    let candidate = sort_numbers;
    assert_eq!(candidate(String::from("")), String::from(""));
    assert_eq!(candidate(String::from("three")), String::from("three"));
    assert_eq!(candidate(String::from("three five nine")), String::from("three five nine"));
    assert_eq!(candidate(String::from("five zero four seven nine eight")), String::from("zero four five seven eight nine"));
    assert_eq!(candidate(String::from("six five four three two one zero")), String::from("zero one two three four five six"));
}


Prompt:
/// Circular shift the digits of the integer x, shift the digits right by shift
/// and return the result as a string.
/// If shift > number of digits, return digits reversed.
/// >>> circular_shift(12, 1)
/// String::from("21")
/// >>> circular_shift(12, 2)
/// String::from("12")
fn circular_shift(x: isize, shift: isize) -> String {

}

fn main() {
    let candidate = circular_shift;
    assert_eq!(candidate(100, 2), String::from("001"));
    assert_eq!(candidate(12, 2), String::from("12"));
    assert_eq!(candidate(97, 8), String::from("79"));
    assert_eq!(candidate(12, 1), String::from("21"));
    assert_eq!(candidate(11, 101), String::from("11"));
}


Prompt:
/// "
/// This function will take a vector of integers. For all entries in the vector, the function shall square the integer entry if its index is a
/// multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not
/// change the entries in the vector whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries.
/// Examples:
/// >>> lst
/// vec![1, 2, 3]
/// >>> lst
/// vec![]
/// >>> lst
/// vec![-1, -5, 2, -1, -5]
fn sum_squares(lst: Vec<isize>) -> isize {


Prompt:
/// You are given a vector of integers.
/// You need to find the largest prime value and return the sum of its digits.
/// Examples:
/// >>> skjkasdkd(vec![0, 3, 2, 1, 3, 5, 7, 4, 5, 5, 5, 2, 181, 32, 4, 32, 3, 2, 32, 324, 4, 3])
/// 10
/// >>> skjkasdkd(vec![1, 0, 1, 8, 2, 4597, 2, 1, 3, 40, 1, 2, 1, 2, 4, 2, 5, 1])
/// 25
/// >>> skjkasdkd(vec![1, 3, 1, 32, 5107, 34, 83278, 109, 163, 23, 2323, 32, 30, 1, 9, 3])
/// 13
/// >>> skjkasdkd(vec![0, 724, 32, 71, 99, 32, 6, 0, 5, 91, 83, 0, 5, 6])
/// 11
/// >>> skjkasdkd(vec![0, 81, 12, 3, 1, 21])
/// 3
/// >>> skjkasdkd(vec![0, 8, 1, 2, 1, 7])
/// 7
fn skjkasdkd(lst: Vec<isize>) -> isize {


Prompt:
/// For a given vector of integers, return a tuple consisting of a sum and a product of all the integers in a vector.
/// Empty sum should be equal to 0 and empty product should be equal to 1.
/// >>> sum_product(vec![])
/// (0, 1)
/// >>> sum_product(vec![1, 2, 3, 4])
/// (10, 24)
fn sum_product(numbers: Vec<isize>) -> (isize, isize) {

}

fn main() {
    let candidate = sum_product;
    assert_eq!(candidate(Vec::<isize>::new()), (0, 1));
    assert_eq!(candidate(vec![1, 1, 1]), (3, 1));
    assert_eq!(candidate(vec![100, 0]), (100, 0));
    assert_eq!(candidate(vec![3, 5, 7]), (15, 105));
    assert_eq!(candidate(vec![10]), (10, 10));
}


Prompt:
/// This function takes two positive numbers x and y and returns the
/// biggest even integer number that is in the range [x, y] inclusive. If
/// there's no such number, then the function should return -1.
/// For example:
/// >>> choose_num(12, 15)
/// 14
/// >>> choose_num(13, 12)
/// -1
fn choose_num(x: isize, y: isize) -> isize {

}

fn main() {
    let candidate = choose_num;
    assert_eq!(candidate(12, 15), 14);
    assert_eq!(candidate(13, 12), -1);
    assert_eq!(candidate(33, 12354), 12354);
    assert_eq!(candidate(5234, 5233), -1);
    assert_eq!(candidate(6, 29), 28);
    assert_eq!(candidate(27, 10), -1);
    assert_eq!(candidate(7, 7), -1);
    assert_eq!(candidate(546, 546), 546);
}


Prompt:
/// Create a function that returns a tuple (a, b), where 'a' is
/// the largest of negative integers, and 'b' is the smallest
/// of positive integers in a vector.
/// If there is no negative or positive integers, return them as None.
/// Examples:
/// >>> largest_smallest_integers(vec![2, 4, 1, 3, 5, 7])
/// (None, Some(1))
/// >>> largest_smallest_integers(vec![])
/// (None, None)
/// >>> largest_smallest_integers(vec![0])
/// (None, None)
fn largest_smallest_integers(lst: Vec<isize>) -> (Option<isize>, Option<isize>) {

}

fn main() {
    let candidate = largest_smallest_integers;
    assert_eq!(candidate(vec![2, 4, 1, 3, 5, 7]), (None, Some(1)));
    assert_eq!(candidate(vec![2, 4, 1, 3, 5, 7, 0]), (None, Some(1)));
    assert_eq!(candidate(vec![1, 3, 2, 4, 5, 6, -2]), (Some(-2), Some(1)));
    assert_eq!(candidate(vec![4, 5, 3, 6, 2, 7, -7]), (Some(-7), Some(2)));
    assert_eq!(candidate(vec![7, 3, 8, 4, 9, 2, 5, -9]), (Some(-9), Some(2)));
    assert_eq!(candidate(Vec::<isize>::new()), (None, None));
    assert_eq!(candidate(vec![0]), (None, None));
    assert_eq!(candidate(vec![-1, -3, -5, -6]), (Some(-1), None));
    assert_eq!(candidate(vec![-1, -3, -5, -6, 0]), (Some(-1), None));
    assert_eq!(candidate(vec![-6, -4, -4, -3, 1]), (Some(-3), Some(1)));
    assert_eq!(candidate(vec![-6, -4, -4, -3, -100, 1]), (Some(-3), Some(1)));
}


Prompt:
/// Given a string, find out how many distinct characters (regardless of case) does it consist of
/// >>> count_distinct_characters(String::from("xyzXYZ"))
/// 3
/// >>> count_distinct_characters(String::from("Jerry"))
/// 4
fn count_distinct_characters(string: String) -> isize {

}

fn main() {
    let candidate = count_distinct_characters;
    assert_eq!(candidate(String::from("")), 0);
    assert_eq!(candidate(String::from("abcde")), 5);
    assert_eq!(candidate(String::from("abcdecadeCADE")), 5);
    assert_eq!(candidate(String::from("aaaaAAAAaaaa")), 1);
    assert_eq!(candidate(String::from("Jerry jERRY JeRRRY")), 5);
}


Prompt:
/// Given a positive integer n, you have to make a pile of n levels of stones.
/// The first level has n stones.
/// The number of stones in the next level is:
/// - the next odd number if n is odd.
/// - the next even number if n is even.
/// Return the number of stones in each level in a vector, where element at index
/// i represents the number of stones in the level (i+1).
/// Examples:
/// >>> make_a_pile(3)
/// vec![3, 5, 7]
fn make_a_pile(n: isize) -> Vec<isize> {


Prompt:
/// You are given a vector arr of integers and you need to return
/// sum of magnitudes of integers multiplied by product of all signs
/// of each number in the vector, represented by 1, -1 or 0.
/// Note: return None for empty arr.
/// Example:
/// >>> prod_signs(vec![1, 2, 2, -4])
/// Some(9)
/// >>> prod_signs(vec![0, 1])
/// Some(0)
/// >>> prod_signs(vec![])
/// None
fn prod_signs(arr: Vec<isize>) -> Option<isize> {

}

fn main() {
    let candidate = prod_signs;
    assert_eq!(candidate(vec![1, 2, 2, -4]), Some(-9));
    assert_eq!(candidate(vec![0, 1]), Some(0));
    assert_eq!(candidate(vec![1, 1, 1, 2, 3, -1, 1]), Some(-10));
    assert_eq!(candidate(Vec::<isize>::new()), None);
    assert_eq!(candidate(vec![2, 4, 1, 2, -1, -1, 9]), Some(20));
    assert_eq!(candidate(vec![-1, 1, -1, 1]), Some(4));
    assert_eq!(candidate(vec![-1, 1, 1, 1]), Some(-4));
    assert_eq!(candidate(vec![-1, 1, 1, 0]), Some(0));
}


Prompt:
/// Given a vector of integers nums, find the minimum sum of any non-empty sub-vector
/// of nums.
/// Example
/// >>> minSubArraySum(vec![2, 3, 4, 1, 2, 4])
/// 1
/// >>> minSubArraySum(vec![-1, -2, -3])
/// -6
fn minSubArraySum(nums: Vec<isize>) -> isize {


Prompt:
/// Return a string containing space-delimited numbers starting from 0 upto n inclusive.
/// >>> string_sequence(0)
/// String::from("0")
/// >>> string_sequence(5)
/// String::from("0 1 2 3 4 5")
fn string_sequence(n: isize) -> String {

}

fn main() {
    let candidate = string_sequence;
    assert_eq!(candidate(0), String::from("0"));
    assert_eq!(candidate(3), String::from("0 1 2 3"));
    assert_eq!(candidate(10), String::from("0 1 2 3 4 5 6 7 8 9 10"));
}


Prompt:
/// You are given 2 words. You need to return true if the second word or any of its rotations is a substring in the first word
/// >>> cycpattern_check(String::from("abcd"), String::from("abd"))
/// false
/// >>> cycpattern_check(String::from("hello"), String::from("ell"))
/// true
/// >>> cycpattern_check(String::from("whassup"), String::from("psus"))
/// false
/// >>> cycpattern_check(String::from("abab"), String::from("baa"))
/// true
/// >>> cycpattern_check(String::from("efef"), String::from("eeff"))
/// false
/// >>> cycpattern_check(String::from("himenss"), String::from("simen"))
/// true
fn cycpattern_check(a: String, b: String) -> bool {

}

fn main() {
    let candidate = cycpattern_check;
    assert_eq!(candidate(String::from("xyzw"), String::from("xyw")), false);
    assert_eq!(candidate(String::from("yello"), String::from("ell")), true);
    assert_eq!(candidate(String::from("whattup"), String::from("ptut")), false);
    assert_eq!(candidate(String::from("efef"), String::from("fee")), true);
    assert_eq!(candidate(String::from("abab"), String::from("aabb")), false);
    assert_eq!(candidate(String::from("winemtt"), String::from("tinem")), true);
}


Prompt:
/// Return true is vector elements are monotonically increasing or decreasing.
/// >>> monotonic(vec![1, 2, 4, 20])
/// true
/// >>> monotonic(vec![1, 20, 4, 10])
/// false
/// >>> monotonic(vec![4, 1, 0, -10])
/// true
fn monotonic(l: Vec<isize>) -> bool {

}

fn main() {
    let candidate = monotonic;
    assert_eq!(candidate(vec![1, 2, 4, 10]), true);
    assert_eq!(candidate(vec![1, 2, 4, 20]), true);
    assert_eq!(candidate(vec![1, 20, 4, 10]), false);
    assert_eq!(candidate(vec![4, 1, 0, -10]), true);
    assert_eq!(candidate(vec![4, 1, 1, 0]), true);
    assert_eq!(candidate(vec![1, 2, 3, 2, 5, 60]), false);
    assert_eq!(candidate(vec![1, 2, 3, 4, 5, 60]), true);
    assert_eq!(candidate(vec![9, 9, 9, 9]), true);
}


Prompt:
/// Out of vector of strings, return the longest one. Return the first one in case of multiple
/// strings of the same length. Return None in case the input vector is empty.
/// >>> longest(vec![])
/// None
/// >>> longest(vec![String::from("a"), String::from("b"), String::from("c")])
/// Some(String::from("a"))
/// >>> longest(vec![String::from("a"), String::from("bb"), String::from("ccc")])
/// Some(String::from("ccc"))
fn longest(strings: Vec<String>) -> Option<String> {

}

fn main() {
    let candidate = longest;
    assert_eq!(candidate(Vec::<String>::new()), None);
    assert_eq!(candidate(vec![String::from("x"), String::from("y"), String::from("z")]), Some(String::from("x")));
    assert_eq!(candidate(vec![String::from("x"), String::from("yyy"), String::from("zzzz"), String::from("www"), String::from("kkkk"), String::from("abc")]), Some(String::from("zzzz")));
}


Prompt:
/// Return true if all numbers in the vector l are below threshold t.
/// >>> below_threshold(vec![1, 2, 4, 10], 100)
/// true
/// >>> below_threshold(vec![1, 20, 4, 10], 5)
/// false
fn below_threshold(l: Vec<isize>, t: isize) -> bool {

}

fn main() {
    let candidate = below_threshold;
    assert_eq!(candidate(vec![1, 2, 4, 10], 100), true);
    assert_eq!(candidate(vec![1, 20, 4, 10], 5), false);
    assert_eq!(candidate(vec![1, 20, 4, 10], 21), true);
    assert_eq!(candidate(vec![1, 20, 4, 10], 22), true);
    assert_eq!(candidate(vec![1, 8, 4, 10], 11), true);
    assert_eq!(candidate(vec![1, 8, 4, 10], 10), false);
}


Prompt:
/// Write a function that returns true if the given number is the multiplication of 3 prime numbers
/// and false otherwise.
/// Knowing that (a) is less then 100.
/// Example:
/// >>> is_multiply_prime(30)
/// true
/// 30 = 2 * 3 * 5
fn is_multiply_prime(a: isize) -> bool {

}

fn main() {
    let candidate = is_multiply_prime;
    assert_eq!(candidate(5), false);
    assert_eq!(candidate(30), true);
    assert_eq!(candidate(8), true);
    assert_eq!(candidate(10), false);
    assert_eq!(candidate(125), true);
    assert_eq!(candidate(105), true);
    assert_eq!(candidate(126), false);
    assert_eq!(candidate(729), false);
    assert_eq!(candidate(891), false);
    assert_eq!(candidate(1001), true);
}


Prompt:
/// Return only positive numbers in the vector.
/// >>> get_positive(vec![-1, 2, -4, 5, 6])
/// vec![2, 5, 6]
/// >>> get_positive(vec![5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])
/// vec![5, 3, 2, 3, 9, 123, 1]
fn get_positive(l: Vec<isize>) -> Vec<isize> {

}

fn main() {
    let candidate = get_positive;
    assert_eq!(candidate(vec![-1, -2, 4, 5, 6]), vec![4, 5, 6]);
    assert_eq!(candidate(vec![5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]), vec![5, 3, 2, 3, 3, 9, 123, 1]);
    assert_eq!(candidate(vec![-1, -2]), Vec::<isize>::new());
    assert_eq!(candidate(Vec::<isize>::new()), Vec::<isize>::new());
}


Prompt:
/// This function takes a vector l and returns a vector l' such that
/// l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal
/// to the values of the corresponding indicies of l, but sorted.
/// >>> sort_third(vec![1, 2, 3])
/// vec![1, 2, 3]
/// >>> sort_third(vec![5, 6, 3, 4, 8, 9, 2])
/// vec![2, 6, 3, 4, 8, 9, 5]
fn sort_third(l: Vec<isize>) -> Vec<isize> {


Prompt:
/// Input to this function is a string represented multiple groups for nested parentheses separated by spaces.
/// For each of the group, output the deepest level of nesting of parentheses.
/// E.g. (()()) has maximum two levels of nesting while ((())) has three.
/// >>> parse_nested_parens(String::from("(()()) ((())) () ((())()())"))
/// vec![2, 3, 1, 3]
fn parse_nested_parens(paren_string: String) -> Vec<isize> {


Prompt:
/// Given length of a side and high return area for a triangle.
/// >>> triangle_area(5, 3)
/// 7.5
fn triangle_area(a: isize, h: isize) -> f64 {

}

fn main() {
    let candidate = triangle_area;
    assert_eq!(candidate(5, 3), 7.5);
    assert_eq!(candidate(2, 2), 2.0);
    assert_eq!(candidate(10, 8), 40.0);
}


Prompt:
/// Complete the function that takes two integers and returns
/// the product of their unit digits.
/// Assume the input is always valid.
/// Examples:
/// >>> multiply(148, 412)
/// 16
/// >>> multiply(19, 28)
/// 72
/// >>> multiply(2020, 1851)
/// 0
/// >>> multiply(14, -15)
/// 20
fn multiply(a: isize, b: isize) -> isize {

}

fn main() {
    let candidate = multiply;
    assert_eq!(candidate(148, 412), 16);
    assert_eq!(candidate(19, 28), 72);
    assert_eq!(candidate(2020, 1851), 0);
    assert_eq!(candidate(14, -15), 20);
    assert_eq!(candidate(76, 67), 42);
    assert_eq!(candidate(17, 27), 49);
    assert_eq!(candidate(0, 1), 0);
    assert_eq!(candidate(0, 0), 0);
}


Prompt:
/// For a given vector of input numbers, calculate Mean Absolute Deviation
/// around the mean of this dataset.
/// Mean Absolute Deviation is the average absolute difference between each
/// element and a centerpoint (mean in this case):
/// MAD = average | x - x_mean |
/// >>> mean_absolute_deviation(vec![1.0, 2.0, 3.0, 4.0])
/// 1.0
fn mean_absolute_deviation(numbers: Vec<f64>) -> f64 {

}

fn main() {
    let candidate = mean_absolute_deviation;
    assert_eq!(candidate(vec![1.0, 2.0]), 0.5);
    assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0]), 1.0);
    assert_eq!(candidate(vec![1.0, 2.0, 3.0, 4.0, 5.0]), 1.2);
}


Prompt:
/// Return sorted unique common elements for two vectors.
/// >>> common(vec![1, 4, 3, 34, 653, 2, 5], vec![5, 7, 1, 5, 9, 653, 121])
/// vec![1, 5, 653]
/// >>> common(vec![5, 3, 2, 8], vec![3, 2])
/// vec![2, 3]
fn common(l1: Vec<isize>, l2: Vec<isize>) -> Vec<isize> {


Prompt:
/// Given a positive integer, obtain its roman numeral equivalent as a string,
/// and return it in lowercase.
/// Restrictions: 1 <= num <= 1000
/// Examples:
/// >>> int_to_mini_roman(19)
/// String::from("xix")
/// >>> int_to_mini_roman(152)
/// String::from("clii")
/// >>> int_to_mini_roman(426)
/// String::from("cdxxvi")
fn int_to_mini_roman(number: isize) -> String {

}

fn main() {
    let candidate = int_to_mini_roman;
    assert_eq!(candidate(19), String::from("xix"));
    assert_eq!(candidate(152), String::from("clii"));
    assert_eq!(candidate(251), String::from("ccli"));
    assert_eq!(candidate(426), String::from("cdxxvi"));
    assert_eq!(candidate(500), String::from("d"));
    assert_eq!(candidate(1), String::from("i"));
    assert_eq!(candidate(4), String::from("iv"));
    assert_eq!(candidate(43), String::from("xliii"));
    assert_eq!(candidate(90), String::from("xc"));
    assert_eq!(candidate(94), String::from("xciv"));
    assert_eq!(candidate(532), String::from("dxxxii"));
    assert_eq!(candidate(900), String::from("cm"));
    assert_eq!(candidate(994), String::from("cmxciv"));
    assert_eq!(candidate(1000), String::from("m"));
}


Prompt:
/// In this task, you will be given a string that represents a number of apples and oranges
/// that are distributed in a basket of fruit this basket contains
/// apples, oranges, and mango fruits. Given the string that represents the total number of
/// the oranges and apples and an integer that represent the total number of the fruits
/// in the basket return the number of the mango fruits in the basket.
/// for examble:
/// >>> fruit_distribution(String::from("5 apples and 6 oranges"), 19)
/// 8
/// >>> fruit_distribution(String::from("0 apples and 1 oranges"), 3)
/// 2
/// >>> fruit_distribution(String::from("2 apples and 3 oranges"), 100)
/// 95
/// >>> fruit_distribution(String::from("100 apples and 1 oranges"), 120)
/// 19
fn fruit_distribution(s: String, n: isize) -> isize {

}

fn main() {
    let candidate = fruit_distribution;
    assert_eq!(candidate(String::from("5 apples and 6 oranges"), 19), 8);
    assert_eq!(candidate(String::from("5 apples and 6 oranges"), 21), 10);
    assert_eq!(candidate(String::from("0 apples and 1 oranges"), 3), 2);
    assert_eq!(candidate(String::from("1 apples and 0 oranges"), 3), 2);
    assert_eq!(candidate(String::from("2 apples and 3 oranges"), 100), 95);
    assert_eq!(candidate(String::from("2 apples and 3 oranges"), 5), 0);
    assert_eq!(candidate(String::from("1 apples and 100 oranges"), 120), 19);
}


Prompt:
/// Task
/// We are given two strings s and c, you have to deleted all the characters in s that are equal to any character in c
/// then check if the result string is palindrome.
/// A string is called palindrome if it reads the same backward as forward.
/// You should return a tuple containing the result string and true/false for the check.
/// Example
/// >>> reverse_delete(String::from("abcde"), String::from("ae"))
/// (String::from("bcd"), false)
/// >>> reverse_delete(String::from("abcdef"), String::from("b"))
/// (String::from("acdef"), false)
/// >>> reverse_delete(String::from("abcdedcba"), String::from("ab"))
/// (String::from("cdedc"), true)
fn reverse_delete(s: String, c: String) -> (String, bool) {

}

fn main() {
    let candidate = reverse_delete;
    assert_eq!(candidate(String::from("abcde"), String::from("ae")), (String::from("bcd"), false));
    assert_eq!(candidate(String::from("abcdef"), String::from("b")), (String::from("acdef"), false));
    assert_eq!(candidate(String::from("abcdedcba"), String::from("ab")), (String::from("cdedc"), true));
    assert_eq!(candidate(String::from("dwik"), String::from("w")), (String::from("dik"), false));
    assert_eq!(candidate(String::from("a"), String::from("a")), (String::from(""), true));
    assert_eq!(candidate(String::from("abcdedcba"), String::from("")), (String::from("abcdedcba"), true));
    assert_eq!(candidate(String::from("abcdedcba"), String::from("v")), (String::from("abcdedcba"), true));
    assert_eq!(candidate(String::from("vabba"), String::from("v")), (String::from("abba"), true));
    assert_eq!(candidate(String::from("mamma"), String::from("mia")), (String::from(""), true));
}


Prompt:
/// Return a greatest common divisor of two integers a and b
/// >>> greatest_common_divisor(3, 5)
/// 1
/// >>> greatest_common_divisor(25, 15)
/// 5
fn greatest_common_divisor(a: isize, b: isize) -> isize {

}

fn main() {
    let candidate = greatest_common_divisor;
    assert_eq!(candidate(3, 7), 1);
    assert_eq!(candidate(10, 15), 5);
    assert_eq!(candidate(49, 14), 7);
    assert_eq!(candidate(144, 60), 12);
}


Prompt:
/// In this Kata, you have to sort a vector of non-negative integers according to
/// number of ones in their binary representation in ascending order.
/// For similar number of ones, sort based on decimal value.
/// It must be implemented like this:
/// >>> sort_array(vec![1, 5, 2, 3, 4])
/// vec![1, 2, 3, 4, 5]
/// >>> sort_array(vec![-2, -3, -4, -5, -6])
/// vec![-6, -5, -4, -3, -2]
/// >>> sort_array(vec![1, 0, 2, 3, 4])
/// vec![0, 1, 2, 3, 4]
fn sort_array(arr: Vec<isize>) -> Vec<isize> {


Prompt:
/// Concatenate vector of strings into a single string
/// >>> concatenate(vec![])
/// String::from("")
/// >>> concatenate(vec![String::from("a"), String::from("b"), String::from("c")])
/// String::from("abc")
fn concatenate(strings: Vec<String>) -> String {

}

fn main() {
    let candidate = concatenate;
    assert_eq!(candidate(Vec::<String>::new()), String::from(""));
    assert_eq!(candidate(vec![String::from("x"), String::from("y"), String::from("z")]), String::from("xyz"));
    assert_eq!(candidate(vec![String::from("x"), String::from("y"), String::from("z"), String::from("w"), String::from("k")]), String::from("xyzwk"));
}


Prompt:
/// Write a function that accepts a vector of strings as a parameter,
/// deletes the strings that have odd lengths from it,
/// and returns the resulted vector with a sorted order,
/// The vector is always a vector of strings and never a vector of numbers,
/// and it may contain duplicates.
/// The order of the vector should be ascending by length of each word, and you
/// should return the vector sorted by that rule.
/// If two words have the same length, sort the vector alphabetically.
/// The function should return a vector of strings in sorted order.
/// You may assume that all words will have the same length.
/// For example:
/// >>> list_sort(vec![String::from("aa"), String::from("a"), String::from("aaa")])
/// vec![String::from("aa")]
/// >>> list_sort(vec![String::from("ab"), String::from("a"), String::from("aaa"), String::from("cd")])
/// vec![String::from("ab"), String::from("cd")]
fn sorted_list_sum(lst: Vec<String>) -> Vec<String> {

}

fn main() {
    let candidate = sorted_list_sum;
    assert_eq!(candidate(vec![String::from("aa"), String::from("a"), String::from("aaa")]), vec![String::from("aa")]);
    assert_eq!(candidate(vec![String::from("school"), String::from("AI"), String::from("asdf"), String::from("b")]), vec![String::from("AI"), String::from("asdf"), String::from("school")]);
    assert_eq!(candidate(vec![String::from("d"), String::from("b"), String::from("c"), String::from("a")]), Vec::<String>::new());
    assert_eq!(candidate(vec![String::from("d"), String::from("dcba"), String::from("abcd"), String::from("a")]), vec![String::from("abcd"), String::from("dcba")]);
    assert_eq!(candidate(vec![String::from("AI"), String::from("ai"), String::from("au")]), vec![String::from("AI"), String::from("ai"), String::from("au")]);
    assert_eq!(candidate(vec![String::from("a"), String::from("b"), String::from("b"), String::from("c"), String::from("c"), String::from("a")]), Vec::<String>::new());
    assert_eq!(candidate(vec![String::from("aaaa"), String::from("bbbb"), String::from("dd"), String::from("cc")]), vec![String::from("cc"), String::from("dd"), String::from("aaaa"), String::from("bbbb")]);
}


Prompt:
/// Filter an input vector of strings only for ones that contain given substring
/// >>> filter_by_substring(vec![], String::from("a"))
/// Vec::<String>::new()
/// >>> filter_by_substring(vec![String::from("abc"), String::from("bacd"), String::from("cde"), String::from("array")], String::from("a"))
/// vec![String::from("abc"), String::from("bacd"), String::from("array")]
fn filter_by_substring(strings: Vec<String>, substring: String) -> Vec<String> {

}

fn main() {
    let candidate = filter_by_substring;
    assert_eq!(candidate(Vec::<String>::new(), String::from("john")), Vec::<String>::new());
    assert_eq!(candidate(vec![String::from("xxx"), String::from("asd"), String::from("xxy"), String::from("john doe"), String::from("xxxAAA"), String::from("xxx")], String::from("xxx")), vec![String::from("xxx"), String::from("xxxAAA"), String::from("xxx")]);
    assert_eq!(candidate(vec![String::from("xxx"), String::from("asd"), String::from("aaaxxy"), String::from("john doe"), String::from("xxxAAA"), String::from("xxx")], String::from("xx")), vec![String::from("xxx"), String::from("aaaxxy"), String::from("xxxAAA"), String::from("xxx")]);
    assert_eq!(candidate(vec![String::from("grunt"), String::from("trumpet"), String::from("prune"), String::from("gruesome")], String::from("run")), vec![String::from("grunt"), String::from("prune")]);
}


Prompt:
/// Create a function that takes a value (string) representing a number
/// and returns the closest integer to it. If the number is equidistant
/// from two integers, round it away from zero.
/// Examples
/// >>> closest_integer(String::from("10"))
/// 10
/// >>> closest_integer(String::from("15.3"))
/// 15
/// Note:
/// Rounding away from zero means that if the given number is equidistant
/// from two integers, the one you should return is the one that is the
/// farthest from zero. For example closest_integer("14.5") should
/// return 15 and closest_integer("-14.5") should return -15.
fn closest_integer(value: String) -> isize {

}

fn main() {
    let candidate = closest_integer;
    assert_eq!(candidate(String::from("10")), 10);
    assert_eq!(candidate(String::from("14.5")), 15);
    assert_eq!(candidate(String::from("-15.5")), -16);
    assert_eq!(candidate(String::from("15.3")), 15);
    assert_eq!(candidate(String::from("0")), 0);
}


Prompt:
/// Write a function vowels_count which takes a string representing
/// a word as input and returns the number of vowels in the string.
/// Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a
/// vowel, but only when it is at the end of the given word.
/// Example:
/// >>> vowels_count(String::from("abcde"))
/// 2
/// >>> vowels_count(String::from("ACEDY"))
/// 3
fn vowels_count(s: String) -> isize {

}

fn main() {
    let candidate = vowels_count;
    assert_eq!(candidate(String::from("abcde")), 2);
    assert_eq!(candidate(String::from("Alone")), 3);
    assert_eq!(candidate(String::from("key")), 2);
    assert_eq!(candidate(String::from("bye")), 1);
    assert_eq!(candidate(String::from("keY")), 2);
    assert_eq!(candidate(String::from("bYe")), 1);
    assert_eq!(candidate(String::from("ACEDY")), 3);
}


Prompt:
/// Write a function that accepts a vector of strings.
/// The vector contains different words. Return the word with maximum number
/// of unique characters. If multiple strings have maximum number of unique
/// characters, return the one which comes first in lexicographical order.
/// >>> find_max(vec![String::from("name"), String::from("of"), String::from("string")])
/// String::from("string")
/// >>> find_max(vec![String::from("name"), String::from("enam"), String::from("game")])
/// String::from("enam")
/// >>> find_max(vec![String::from("aaaaaaa"), String::from("bb"), String::from("cc")])
/// String::from("aaaaaaa")
fn find_max(words: Vec<String>) -> String {

}

fn main() {
    let candidate = find_max;
    assert_eq!(candidate(vec![String::from("name"), String::from("of"), String::from("string")]), String::from("string"));
    assert_eq!(candidate(vec![String::from("name"), String::from("enam"), String::from("game")]), String::from("enam"));
    assert_eq!(candidate(vec![String::from("aaaaaaa"), String::from("bb"), String::from("cc")]), String::from("aaaaaaa"));
    assert_eq!(candidate(vec![String::from("abc"), String::from("cba")]), String::from("abc"));
    assert_eq!(candidate(vec![String::from("play"), String::from("this"), String::from("game"), String::from("of"), String::from("footbott")]), String::from("footbott"));
    assert_eq!(candidate(vec![String::from("we"), String::from("are"), String::from("gonna"), String::from("rock")]), String::from("gonna"));
    assert_eq!(candidate(vec![String::from("we"), String::from("are"), String::from("a"), String::from("mad"), String::from("nation")]), String::from("nation"));
    assert_eq!(candidate(vec![String::from("this"), String::from("is"), String::from("a"), String::from("prrk")]), String::from("this"));
    assert_eq!(candidate(vec![String::from("b")]), String::from("b"));
    assert_eq!(candidate(vec![String::from("play"), String::from("play"), String::from("play")]), String::from("play"));
}


Prompt:
/// Given a string 'text', return its md5 hash equivalent string.
/// If 'text' is an empty string, return None.
/// >>> string_to_md5(String::from("Hello world"))
/// Some(String::from("3e25960a79dbc69b674cd4ec67a72c62"))
fn string_to_md5(text: String) -> Option<String> {

}

fn main() {
    let candidate = string_to_md5;
    assert_eq!(candidate(String::from("Hello world")), Some(String::from("3e25960a79dbc69b674cd4ec67a72c62")));
    assert_eq!(candidate(String::from("")), None);
    assert_eq!(candidate(String::from("A B C")), Some(String::from("0ef78513b0cb8cef12743f5aeb35f888")));
    assert_eq!(candidate(String::from("password")), Some(String::from("5f4dcc3b5aa765d61d8327deb882cf99")));
}


Prompt:
/// Change numerical base of input number x to base.
/// return string representation after the conversion.
/// base numbers are less than 10.
/// >>> change_base(8, 3)
/// String::from("22")
/// >>> change_base(8, 2)
/// String::from("1000")
/// >>> change_base(7, 2)
/// String::from("111")
fn change_base(x: isize, base: isize) -> String {

}

fn main() {
    let candidate = change_base;
    assert_eq!(candidate(8, 3), String::from("22"));
    assert_eq!(candidate(9, 3), String::from("100"));
    assert_eq!(candidate(234, 2), String::from("11101010"));
    assert_eq!(candidate(16, 2), String::from("10000"));
    assert_eq!(candidate(8, 2), String::from("1000"));
    assert_eq!(candidate(7, 2), String::from("111"));
    assert_eq!(candidate(2, 3), String::from("2"));
    assert_eq!(candidate(3, 4), String::from("3"));
    assert_eq!(candidate(4, 5), String::from("4"));
    assert_eq!(candidate(5, 6), String::from("5"));
    assert_eq!(candidate(6, 7), String::from("6"));
    assert_eq!(candidate(7, 8), String::from("7"));
}


Prompt:
/// Given the lengths of the three sides of a triangle. Return true if the three
/// sides form a right-angled triangle, false otherwise.
/// A right-angled triangle is a triangle in which one angle is right angle or
/// 90 degree.
/// Example:
/// >>> right_angle_triangle(3, 4, 5)
/// true
/// >>> right_angle_triangle(1, 2, 3)
/// false
fn right_angle_triangle(a: isize, b: isize, c: isize) -> bool {

}

fn main() {
    let candidate = right_angle_triangle;
    assert_eq!(candidate(3, 4, 5), true);
    assert_eq!(candidate(1, 2, 3), false);
    assert_eq!(candidate(10, 6, 8), true);
    assert_eq!(candidate(2, 2, 2), false);
    assert_eq!(candidate(7, 24, 25), true);
    assert_eq!(candidate(10, 5, 7), false);
    assert_eq!(candidate(5, 12, 13), true);
    assert_eq!(candidate(15, 8, 17), true);
    assert_eq!(candidate(48, 55, 73), true);
    assert_eq!(candidate(1, 1, 1), false);
    assert_eq!(candidate(2, 2, 10), false);
}


Prompt:
/// It is the last week of the semester and the teacher has to give the grades
/// to students. The teacher has been making her own algorithm for grading.
/// The only problem is, she has lost the code she used for grading.
/// She has given you a vector of GPAs for some students and you have to write
/// a function that can output a vector of letter grades using the following table:
/// GPA       |    Letter grade
/// 4.0                A+
/// > 3.7                A
/// > 3.3                A-
/// > 3.0                B+
/// > 2.7                B
/// > 2.3                B-
/// > 2.0                C+
/// > 1.7                C
/// > 1.3                C-
/// > 1.0                D+
/// > 0.7                D
/// > 0.0                D-
/// 0.0                E
/// Example:
/// >>> grade_equation(vec![4.0, 3, 1.7, 2, 3.5])
/// vec![String::from("A+"), String::from("B"), String::from("C-"), String::from("C"), String::from("A-")]
fn numerical_letter_grade(grades: Vec<f64>) -> Vec<String> {

}

fn main() {
    let candidate = numerical_letter_grade;
    assert_eq!(candidate(vec![4.0, 3.0, 1.7, 2.0, 3.5]), vec![String::from("A+"), String::from("B"), String::from("C-"), String::from("C"), String::from("A-")]);
    assert_eq!(candidate(vec![1.2]), vec![String::from("D+")]);
    assert_eq!(candidate(vec![0.5]), vec![String::from("D-")]);
    assert_eq!(candidate(vec![0.0]), vec![String::from("E")]);
    assert_eq!(candidate(vec![1.0, 0.3, 1.5, 2.8, 3.3]), vec![String::from("D"), String::from("D-"), String::from("C-"), String::from("B"), String::from("B+")]);
    assert_eq!(candidate(vec![0.0, 0.7]), vec![String::from("E"), String::from("D-")]);
}


Prompt:
/// Insert a number 'delimeter' between every two consecutive elements of input vector `numbers'
/// >>> intersperse(vec![], 4)
/// Vec::<isize>::new()
/// >>> intersperse(vec![1, 2, 3], 4)
/// vec![1, 4, 2, 4, 3]
fn intersperse(numbers: Vec<isize>, delimeter: isize) -> Vec<isize> {

}

fn main() {
    let candidate = intersperse;
    assert_eq!(candidate(Vec::<isize>::new(), 7), Vec::<isize>::new());
    assert_eq!(candidate(vec![5, 6, 3, 2], 8), vec![5, 8, 6, 8, 3, 8, 2]);
    assert_eq!(candidate(vec![2, 2, 2], 2), vec![2, 2, 2, 2, 2]);
}


Prompt:
/// Write a function that takes a vector of numbers as input and returns
/// the number of elements in the vector that are greater than 10 and both
/// first and last digits of a number are odd (1, 3, 5, 7, 9).
/// For example:
/// >>> specialFilter(vec![15, -73, 14, -15])
/// 1
/// >>> specialFilter(vec![33, -2, -3, 45, 21, 109])
/// 2
fn specialFilter(nums: Vec<isize>) -> isize {

}

fn main() {
    let candidate = specialFilter;
    assert_eq!(candidate(vec![5, -2, 1, -5]), 0);
    assert_eq!(candidate(vec![15, -73, 14, -15]), 1);
    assert_eq!(candidate(vec![33, -2, -3, 45, 21, 109]), 2);
    assert_eq!(candidate(vec![43, -12, 93, 125, 121, 109]), 4);
    assert_eq!(candidate(vec![71, -2, -33, 75, 21, 19]), 3);
    assert_eq!(candidate(vec![1]), 0);
    assert_eq!(candidate(Vec::<isize>::new()), 0);
}


Prompt:
/// sum_to_n is a function that sums numbers from 1 to n.
/// >>> sum_to_n(30)
/// 465
/// >>> sum_to_n(100)
/// 5050
/// >>> sum_to_n(5)
/// 15
/// >>> sum_to_n(10)
/// 55
/// >>> sum_to_n(1)
/// 1
fn sum_to_n(n: isize) -> isize {

}

fn main() {
    let candidate = sum_to_n;
    assert_eq!(candidate(1), 1);
    assert_eq!(candidate(6), 21);
    assert_eq!(candidate(11), 66);
    assert_eq!(candidate(30), 465);
    assert_eq!(candidate(100), 5050);
}


Prompt:
/// From a vector of integers, remove all elements that occur more than once.
/// Keep order of elements left the same as in the input.
/// >>> remove_duplicates(vec![1, 2, 3, 2, 4])
/// vec![1, 3, 4]
fn remove_duplicates(numbers: Vec<isize>) -> Vec<isize> {

}

fn main() {
    let candidate = remove_duplicates;
    assert_eq!(candidate(Vec::<isize>::new()), Vec::<isize>::new());
    assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 2, 3, 4]);
    assert_eq!(candidate(vec![1, 2, 3, 2, 4, 3, 5]), vec![1, 4, 5]);
}


Prompt:
/// Given two positive integers a and b, return the even digits between a
/// and b, in ascending order.
/// For example:
/// >>> generate_integers(2, 8)
/// vec![2, 4, 6, 8]
/// >>> generate_integers(8, 2)
/// vec![2, 4, 6, 8]
/// >>> generate_integers(10, 14)
/// Vec::<isize>::new()
fn generate_integers(a: isize, b: isize) -> Vec<isize> {

}

fn main() {
    let candidate = generate_integers;
    assert_eq!(candidate(2, 10), vec![2, 4, 6, 8]);
    assert_eq!(candidate(10, 2), vec![2, 4, 6, 8]);
    assert_eq!(candidate(132, 2), vec![2, 4, 6, 8]);
    assert_eq!(candidate(17, 89), Vec::<isize>::new());
}


Prompt:
/// From a given vector of integers, generate a vector of rolling maximum element found until given moment
/// in the sequence.
/// >>> rolling_max(vec![1, 2, 3, 2, 3, 4, 2])
/// vec![1, 2, 3, 3, 3, 4, 4]
fn rolling_max(numbers: Vec<isize>) -> Vec<isize> {

}

fn main() {
    let candidate = rolling_max;
    assert_eq!(candidate(Vec::<isize>::new()), Vec::<isize>::new());
    assert_eq!(candidate(vec![1, 2, 3, 4]), vec![1, 2, 3, 4]);
    assert_eq!(candidate(vec![4, 3, 2, 1]), vec![4, 4, 4, 4]);
    assert_eq!(candidate(vec![3, 2, 3, 100, 3]), vec![3, 3, 3, 100, 100]);
}


Prompt:
/// You're given a vector of deposit and withdrawal operations on a bank account that starts with
/// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
/// at that point function should return true. Otherwise it should return false.
/// >>> below_zero(vec![1, 2, 3])
/// false
/// >>> below_zero(vec![1, 2, -4, 5])
/// true
fn below_zero(operations: Vec<isize>) -> bool {

}

fn main() {
    let candidate = below_zero;
    assert_eq!(candidate(Vec::<isize>::new()), false);
    assert_eq!(candidate(vec![1, 2, -3, 1, 2, -3]), false);
    assert_eq!(candidate(vec![1, 2, -4, 5, 6]), true);
    assert_eq!(candidate(vec![1, -1, 2, -2, 5, -5, 4, -4]), false);
    assert_eq!(candidate(vec![1, -1, 2, -2, 5, -5, 4, -5]), true);
    assert_eq!(candidate(vec![1, -2, 2, -2, 5, -5, 4, -4]), true);
}


Prompt:
/// You are given a non-empty vector of positive integers. Return the greatest integer that is greater than
/// zero, and has a frequency greater than or equal to the value of the integer itself.
/// The frequency of an integer is the number of times it appears in the vector.
/// If no such a value exist, return -1.
/// Examples:
/// >>> search(vec![4, 1, 2, 2, 3, 1])
/// 2
/// >>> search(vec![1, 2, 2, 3, 3, 3, 4, 4, 4])
/// 3
/// >>> search(vec![5, 5, 4, 4, 4])
/// -1
fn search(lst: Vec<isize>) -> isize {


Prompt:
/// brackets is a string of "(" and ")".
/// return true if every opening bracket has a corresponding closing bracket.
/// >>> correct_bracketing(String::from("("))
/// false
/// >>> correct_bracketing(String::from("()"))
/// true
/// >>> correct_bracketing(String::from("(()())"))
/// true
/// >>> correct_bracketing(String::from(")(()"))
/// false
fn correct_bracketing(brackets: String) -> bool {

}

fn main() {
    let candidate = correct_bracketing;
    assert_eq!(candidate(String::from("()")), true);
    assert_eq!(candidate(String::from("(()())")), true);
    assert_eq!(candidate(String::from("()()(()())()")), true);
    assert_eq!(candidate(String::from("()()((()()())())(()()(()))")), true);
    assert_eq!(candidate(String::from("((()())))")), false);
    assert_eq!(candidate(String::from(")(()")), false);
    assert_eq!(candidate(String::from("(")), false);
    assert_eq!(candidate(String::from("((((")), false);
    assert_eq!(candidate(String::from(")")), false);
    assert_eq!(candidate(String::from("(()")), false);
    assert_eq!(candidate(String::from("()()(()())())(()")), false);
    assert_eq!(candidate(String::from("()()(()())()))()")), false);
}


Prompt:
/// This function takes a vector l and returns a vector l' such that
/// l' is identical to l in the odd indicies, while its values at the even indicies are equal
/// to the values of the even indicies of l, but sorted.
/// >>> sort_even(vec![1, 2, 3])
/// vec![1, 2, 3]
/// >>> sort_even(vec![5, 6, 3, 4])
/// vec![3, 6, 5, 4]
fn sort_even(l: Vec<isize>) -> Vec<isize> {


Prompt:
/// Check if two words have the same characters.
/// >>> same_chars(String::from("eabcdzzzz"), String::from("dddzzzzzzzddeddabc"))
/// true
/// >>> same_chars(String::from("abcd"), String::from("dddddddabc"))
/// true
/// >>> same_chars(String::from("dddddddabc"), String::from("abcd"))
/// true
/// >>> same_chars(String::from("eabcd"), String::from("dddddddabc"))
/// false
/// >>> same_chars(String::from("abcd"), String::from("dddddddabce"))
/// false
/// >>> same_chars(String::from("eabcdzzzz"), String::from("dddzzzzzzzddddabc"))
/// false
fn same_chars(s0: String, s1: String) -> bool {

}

fn main() {
    let candidate = same_chars;
    assert_eq!(candidate(String::from("eabcdzzzz"), String::from("dddzzzzzzzddeddabc")), true);
    assert_eq!(candidate(String::from("abcd"), String::from("dddddddabc")), true);
    assert_eq!(candidate(String::from("dddddddabc"), String::from("abcd")), true);
    assert_eq!(candidate(String::from("eabcd"), String::from("dddddddabc")), false);
    assert_eq!(candidate(String::from("abcd"), String::from("dddddddabcf")), false);
    assert_eq!(candidate(String::from("eabcdzzzz"), String::from("dddzzzzzzzddddabc")), false);
    assert_eq!(candidate(String::from("aabb"), String::from("aaccc")), false);
}


Prompt:
/// brackets is a string of "<" and ">".
/// return true if every opening bracket has a corresponding closing bracket.
/// >>> correct_bracketing(String::from("<"))
/// false
/// >>> correct_bracketing(String::from("<>"))
/// true
/// >>> correct_bracketing(String::from("<<><>>"))
/// true
/// >>> correct_bracketing(String::from("><<>"))
/// false
fn correct_bracketing(brackets: String) -> bool {

}

fn main() {
    let candidate = correct_bracketing;
    assert_eq!(candidate(String::from("<>")), true);
    assert_eq!(candidate(String::from("<<><>>")), true);
    assert_eq!(candidate(String::from("<><><<><>><>")), true);
    assert_eq!(candidate(String::from("<><><<<><><>><>><<><><<>>>")), true);
    assert_eq!(candidate(String::from("<<<><>>>>")), false);
    assert_eq!(candidate(String::from("><<>")), false);
    assert_eq!(candidate(String::from("<")), false);
    assert_eq!(candidate(String::from("<<<<")), false);
    assert_eq!(candidate(String::from(">")), false);
    assert_eq!(candidate(String::from("<<>")), false);
    assert_eq!(candidate(String::from("<><><<><>><>><<>")), false);
    assert_eq!(candidate(String::from("<><><<><>><>>><>")), false);
}