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(["aa", "a", "aaa"])
    ["aa"]
    >>> list_sort(["ab", "a", "aaa", "cd"])
    ["ab", "cd"]
    """
function sorted_list_sum(lst::Vector{String})::Vector{String}

using Test

@testset begin

candidate = sorted_list_sum;
	@test(candidate(["aa", "a", "aaa"]) == ["aa"])
	@test(candidate(["school", "AI", "asdf", "b"]) == ["AI", "asdf", "school"])
	@test(candidate(["d", "b", "c", "a"]) == Vector{String}([]))
	@test(candidate(["d", "dcba", "abcd", "a"]) == ["abcd", "dcba"])
	@test(candidate(["AI", "ai", "au"]) == ["AI", "ai", "au"])
	@test(candidate(["a", "b", "b", "c", "c", "a"]) == Vector{String}([]))
	@test(candidate(["aaaa", "bbbb", "dd", "cc"]) == ["cc", "dd", "aaaa", "bbbb"])
end


Prompt:
""" Filter an input vector of strings only for ones that contain given substring
    >>> filter_by_substring([], "a")
    []
    >>> filter_by_substring(["abc", "bacd", "cde", "array"], "a")
    ["abc", "bacd", "array"]
    """
function filter_by_substring(strings::Vector{String}, substring::String)::Vector{String}

using Test

@testset begin

candidate = filter_by_substring;
	@test(candidate(Vector{String}([]), "john") == Vector{String}([]))
	@test(candidate(["xxx", "asd", "xxy", "john doe", "xxxAAA", "xxx"], "xxx") == ["xxx", "xxxAAA", "xxx"])
	@test(candidate(["xxx", "asd", "aaaxxy", "john doe", "xxxAAA", "xxx"], "xx") == ["xxx", "aaaxxy", "xxxAAA", "xxx"])
	@test(candidate(["grunt", "trumpet", "prune", "gruesome"], "run") == ["grunt", "prune"])
end


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("10")
    10
    >>> closest_integer("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.
    """
function closest_integer(value::String)::Int64

using Test

@testset begin

candidate = closest_integer;
	@test(candidate("10") == 10)
	@test(candidate("14.5") == 15)
	@test(candidate("-15.5") == -16)
	@test(candidate("15.3") == 15)
	@test(candidate("0") == 0)
end


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("abcde")
    2
    >>> vowels_count("ACEDY")
    3
    """
function vowels_count(s::String)::Int64

using Test

@testset begin

candidate = vowels_count;
	@test(candidate("abcde") == 2)
	@test(candidate("Alone") == 3)
	@test(candidate("key") == 2)
	@test(candidate("bye") == 1)
	@test(candidate("keY") == 2)
	@test(candidate("bYe") == 1)
	@test(candidate("ACEDY") == 3)
end


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(["name", "of", "string"])
    "string"
    >>> find_max(["name", "enam", "game"])
    "enam"
    >>> find_max(["aaaaaaa", "bb", "cc"])
    "aaaaaaa"
    """
function find_max(words::Vector{String})::String

using Test

@testset begin

candidate = find_max;
	@test(candidate(["name", "of", "string"]) == "string")
	@test(candidate(["name", "enam", "game"]) == "enam")
	@test(candidate(["aaaaaaa", "bb", "cc"]) == "aaaaaaa")
	@test(candidate(["abc", "cba"]) == "abc")
	@test(candidate(["play", "this", "game", "of", "footbott"]) == "footbott")
	@test(candidate(["we", "are", "gonna", "rock"]) == "gonna")
	@test(candidate(["we", "are", "a", "mad", "nation"]) == "nation")
	@test(candidate(["this", "is", "a", "prrk"]) == "this")
	@test(candidate(["b"]) == "b")
	@test(candidate(["play", "play", "play"]) == "play")
end


Prompt:
"""
    Given a string 'text', return its md5 hash equivalent string.
    If 'text' is an empty string, return nothing.

    >>> string_to_md5("Hello world")
    "3e25960a79dbc69b674cd4ec67a72c62"
    """
function string_to_md5(text::String)::Union{String, Nothing}

using Test

@testset begin

