Prompt:
/// You are given a word. Your task is to find the closest vowel that stands between
/// two consonants from the right side of the word (case sensitive).
/// Vowels in the beginning and ending doesn't count. Return empty string if you didn't
/// find any vowel met the above condition.
/// You may assume that the given string contains English letter only.
/// Example:
/// >>> get_closest_vowel(word: "yogurt")
/// "u"
/// >>> get_closest_vowel(word: "FULL")
/// "U"
/// >>> get_closest_vowel(word: "quick")
/// ""
/// >>> get_closest_vowel(word: "ab")
/// ""
func get_closest_vowel(word: String) -> String {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(get_closest_vowel(word: "yogurt") == "u")
assert(get_closest_vowel(word: "full") == "u")
assert(get_closest_vowel(word: "easy") == "")
assert(get_closest_vowel(word: "eAsy") == "")
assert(get_closest_vowel(word: "ali") == "")
assert(get_closest_vowel(word: "bad") == "a")
assert(get_closest_vowel(word: "most") == "o")
assert(get_closest_vowel(word: "ab") == "")
assert(get_closest_vowel(word: "ba") == "")
assert(get_closest_vowel(word: "quick") == "")
assert(get_closest_vowel(word: "anime") == "i")
assert(get_closest_vowel(word: "Asia") == "")
assert(get_closest_vowel(word: "Above") == "o")


Prompt:
/// Return true if a given number is prime, and false otherwise.
/// >>> is_prime(n: 6)
/// false
/// >>> is_prime(n: 101)
/// true
/// >>> is_prime(n: 11)
/// true
/// >>> is_prime(n: 13441)
/// true
/// >>> is_prime(n: 61)
/// true
/// >>> is_prime(n: 4)
/// false
/// >>> is_prime(n: 1)
/// false
func is_prime(n: Int) -> Bool {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(is_prime(n: 6) == false)
assert(is_prime(n: 101) == true)
assert(is_prime(n: 11) == true)
assert(is_prime(n: 13441) == true)
assert(is_prime(n: 61) == true)
assert(is_prime(n: 4) == false)
assert(is_prime(n: 1) == false)
assert(is_prime(n: 5) == true)
assert(is_prime(n: 11) == true)
assert(is_prime(n: 17) == true)
assert(is_prime(n: 85) == false)
assert(is_prime(n: 77) == false)
assert(is_prime(n: 255379) == false)


Prompt:
/// Your task is to implement a function that will simplify the expression
/// x * n. The function returns true if x * n evaluates to a whole number and false
/// otherwise. Both x and n, are string representation of a fraction, and have the following format,
/// <numerator>/<denominator> where both numerator and denominator are positive whole numbers.
/// You can assume that x, and n are valid fractions, and do not have zero as denominator.
/// >>> simplify(x: "1/5", n: "5/1")
/// true
/// >>> simplify(x: "1/6", n: "2/1")
/// false
/// >>> simplify(x: "7/10", n: "10/2")
/// false
func simplify(x: String, n: String) -> Bool {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(simplify(x: "1/5", n: "5/1") == true)
assert(simplify(x: "1/6", n: "2/1") == false)
assert(simplify(x: "5/1", n: "3/1") == true)
assert(simplify(x: "7/10", n: "10/2") == false)
assert(simplify(x: "2/10", n: "50/10") == true)
assert(simplify(x: "7/2", n: "4/2") == true)
assert(simplify(x: "11/6", n: "6/1") == true)
assert(simplify(x: "2/3", n: "5/2") == false)
assert(simplify(x: "5/2", n: "3/5") == false)
assert(simplify(x: "2/4", n: "8/4") == true)
assert(simplify(x: "2/4", n: "4/2") == true)
assert(simplify(x: "1/5", n: "5/1") == true)
assert(simplify(x: "1/5", n: "1/5") == false)


Prompt:
/// You have been tasked to write a function that receives
/// a hexadecimal number as a string and counts the number of hexadecimal
/// digits that are primes (prime number, or a prime, is a natural number
/// greater than 1 that is not a product of two smaller natural numbers).
/// Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
/// Prime numbers are 2, 3, 5, 7, 11, 13, 17,...
/// So you have to determine a number of the following digits: 2, 3, 5, 7,
/// B (=decimal 11), D (=decimal 13).
/// Note: you may assume the input is always correct or empty string,
/// and symbols A,B,C,D,E,F are always uppercase.
/// Examples:
/// >>> hex_key(num: "AB")
/// 1
/// >>> hex_key(num: "1077E")
/// 2
/// >>> hex_key(num: "ABED1A33")
/// 4
/// >>> hex_key(num: "123456789ABCDEF0")
/// 6
/// >>> hex_key(num: "2020")
/// 2
func hex_key(num: String) -> Int {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(hex_key(num: "AB") == 1)
assert(hex_key(num: "1077E") == 2)
assert(hex_key(num: "ABED1A33") == 4)
assert(hex_key(num: "2020") == 2)
assert(hex_key(num: "123456789ABCDEF0") == 6)
assert(hex_key(num: "112233445566778899AABBCCDDEEFF00") == 12)


Prompt:
/// You are given a string representing a sentence,
/// the sentence contains some words separated by a space,
/// and you have to return a string that contains the words from the original sentence,
/// whose lengths are prime numbers,
/// the order of the words in the new string should be the same as the original one.
/// Example 1:
/// >>> words_in_sentence(sentence: "This is a test")
/// "is"
/// Example 2:
/// >>> words_in_sentence(sentence: "lets go for swimming")
/// "go for"
/// Constraints:
/// * 1 <= len(sentence) <= 100
/// * sentence contains only letters
func words_in_sentence(sentence: String) -> String {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(words_in_sentence(sentence: "This is a test") == "is")
assert(words_in_sentence(sentence: "lets go for swimming") == "go for")
assert(words_in_sentence(sentence: "there is no place available here") == "there is no place")
assert(words_in_sentence(sentence: "Hi I am Hussein") == "Hi am Hussein")
assert(words_in_sentence(sentence: "go for it") == "go for it")
assert(words_in_sentence(sentence: "here") == "")
assert(words_in_sentence(sentence: "here is") == "is")


Prompt:
/// Given a string representing a space separated lowercase letters, return a dictionary
/// of the letter with the most repetition and containing the corresponding count.
/// If several letters have the same occurrence, return all of them.
/// Example:
/// >>> histogram(test: "a b c")
/// ["a" : 1, "b" : 1, "c" : 1]
/// >>> histogram(test: "a b b a")
/// ["a" : 2, "b" : 2]
/// >>> histogram(test: "a b c a b")
/// ["a" : 2, "b" : 2]
/// >>> histogram(test: "b b b b a")
/// ["b" : 4]
/// >>> histogram(test: "")
/// [:] as [String : Int]
func histogram(test: String) -> [String : Int] {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(histogram(test: "a b b a") == ["a" : 2, "b" : 2])
assert(histogram(test: "a b c a b") == ["a" : 2, "b" : 2])
assert(histogram(test: "a b c d g") == ["a" : 1, "b" : 1, "c" : 1, "d" : 1, "g" : 1])
assert(histogram(test: "r t g") == ["r" : 1, "t" : 1, "g" : 1])
assert(histogram(test: "b b b b a") == ["b" : 4])
assert(histogram(test: "r t g") == ["r" : 1, "t" : 1, "g" : 1])
assert(histogram(test: "") == [:] as [String : Int])
assert(histogram(test: "a") == ["a" : 1])


Prompt:
/// You are given a 2 dimensional data, as a nested arrays,
/// which is similar to matrix, however, unlike matrices,
/// each row may contain a different number of columns.
/// Given lst, and integer x, find integers x in the array,
/// and return array of tuples, [(x1, y1), (x2, y2) ...] such that
/// each tuple is a coordinate - (row, columns), starting with 0.
/// Sort coordinates initially by rows in ascending order.
/// Also, sort coordinates of the row by columns in descending order.
/// Examples:
/// >>> get_row(lst: [[1, 2, 3, 4, 5, 6], [1, 2, 3, 4, 1, 6], [1, 2, 3, 4, 5, 1]], x: 1)
/// [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]
/// >>> get_row(lst: [] as [[Int]], x: 1)
/// [] as [(Int, Int)]
/// >>> get_row(lst: [[] as [Int], [1], [1, 2, 3]], x: 3)
/// [(2, 2)]
func get_row(lst: [[Int]], x: Int) -> [(Int, Int)] {


Prompt:
/// Given a positive integer n, return a sorted array that has the odd numbers in collatz sequence.
/// The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined
/// as follows: start with any positive integer n. Then each term is obtained from the
/// previous term as follows: if the previous term is even, the next term is one half of
/// the previous term. If the previous term is odd, the next term is 3 times the previous
/// term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.
/// Note:
/// 1. Collatz(1) is [1].
/// 2. returned array sorted in increasing order.
/// For example:
/// get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.
/// >>> get_odd_collatz(n: 5)
/// [1, 5]
func get_odd_collatz(n: Int) -> [Int] {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(get_odd_collatz(n: 14) == [1, 5, 7, 11, 13, 17])
assert(get_odd_collatz(n: 5) == [1, 5])
assert(get_odd_collatz(n: 12) == [1, 3, 5])
assert(get_odd_collatz(n: 1) == [1])


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 array will not contain
/// duplicate values.
/// Examples:
/// >>> can_arrange(arr: [1, 2, 4, 3, 5])
/// 3
/// >>> can_arrange(arr: [1, 2, 3])
/// -1
func can_arrange(arr: [Int]) -> Int {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(can_arrange(arr: [1, 2, 4, 3, 5]) == 3)
assert(can_arrange(arr: [1, 2, 4, 5]) == -1)
assert(can_arrange(arr: [1, 4, 2, 5, 6, 7, 8, 9, 10]) == 2)
assert(can_arrange(arr: [4, 8, 5, 7, 3]) == 4)
assert(can_arrange(arr: [] as [Int]) == -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(numbers: "three one five")
/// "one three five"
func sort_numbers(numbers: String) -> String {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(sort_numbers(numbers: "") == "")
assert(sort_numbers(numbers: "three") == "three")
assert(sort_numbers(numbers: "three five nine") == "three five nine")
assert(sort_numbers(numbers: "five zero four seven nine eight") == "zero four five seven eight nine")
assert(sort_numbers(numbers: "six five four three two one zero") == "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(x: 12, shift: 1)
/// "21"
/// >>> circular_shift(x: 12, shift: 2)
/// "12"
func circular_shift(x: Int, shift: Int) -> String {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(circular_shift(x: 100, shift: 2) == "001")
assert(circular_shift(x: 12, shift: 2) == "12")
assert(circular_shift(x: 97, shift: 8) == "79")
assert(circular_shift(x: 12, shift: 1) == "21")
assert(circular_shift(x: 11, shift: 101) == "11")


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


Prompt:
/// For a given array of integers, return a tuple consisting of a sum and a product of all the integers in an array.
/// Empty sum should be equal to 0 and empty product should be equal to 1.
/// >>> sum_product(numbers: [] as [Int])
/// (0, 1)
/// >>> sum_product(numbers: [1, 2, 3, 4])
/// (10, 24)
func sum_product(numbers: [Int]) -> (Int, Int) {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(sum_product(numbers: [] as [Int]) == (0, 1))
assert(sum_product(numbers: [1, 1, 1]) == (3, 1))
assert(sum_product(numbers: [100, 0]) == (100, 0))
assert(sum_product(numbers: [3, 5, 7]) == (15, 105))
assert(sum_product(numbers: [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(x: 12, y: 15)
/// 14
/// >>> choose_num(x: 13, y: 12)
/// -1
func choose_num(x: Int, y: Int) -> Int {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(choose_num(x: 12, y: 15) == 14)
assert(choose_num(x: 13, y: 12) == -1)
assert(choose_num(x: 33, y: 12354) == 12354)
assert(choose_num(x: 5234, y: 5233) == -1)
assert(choose_num(x: 6, y: 29) == 28)
assert(choose_num(x: 27, y: 10) == -1)
assert(choose_num(x: 7, y: 7) == -1)
assert(choose_num(x: 546, y: 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 an array.
/// If there is no negative or positive integers, return them as nil.
/// Examples:
/// >>> largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7])
/// (nil, 1)
/// >>> largest_smallest_integers(lst: [] as [Int])
/// (nil, nil)
/// >>> largest_smallest_integers(lst: [0])
/// (nil, nil)
func largest_smallest_integers(lst: [Int]) -> (Int?, Int?) {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7]) == (nil, 1))
assert(largest_smallest_integers(lst: [2, 4, 1, 3, 5, 7, 0]) == (nil, 1))
assert(largest_smallest_integers(lst: [1, 3, 2, 4, 5, 6, -2]) == (-2, 1))
assert(largest_smallest_integers(lst: [4, 5, 3, 6, 2, 7, -7]) == (-7, 2))
assert(largest_smallest_integers(lst: [7, 3, 8, 4, 9, 2, 5, -9]) == (-9, 2))
assert(largest_smallest_integers(lst: [] as [Int]) == (nil, nil))
assert(largest_smallest_integers(lst: [0]) == (nil, nil))
assert(largest_smallest_integers(lst: [-1, -3, -5, -6]) == (-1, nil))
assert(largest_smallest_integers(lst: [-1, -3, -5, -6, 0]) == (-1, nil))
assert(largest_smallest_integers(lst: [-6, -4, -4, -3, 1]) == (-3, 1))
assert(largest_smallest_integers(lst: [-6, -4, -4, -3, -100, 1]) == (-3, 1))


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

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(count_distinct_characters(string: "") == 0)
assert(count_distinct_characters(string: "abcde") == 5)
assert(count_distinct_characters(string: "abcdecadeCADE") == 5)
assert(count_distinct_characters(string: "aaaaAAAAaaaa") == 1)
assert(count_distinct_characters(string: "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 an array, where element at index
/// i represents the number of stones in the level (i+1).
/// Examples:
/// >>> make_a_pile(n: 3)
/// [3, 5, 7]
func make_a_pile(n: Int) -> [Int] {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(make_a_pile(n: 3) == [3, 5, 7])
assert(make_a_pile(n: 4) == [4, 6, 8, 10])
assert(make_a_pile(n: 5) == [5, 7, 9, 11, 13])
assert(make_a_pile(n: 6) == [6, 8, 10, 12, 14, 16])
assert(make_a_pile(n: 8) == [8, 10, 12, 14, 16, 18, 20, 22])


Prompt:
/// You are given an array arr of integers and you need to return
/// sum of magnitudes of integers multiplied by product of all signs
/// of each number in the array, represented by 1, -1 or 0.
/// Note: return nil for empty arr.
/// Example:
/// >>> prod_signs(arr: [1, 2, 2, -4])
/// 9
/// >>> prod_signs(arr: [0, 1])
/// 0
/// >>> prod_signs(arr: [] as [Int])
/// nil
func prod_signs(arr: [Int]) -> Int? {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(prod_signs(arr: [1, 2, 2, -4]) == -9)
assert(prod_signs(arr: [0, 1]) == 0)
assert(prod_signs(arr: [1, 1, 1, 2, 3, -1, 1]) == -10)
assert(prod_signs(arr: [] as [Int]) == nil)
assert(prod_signs(arr: [2, 4, 1, 2, -1, -1, 9]) == 20)
assert(prod_signs(arr: [-1, 1, -1, 1]) == 4)
assert(prod_signs(arr: [-1, 1, 1, 1]) == -4)
assert(prod_signs(arr: [-1, 1, 1, 0]) == 0)


Prompt:
/// Given an array of integers nums, find the minimum sum of any non-empty sub-array
/// of nums.
/// Example
/// >>> minSubArraySum(nums: [2, 3, 4, 1, 2, 4])
/// 1
/// >>> minSubArraySum(nums: [-1, -2, -3])
/// -6
func minSubArraySum(nums: [Int]) -> Int {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(minSubArraySum(nums: [2, 3, 4, 1, 2, 4]) == 1)
assert(minSubArraySum(nums: [-1, -2, -3]) == -6)
assert(minSubArraySum(nums: [-1, -2, -3, 2, -10]) == -14)
assert(minSubArraySum(nums: [-9999999999999999]) == -9999999999999999)
assert(minSubArraySum(nums: [0, 10, 20, 1000000]) == 0)
assert(minSubArraySum(nums: [-1, -2, -3, 10, -5]) == -6)
assert(minSubArraySum(nums: [100, -1, -2, -3, 10, -5]) == -6)
assert(minSubArraySum(nums: [10, 11, 13, 8, 3, 4]) == 3)
assert(minSubArraySum(nums: [100, -33, 32, -1, 0, -2]) == -33)
assert(minSubArraySum(nums: [-10]) == -10)
assert(minSubArraySum(nums: [7]) == 7)
assert(minSubArraySum(nums: [1, -1]) == -1)


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

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(string_sequence(n: 0) == "0")
assert(string_sequence(n: 3) == "0 1 2 3")
assert(string_sequence(n: 10) == "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(a: "abcd", b: "abd")
/// false
/// >>> cycpattern_check(a: "hello", b: "ell")
/// true
/// >>> cycpattern_check(a: "whassup", b: "psus")
/// false
/// >>> cycpattern_check(a: "abab", b: "baa")
/// true
/// >>> cycpattern_check(a: "efef", b: "eeff")
/// false
/// >>> cycpattern_check(a: "himenss", b: "simen")
/// true
func cycpattern_check(a: String, b: String) -> Bool {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(cycpattern_check(a: "xyzw", b: "xyw") == false)
assert(cycpattern_check(a: "yello", b: "ell") == true)
assert(cycpattern_check(a: "whattup", b: "ptut") == false)
assert(cycpattern_check(a: "efef", b: "fee") == true)
assert(cycpattern_check(a: "abab", b: "aabb") == false)
assert(cycpattern_check(a: "winemtt", b: "tinem") == true)


Prompt:
/// Return true is array elements are monotonically increasing or decreasing.
/// >>> monotonic(l: [1, 2, 4, 20])
/// true
/// >>> monotonic(l: [1, 20, 4, 10])
/// false
/// >>> monotonic(l: [4, 1, 0, -10])
/// true
func monotonic(l: [Int]) -> Bool {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(monotonic(l: [1, 2, 4, 10]) == true)
assert(monotonic(l: [1, 2, 4, 20]) == true)
assert(monotonic(l: [1, 20, 4, 10]) == false)
assert(monotonic(l: [4, 1, 0, -10]) == true)
assert(monotonic(l: [4, 1, 1, 0]) == true)
assert(monotonic(l: [1, 2, 3, 2, 5, 60]) == false)
assert(monotonic(l: [1, 2, 3, 4, 5, 60]) == true)
assert(monotonic(l: [9, 9, 9, 9]) == true)


Prompt:
/// Out of array of strings, return the longest one. Return the first one in case of multiple
/// strings of the same length. Return nil in case the input array is empty.
/// >>> longest(strings: [] as [String])
/// nil
/// >>> longest(strings: ["a", "b", "c"])
/// "a"
/// >>> longest(strings: ["a", "bb", "ccc"])
/// "ccc"
func longest(strings: [String]) -> String? {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(longest(strings: [] as [String]) == nil)
assert(longest(strings: ["x", "y", "z"]) == "x")
assert(longest(strings: ["x", "yyy", "zzzz", "www", "kkkk", "abc"]) == "zzzz")


Prompt:
/// Return true if all numbers in the array l are below threshold t.
/// >>> below_threshold(l: [1, 2, 4, 10], t: 100)
/// true
/// >>> below_threshold(l: [1, 20, 4, 10], t: 5)
/// false
func below_threshold(l: [Int], t: Int) -> Bool {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(below_threshold(l: [1, 2, 4, 10], t: 100) == true)
assert(below_threshold(l: [1, 20, 4, 10], t: 5) == false)
assert(below_threshold(l: [1, 20, 4, 10], t: 21) == true)
assert(below_threshold(l: [1, 20, 4, 10], t: 22) == true)
assert(below_threshold(l: [1, 8, 4, 10], t: 11) == true)
assert(below_threshold(l: [1, 8, 4, 10], t: 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(a: 30)
/// true
/// 30 = 2 * 3 * 5
func is_multiply_prime(a: Int) -> Bool {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(is_multiply_prime(a: 5) == false)
assert(is_multiply_prime(a: 30) == true)
assert(is_multiply_prime(a: 8) == true)
assert(is_multiply_prime(a: 10) == false)
assert(is_multiply_prime(a: 125) == true)
assert(is_multiply_prime(a: 105) == true)
assert(is_multiply_prime(a: 126) == false)
assert(is_multiply_prime(a: 729) == false)
assert(is_multiply_prime(a: 891) == false)
assert(is_multiply_prime(a: 1001) == true)


Prompt:
/// Return only positive numbers in the array.
/// >>> get_positive(l: [-1, 2, -4, 5, 6])
/// [2, 5, 6]
/// >>> get_positive(l: [5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])
/// [5, 3, 2, 3, 9, 123, 1]
func get_positive(l: [Int]) -> [Int] {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(get_positive(l: [-1, -2, 4, 5, 6]) == [4, 5, 6])
assert(get_positive(l: [5, 3, -5, 2, 3, 3, 9, 0, 123, 1, -10]) == [5, 3, 2, 3, 3, 9, 123, 1])
assert(get_positive(l: [-1, -2]) == [] as [Int])
assert(get_positive(l: [] as [Int]) == [] as [Int])


Prompt:
/// This function takes an array l and returns an array 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(l: [1, 2, 3])
/// [1, 2, 3]
/// >>> sort_third(l: [5, 6, 3, 4, 8, 9, 2])
/// [2, 6, 3, 4, 8, 9, 5]
func sort_third(l: [Int]) -> [Int] {


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(paren_string: "(()()) ((())) () ((())()())")
/// [2, 3, 1, 3]
func parse_nested_parens(paren_string: String) -> [Int] {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(parse_nested_parens(paren_string: "(()()) ((())) () ((())()())") == [2, 3, 1, 3])
assert(parse_nested_parens(paren_string: "() (()) ((())) (((())))") == [1, 2, 3, 4])
assert(parse_nested_parens(paren_string: "(()(())((())))") == [4])


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

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(triangle_area(a: 5, h: 3) == 7.5)
assert(triangle_area(a: 2, h: 2) == 2.0)
assert(triangle_area(a: 10, h: 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(a: 148, b: 412)
/// 16
/// >>> multiply(a: 19, b: 28)
/// 72
/// >>> multiply(a: 2020, b: 1851)
/// 0
/// >>> multiply(a: 14, b: -15)
/// 20
func multiply(a: Int, b: Int) -> Int {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(multiply(a: 148, b: 412) == 16)
assert(multiply(a: 19, b: 28) == 72)
assert(multiply(a: 2020, b: 1851) == 0)
assert(multiply(a: 14, b: -15) == 20)
assert(multiply(a: 76, b: 67) == 42)
assert(multiply(a: 17, b: 27) == 49)
assert(multiply(a: 0, b: 1) == 0)
assert(multiply(a: 0, b: 0) == 0)


Prompt:
/// For a given array 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(numbers: [1.0, 2.0, 3.0, 4.0])
/// 1.0
func mean_absolute_deviation(numbers: [Double]) -> Double {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(mean_absolute_deviation(numbers: [1.0, 2.0]) == 0.5)
assert(mean_absolute_deviation(numbers: [1.0, 2.0, 3.0, 4.0]) == 1.0)
assert(mean_absolute_deviation(numbers: [1.0, 2.0, 3.0, 4.0, 5.0]) == 1.2)


Prompt:
/// Return sorted unique common elements for two arrays.
/// >>> common(l1: [1, 4, 3, 34, 653, 2, 5], l2: [5, 7, 1, 5, 9, 653, 121])
/// [1, 5, 653]
/// >>> common(l1: [5, 3, 2, 8], l2: [3, 2])
/// [2, 3]
func common(l1: [Int], l2: [Int]) -> [Int] {


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(number: 19)
/// "xix"
/// >>> int_to_mini_roman(number: 152)
/// "clii"
/// >>> int_to_mini_roman(number: 426)
/// "cdxxvi"
func int_to_mini_roman(number: Int) -> String {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(int_to_mini_roman(number: 19) == "xix")
assert(int_to_mini_roman(number: 152) == "clii")
assert(int_to_mini_roman(number: 251) == "ccli")
assert(int_to_mini_roman(number: 426) == "cdxxvi")
assert(int_to_mini_roman(number: 500) == "d")
assert(int_to_mini_roman(number: 1) == "i")
assert(int_to_mini_roman(number: 4) == "iv")
assert(int_to_mini_roman(number: 43) == "xliii")
assert(int_to_mini_roman(number: 90) == "xc")
assert(int_to_mini_roman(number: 94) == "xciv")
assert(int_to_mini_roman(number: 532) == "dxxxii")
assert(int_to_mini_roman(number: 900) == "cm")
assert(int_to_mini_roman(number: 994) == "cmxciv")
assert(int_to_mini_roman(number: 1000) == "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(s: "5 apples and 6 oranges", n: 19)
/// 8
/// >>> fruit_distribution(s: "0 apples and 1 oranges", n: 3)
/// 2
/// >>> fruit_distribution(s: "2 apples and 3 oranges", n: 100)
/// 95
/// >>> fruit_distribution(s: "100 apples and 1 oranges", n: 120)
/// 19
func fruit_distribution(s: String, n: Int) -> Int {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(fruit_distribution(s: "5 apples and 6 oranges", n: 19) == 8)
assert(fruit_distribution(s: "5 apples and 6 oranges", n: 21) == 10)
assert(fruit_distribution(s: "0 apples and 1 oranges", n: 3) == 2)
assert(fruit_distribution(s: "1 apples and 0 oranges", n: 3) == 2)
assert(fruit_distribution(s: "2 apples and 3 oranges", n: 100) == 95)
assert(fruit_distribution(s: "2 apples and 3 oranges", n: 5) == 0)
assert(fruit_distribution(s: "1 apples and 100 oranges", n: 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(s: "abcde", c: "ae")
/// ("bcd", false)
/// >>> reverse_delete(s: "abcdef", c: "b")
/// ("acdef", false)
/// >>> reverse_delete(s: "abcdedcba", c: "ab")
/// ("cdedc", true)
func reverse_delete(s: String, c: String) -> (String, Bool) {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(reverse_delete(s: "abcde", c: "ae") == ("bcd", false))
assert(reverse_delete(s: "abcdef", c: "b") == ("acdef", false))
assert(reverse_delete(s: "abcdedcba", c: "ab") == ("cdedc", true))
assert(reverse_delete(s: "dwik", c: "w") == ("dik", false))
assert(reverse_delete(s: "a", c: "a") == ("", true))
assert(reverse_delete(s: "abcdedcba", c: "") == ("abcdedcba", true))
assert(reverse_delete(s: "abcdedcba", c: "v") == ("abcdedcba", true))
assert(reverse_delete(s: "vabba", c: "v") == ("abba", true))
assert(reverse_delete(s: "mamma", c: "mia") == ("", true))


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

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(greatest_common_divisor(a: 3, b: 7) == 1)
assert(greatest_common_divisor(a: 10, b: 15) == 5)
assert(greatest_common_divisor(a: 49, b: 14) == 7)
assert(greatest_common_divisor(a: 144, b: 60) == 12)


Prompt:
extension Int: Error {}

/// Given a string of words, return an array of words split on whitespace, if no whitespaces exists in the text you
/// should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the
/// alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25
/// Examples
/// >>> split_words(txt: "Hello world!")
/// .success(["Hello", "world!"])
/// >>> split_words(txt: "Hello,world!")
/// .success(["Hello", "world!"])
/// >>> split_words(txt: "abcdef")
/// .failure(3)
func split_words(txt: String) -> Result<[String], Int> {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(split_words(txt: "Hello world!") == .success(["Hello", "world!"]))
assert(split_words(txt: "Hello,world!") == .success(["Hello", "world!"]))
assert(split_words(txt: "Hello world,!") == .success(["Hello", "world,!"]))
assert(split_words(txt: "Hello,Hello,world !") == .success(["Hello,Hello,world", "!"]))
assert(split_words(txt: "abcdef") == .failure(3))
assert(split_words(txt: "aaabb") == .failure(2))
assert(split_words(txt: "aaaBb") == .failure(1))
assert(split_words(txt: "") == .failure(0))


Prompt:
/// In this Kata, you have to sort an array 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(arr: [1, 5, 2, 3, 4])
/// [1, 2, 3, 4, 5]
/// >>> sort_array(arr: [-2, -3, -4, -5, -6])
/// [-6, -5, -4, -3, -2]
/// >>> sort_array(arr: [1, 0, 2, 3, 4])
/// [0, 1, 2, 3, 4]
func sort_array(arr: [Int]) -> [Int] {


Prompt:
/// Concatenate array of strings into a single string
/// >>> concatenate(strings: [] as [String])
/// ""
/// >>> concatenate(strings: ["a", "b", "c"])
/// "abc"
func concatenate(strings: [String]) -> String {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(concatenate(strings: [] as [String]) == "")
assert(concatenate(strings: ["x", "y", "z"]) == "xyz")
assert(concatenate(strings: ["x", "y", "z", "w", "k"]) == "xyzwk")


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

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(sorted_list_sum(lst: ["aa", "a", "aaa"]) == ["aa"])
assert(sorted_list_sum(lst: ["school", "AI", "asdf", "b"]) == ["AI", "asdf", "school"])
assert(sorted_list_sum(lst: ["d", "b", "c", "a"]) == [] as [String])
assert(sorted_list_sum(lst: ["d", "dcba", "abcd", "a"]) == ["abcd", "dcba"])
assert(sorted_list_sum(lst: ["AI", "ai", "au"]) == ["AI", "ai", "au"])
assert(sorted_list_sum(lst: ["a", "b", "b", "c", "c", "a"]) == [] as [String])
assert(sorted_list_sum(lst: ["aaaa", "bbbb", "dd", "cc"]) == ["cc", "dd", "aaaa", "bbbb"])


Prompt:
/// Filter an input array of strings only for ones that contain given substring
/// >>> filter_by_substring(strings: [] as [String], substring: "a")
/// [] as [String]
/// >>> filter_by_substring(strings: ["abc", "bacd", "cde", "array"], substring: "a")
/// ["abc", "bacd", "array"]
func filter_by_substring(strings: [String], substring: String) -> [String] {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(filter_by_substring(strings: [] as [String], substring: "john") == [] as [String])
assert(filter_by_substring(strings: ["xxx", "asd", "xxy", "john doe", "xxxAAA", "xxx"], substring: "xxx") == ["xxx", "xxxAAA", "xxx"])
assert(filter_by_substring(strings: ["xxx", "asd", "aaaxxy", "john doe", "xxxAAA", "xxx"], substring: "xx") == ["xxx", "aaaxxy", "xxxAAA", "xxx"])
assert(filter_by_substring(strings: ["grunt", "trumpet", "prune", "gruesome"], substring: "run") == ["grunt", "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(value: "10")
/// 10
/// >>> closest_integer(value: "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.
func closest_integer(value: String) -> Int {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(closest_integer(value: "10") == 10)
assert(closest_integer(value: "14.5") == 15)
assert(closest_integer(value: "-15.5") == -16)
assert(closest_integer(value: "15.3") == 15)
assert(closest_integer(value: "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(s: "abcde")
/// 2
/// >>> vowels_count(s: "ACEDY")
/// 3
func vowels_count(s: String) -> Int {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(vowels_count(s: "abcde") == 2)
assert(vowels_count(s: "Alone") == 3)
assert(vowels_count(s: "key") == 2)
assert(vowels_count(s: "bye") == 1)
assert(vowels_count(s: "keY") == 2)
assert(vowels_count(s: "bYe") == 1)
assert(vowels_count(s: "ACEDY") == 3)


Prompt:
/// Write a function that accepts an array of strings.
/// The array 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(words: ["name", "of", "string"])
/// "string"
/// >>> find_max(words: ["name", "enam", "game"])
/// "enam"
/// >>> find_max(words: ["aaaaaaa", "bb", "cc"])
/// "aaaaaaa"
func find_max(words: [String]) -> String {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(find_max(words: ["name", "of", "string"]) == "string")
assert(find_max(words: ["name", "enam", "game"]) == "enam")
assert(find_max(words: ["aaaaaaa", "bb", "cc"]) == "aaaaaaa")
assert(find_max(words: ["abc", "cba"]) == "abc")
assert(find_max(words: ["play", "this", "game", "of", "footbott"]) == "footbott")
assert(find_max(words: ["we", "are", "gonna", "rock"]) == "gonna")
assert(find_max(words: ["we", "are", "a", "mad", "nation"]) == "nation")
assert(find_max(words: ["this", "is", "a", "prrk"]) == "this")
assert(find_max(words: ["b"]) == "b")
assert(find_max(words: ["play", "play", "play"]) == "play")


Prompt:
/// Given a string 'text', return its md5 hash equivalent string.
/// If 'text' is an empty string, return nil.
/// >>> string_to_md5(text: "Hello world")
/// "3e25960a79dbc69b674cd4ec67a72c62"
func string_to_md5(text: String) -> String? {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(string_to_md5(text: "Hello world") == "3e25960a79dbc69b674cd4ec67a72c62")
assert(string_to_md5(text: "") == nil)
assert(string_to_md5(text: "A B C") == "0ef78513b0cb8cef12743f5aeb35f888")
assert(string_to_md5(text: "password") == "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(x: 8, base: 3)
/// "22"
/// >>> change_base(x: 8, base: 2)
/// "1000"
/// >>> change_base(x: 7, base: 2)
/// "111"
func change_base(x: Int, base: Int) -> String {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(change_base(x: 8, base: 3) == "22")
assert(change_base(x: 9, base: 3) == "100")
assert(change_base(x: 234, base: 2) == "11101010")
assert(change_base(x: 16, base: 2) == "10000")
assert(change_base(x: 8, base: 2) == "1000")
assert(change_base(x: 7, base: 2) == "111")
assert(change_base(x: 2, base: 3) == "2")
assert(change_base(x: 3, base: 4) == "3")
assert(change_base(x: 4, base: 5) == "4")
assert(change_base(x: 5, base: 6) == "5")
assert(change_base(x: 6, base: 7) == "6")
assert(change_base(x: 7, base: 8) == "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(a: 3, b: 4, c: 5)
/// true
/// >>> right_angle_triangle(a: 1, b: 2, c: 3)
/// false
func right_angle_triangle(a: Int, b: Int, c: Int) -> Bool {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(right_angle_triangle(a: 3, b: 4, c: 5) == true)
assert(right_angle_triangle(a: 1, b: 2, c: 3) == false)
assert(right_angle_triangle(a: 10, b: 6, c: 8) == true)
assert(right_angle_triangle(a: 2, b: 2, c: 2) == false)
assert(right_angle_triangle(a: 7, b: 24, c: 25) == true)
assert(right_angle_triangle(a: 10, b: 5, c: 7) == false)
assert(right_angle_triangle(a: 5, b: 12, c: 13) == true)
assert(right_angle_triangle(a: 15, b: 8, c: 17) == true)
assert(right_angle_triangle(a: 48, b: 55, c: 73) == true)
assert(right_angle_triangle(a: 1, b: 1, c: 1) == false)
assert(right_angle_triangle(a: 2, b: 2, c: 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 an array of GPAs for some students and you have to write
/// a function that can output an array 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:
/// >>> numerical_letter_grade(grades: [4.0, 3, 1.7, 2, 3.5])
/// ["A+", "B", "C-", "C", "A-"]
func numerical_letter_grade(grades: [Double]) -> [String] {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(numerical_letter_grade(grades: [4.0, 3, 1.7, 2, 3.5]) == ["A+", "B", "C-", "C", "A-"])
assert(numerical_letter_grade(grades: [1.2]) == ["D+"])
assert(numerical_letter_grade(grades: [0.5]) == ["D-"])
assert(numerical_letter_grade(grades: [0.0]) == ["E"])
assert(numerical_letter_grade(grades: [1.0, 0.3, 1.5, 2.8, 3.3]) == ["D", "D-", "C-", "B", "B+"])
assert(numerical_letter_grade(grades: [0.0, 0.7]) == ["E", "D-"])


Prompt:
/// Insert a number 'delimeter' between every two consecutive elements of input array `numbers'
/// >>> intersperse(numbers: [] as [Int], delimeter: 4)
/// [] as [Int]
/// >>> intersperse(numbers: [1, 2, 3], delimeter: 4)
/// [1, 4, 2, 4, 3]
func intersperse(numbers: [Int], delimeter: Int) -> [Int] {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(intersperse(numbers: [] as [Int], delimeter: 7) == [] as [Int])
assert(intersperse(numbers: [5, 6, 3, 2], delimeter: 8) == [5, 8, 6, 8, 3, 8, 2])
assert(intersperse(numbers: [2, 2, 2], delimeter: 2) == [2, 2, 2, 2, 2])


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

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(specialFilter(nums: [5, -2, 1, -5]) == 0)
assert(specialFilter(nums: [15, -73, 14, -15]) == 1)
assert(specialFilter(nums: [33, -2, -3, 45, 21, 109]) == 2)
assert(specialFilter(nums: [43, -12, 93, 125, 121, 109]) == 4)
assert(specialFilter(nums: [71, -2, -33, 75, 21, 19]) == 3)
assert(specialFilter(nums: [1]) == 0)
assert(specialFilter(nums: [] as [Int]) == 0)


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

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(sum_to_n(n: 1) == 1)
assert(sum_to_n(n: 6) == 21)
assert(sum_to_n(n: 11) == 66)
assert(sum_to_n(n: 30) == 465)
assert(sum_to_n(n: 100) == 5050)


Prompt:
/// From an array of integers, remove all elements that occur more than once.
/// Keep order of elements left the same as in the input.
/// >>> remove_duplicates(numbers: [1, 2, 3, 2, 4])
/// [1, 3, 4]
func remove_duplicates(numbers: [Int]) -> [Int] {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(remove_duplicates(numbers: [] as [Int]) == [] as [Int])
assert(remove_duplicates(numbers: [1, 2, 3, 4]) == [1, 2, 3, 4])
assert(remove_duplicates(numbers: [1, 2, 3, 2, 4, 3, 5]) == [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(a: 2, b: 8)
/// [2, 4, 6, 8]
/// >>> generate_integers(a: 8, b: 2)
/// [2, 4, 6, 8]
/// >>> generate_integers(a: 10, b: 14)
/// [] as [Int]
func generate_integers(a: Int, b: Int) -> [Int] {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(generate_integers(a: 2, b: 10) == [2, 4, 6, 8])
assert(generate_integers(a: 10, b: 2) == [2, 4, 6, 8])
assert(generate_integers(a: 132, b: 2) == [2, 4, 6, 8])
assert(generate_integers(a: 17, b: 89) == [] as [Int])


Prompt:
/// From a given array of integers, generate an array of rolling maximum element found until given moment
/// in the sequence.
/// >>> rolling_max(numbers: [1, 2, 3, 2, 3, 4, 2])
/// [1, 2, 3, 3, 3, 4, 4]
func rolling_max(numbers: [Int]) -> [Int] {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(rolling_max(numbers: [] as [Int]) == [] as [Int])
assert(rolling_max(numbers: [1, 2, 3, 4]) == [1, 2, 3, 4])
assert(rolling_max(numbers: [4, 3, 2, 1]) == [4, 4, 4, 4])
assert(rolling_max(numbers: [3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100])


Prompt:
/// You're given an array 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(operations: [1, 2, 3])
/// false
/// >>> below_zero(operations: [1, 2, -4, 5])
/// true
func below_zero(operations: [Int]) -> Bool {

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(below_zero(operations: [] as [Int]) == false)
assert(below_zero(operations: [1, 2, -3, 1, 2, -3]) == false)
assert(below_zero(operations: [1, 2, -4, 5, 6]) == true)
assert(below_zero(operations: [1, -1, 2, -2, 5, -5, 4, -4]) == false)
assert(below_zero(operations: [1, -1, 2, -2, 5, -5, 4, -5]) == true)
assert(below_zero(operations: [1, -2, 2, -2, 5, -5, 4, -4]) == true)


Prompt:
/// You are given a non-empty array 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 array.
/// If no such a value exist, return -1.
/// Examples:
/// >>> search(lst: [4, 1, 2, 2, 3, 1])
/// 2
/// >>> search(lst: [1, 2, 2, 3, 3, 3, 4, 4, 4])
/// 3
/// >>> search(lst: [5, 5, 4, 4, 4])
/// -1
func search(lst: [Int]) -> Int {


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

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(correct_bracketing(brackets: "()") == true)
assert(correct_bracketing(brackets: "(()())") == true)
assert(correct_bracketing(brackets: "()()(()())()") == true)
assert(correct_bracketing(brackets: "()()((()()())())(()()(()))") == true)
assert(correct_bracketing(brackets: "((()())))") == false)
assert(correct_bracketing(brackets: ")(()") == false)
assert(correct_bracketing(brackets: "(") == false)
assert(correct_bracketing(brackets: "((((") == false)
assert(correct_bracketing(brackets: ")") == false)
assert(correct_bracketing(brackets: "(()") == false)
assert(correct_bracketing(brackets: "()()(()())())(()") == false)
assert(correct_bracketing(brackets: "()()(()())()))()") == false)


Prompt:
/// This function takes an array l and returns an array 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(l: [1, 2, 3])
/// [1, 2, 3]
/// >>> sort_even(l: [5, 6, 3, 4])
/// [3, 6, 5, 4]
func sort_even(l: [Int]) -> [Int] {


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

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(same_chars(s0: "eabcdzzzz", s1: "dddzzzzzzzddeddabc") == true)
assert(same_chars(s0: "abcd", s1: "dddddddabc") == true)
assert(same_chars(s0: "dddddddabc", s1: "abcd") == true)
assert(same_chars(s0: "eabcd", s1: "dddddddabc") == false)
assert(same_chars(s0: "abcd", s1: "dddddddabcf") == false)
assert(same_chars(s0: "eabcdzzzz", s1: "dddzzzzzzzddddabc") == false)
assert(same_chars(s0: "aabb", s1: "aaccc") == false)


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

}

func ==(left: [(Int, Int)], right: [(Int, Int)]) -> Bool {
    if left.count != right.count {
        return false
    }
    for (l, r) in zip(left, right) {
        if l != r {
            return false
        }
    }
    return true
}

assert(correct_bracketing(brackets: "<>") == true)
assert(correct_bracketing(brackets: "<<><>>") == true)
assert(correct_bracketing(brackets: "<><><<><>><>") == true)
assert(correct_bracketing(brackets: "<><><<<><><>><>><<><><<>>>") == true)
assert(correct_bracketing(brackets: "<<<><>>>>") == false)
assert(correct_bracketing(brackets: "><<>") == false)
assert(correct_bracketing(brackets: "<") == false)
assert(correct_bracketing(brackets: "<<<<") == false)
assert(correct_bracketing(brackets: ">") == false)
assert(correct_bracketing(brackets: "<<>") == false)
assert(correct_bracketing(brackets: "<><><<><>><>><<>") == false)
assert(correct_bracketing(brackets: "<><><<><>><>>><>") == false)