candidate = string_to_md5;
	@test(candidate("Hello world") == "3e25960a79dbc69b674cd4ec67a72c62")
	@test(candidate("") == nothing)
	@test(candidate("A B C") == "0ef78513b0cb8cef12743f5aeb35f888")
	@test(candidate("password") == "5f4dcc3b5aa765d61d8327deb882cf99")
end


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)
    "22"
    >>> change_base(8, 2)
    "1000"
    >>> change_base(7, 2)
    "111"
    """
function change_base(x::Int64, base::Int64)::String

using Test

@testset begin

candidate = change_base;
	@test(candidate(8, 3) == "22")
	@test(candidate(9, 3) == "100")
	@test(candidate(234, 2) == "11101010")
	@test(candidate(16, 2) == "10000")
	@test(candidate(8, 2) == "1000")
	@test(candidate(7, 2) == "111")
	@test(candidate(2, 3) == "2")
	@test(candidate(3, 4) == "3")
	@test(candidate(4, 5) == "4")
	@test(candidate(5, 6) == "5")
	@test(candidate(6, 7) == "6")
	@test(candidate(7, 8) == "7")
end


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
    """
function right_angle_triangle(a::Int64, b::Int64, c::Int64)::Bool

using Test

@testset begin

candidate = right_angle_triangle;
	@test(candidate(3, 4, 5) == true)
	@test(candidate(1, 2, 3) == false)
	@test(candidate(10, 6, 8) == true)
	@test(candidate(2, 2, 2) == false)
	@test(candidate(7, 24, 25) == true)
	@test(candidate(10, 5, 7) == false)
	@test(candidate(5, 12, 13) == true)
	@test(candidate(15, 8, 17) == true)
	@test(candidate(48, 55, 73) == true)
	@test(candidate(1, 1, 1) == false)
	@test(candidate(2, 2, 10) == false)
end


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([4.0, 3, 1.7, 2, 3.5])
    ["A+", "B", "C-", "C", "A-"]
    """
function numerical_letter_grade(grades::Vector{Float64})::Vector{String}


Prompt:
""" Insert a number 'delimeter' between every two consecutive elements of input vector `numbers'
    >>> intersperse([], 4)
    []
    >>> intersperse([1, 2, 3], 4)
    [1, 4, 2, 4, 3]
    """
function intersperse(numbers::Vector{Int64}, delimeter::Int64)::Vector{Int64}

using Test

@testset begin

candidate = intersperse;
	@test(candidate(Vector{Int64}([]), 7) == Vector{Int64}([]))
	@test(candidate([5, 6, 3, 2], 8) == [5, 8, 6, 8, 3, 8, 2])
	@test(candidate([2, 2, 2], 2) == [2, 2, 2, 2, 2])
end


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([15, -73, 14, -15])
    1
    >>> specialFilter([33, -2, -3, 45, 21, 109])
    2
    """
function specialFilter(nums::Vector{Int64})::Int64


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
    """
function sum_to_n(n::Int64)::Int64

using Test

@testset begin

candidate = sum_to_n;
	@test(candidate(1) == 1)
	@test(candidate(6) == 21)
	@test(candidate(11) == 66)
	@test(candidate(30) == 465)
	@test(candidate(100) == 5050)
end


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([1, 2, 3, 2, 4])
    [1, 3, 4]
    """
function remove_duplicates(numbers::Vector{Int64})::Vector{Int64}

using Test

@testset begin

candidate = remove_duplicates;
	@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))
	@test(candidate([1, 2, 3, 4]) == [1, 2, 3, 4])
	@test(candidate([1, 2, 3, 2, 4, 3, 5]) == [1, 4, 5])
end


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)
    [2, 4, 6, 8]
    >>> generate_integers(8, 2)
    [2, 4, 6, 8]
    >>> generate_integers(10, 14)
    []
    """
function generate_integers(a::Int64, b::Int64)::Vector{Int64}

using Test

@testset begin

candidate = generate_integers;
	@test(candidate(2, 10) == [2, 4, 6, 8])
	@test(candidate(10, 2) == [2, 4, 6, 8])
	@test(candidate(132, 2) == [2, 4, 6, 8])
	@test(candidate(17, 89) == Vector{Int64}([]))
end


Prompt:
""" From a given vector of integers, generate a vector of rolling maximum element found until given moment
    in the sequence.
    >>> rolling_max([1, 2, 3, 2, 3, 4, 2])
    [1, 2, 3, 3, 3, 4, 4]
    """
function rolling_max(numbers::Vector{Int64})::Vector{Int64}

using Test

@testset begin

candidate = rolling_max;
	@test(candidate(Vector{Int64}([])) == Vector{Int64}([]))
	@test(candidate([1, 2, 3, 4]) == [1, 2, 3, 4])
	@test(candidate([4, 3, 2, 1]) == [4, 4, 4, 4])
	@test(candidate([3, 2, 3, 100, 3]) == [3, 3, 3, 100, 100])
end


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([1, 2, 3])
    false
    >>> below_zero([1, 2, -4, 5])
    true
    """
function below_zero(operations::Vector{Int64})::Bool

using Test

@testset begin

candidate = below_zero;
	@test(candidate(Vector{Int64}([])) == false)
	@test(candidate([1, 2, -3, 1, 2, -3]) == false)
	@test(candidate([1, 2, -4, 5, 6]) == true)
	@test(candidate([1, -1, 2, -2, 5, -5, 4, -4]) == false)
	@test(candidate([1, -1, 2, -2, 5, -5, 4, -5]) == true)
	@test(candidate([1, -2, 2, -2, 5, -5, 4, -4]) == true)
end


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([4, 1, 2, 2, 3, 1])
    2
    >>> search([1, 2, 2, 3, 3, 3, 4, 4, 4])
    3
    >>> search([5, 5, 4, 4, 4])
    -1
    """
function search(lst::Vector{Int64})::Int64


Prompt:
""" brackets is a string of "(" and ")".
    return true if every opening bracket has a corresponding closing bracket.

    >>> correct_bracketing("(")
    false
    >>> correct_bracketing("()")
    true
    >>> correct_bracketing("(()())")
    true
    >>> correct_bracketing(")(()")
    false
    """
function correct_bracketing(brackets::String)::Bool

using Test

@testset begin

candidate = correct_bracketing;
	@test(candidate("()") == true)
	@test(candidate("(()())") == true)
	@test(candidate("()()(()())()") == true)
	@test(candidate("()()((()()())())(()()(()))") == true)
	@test(candidate("((()())))") == false)
	@test(candidate(")(()") == false)
	@test(candidate("(") == false)
	@test(candidate("((((") == false)
	@test(candidate(")") == false)
	@test(candidate("(()") == false)
	@test(candidate("()()(()())())(()") == false)
	@test(candidate("()()(()())()))()") == false)
end


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([1, 2, 3])
    [1, 2, 3]
    >>> sort_even([5, 6, 3, 4])
    [3, 6, 5, 4]
    """
function sort_even(l::Vector{Int64})::Vector{Int64}


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

using Test

@testset begin

candidate = same_chars;
	@test(candidate("eabcdzzzz", "dddzzzzzzzddeddabc") == true)
	@test(candidate("abcd", "dddddddabc") == true)
	@test(candidate("dddddddabc", "abcd") == true)
	@test(candidate("eabcd", "dddddddabc") == false)
	@test(candidate("abcd", "dddddddabcf") == false)
	@test(candidate("eabcdzzzz", "dddzzzzzzzddddabc") == false)
	@test(candidate("aabb", "aaccc") == false)
end


Prompt:
""" brackets is a string of "<" and ">".
    return true if every opening bracket has a corresponding closing bracket.

    >>> correct_bracketing("<")
    false
    >>> correct_bracketing("<>")
    true
    >>> correct_bracketing("<<><>>")
    true
    >>> correct_bracketing("><<>")
    false
    """
function correct_bracketing(brackets::String)::Bool

using Test

@testset begin

candidate = correct_bracketing;
	@test(candidate("<>") == true)
	@test(candidate("<<><>>") == true)
	@test(candidate("<><><<><>><>") == true)
	@test(candidate("<><><<<><><>><>><<><><<>>>") == true)
	@test(candidate("<<<><>>>>") == false)
	@test(candidate("><<>") == false)
	@test(candidate("<") == false)
	@test(candidate("<<<<") == false)
	@test(candidate(">") == false)
	@test(candidate("<<>") == false)
	@test(candidate("<><><<><>><>><<>") == false)
	@test(candidate("<><><<><>><>>><>") == false)
end