Prompt:
""" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.
Empty sum should be equal to 0 and empty product should be equal to 1.
>>> sum_product([])
(0, 1)
>>> sum_product([1, 2, 3, 4])
(10, 24)"""
function sum_product(numbers::Vector{Int64})::Tuple{Int64, Int64}

using Test

@testset begin

candidate = sum_product;
	@test(candidate(Vector{Int64}([])) == (0, 1))
	@test(candidate([1, 1, 1]) == (3, 1))
	@test(candidate([100, 0]) == (100, 0))
	@test(candidate([3, 5, 7]) == (15, 105))
	@test(candidate([10]) == (10, 10))
end


Prompt:
"""You are given a list of integers.
Write a function next_smallest() that returns the 2nd smallest element of the list.
Return None if there is no such element.
>>> next_smallest([1, 2, 3, 4, 5])
2
>>> next_smallest([5, 1, 4, 3, 2])
2
>>> next_smallest([])
nothing
>>> next_smallest([1, 1])
nothing"""
function next_smallest(lst::Vector{Int64})::Union{Int64, Nothing}

using Test

@testset begin

candidate = next_smallest;
	@test(candidate([1, 2, 3, 4, 5]) == 2)
	@test(candidate([5, 1, 4, 3, 2]) == 2)
	@test(candidate(Vector{Int64}([])) == nothing)
	@test(candidate([1, 1]) == nothing)
	@test(candidate([1, 1, 1, 1, 0]) == 1)
	@test(candidate([1, 1]) == nothing)
	@test(candidate([-35, 34, 12, -45]) == -35)
end


Prompt:
"""You'll be given a string of words, and your task is to count the number
of boredoms. A boredom is a sentence that starts with the word "I".
Sentences are delimited by '.', '?' or '!'.
For example:
>>> is_bored("Hello world")
0
>>> is_bored("The sky is blue. The sun is shining. I love this weather")
1"""
function is_bored(S::String)::Int64

using Test

@testset begin

candidate = is_bored;
	@test(candidate("Hello world") == 0)
	@test(candidate("Is the sky blue?") == 0)
	@test(candidate("I love It !") == 1)
	@test(candidate("bIt") == 0)
	@test(candidate("I feel good today. I will be productive. will kill It") == 2)
	@test(candidate("You and I are going for a walk") == 0)
end


Prompt:
"""Create a function that takes 3 numbers.
Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.
Returns false in any other cases.
Examples
>>> any_int(5, 2, 7)
true
>>> any_int(3, 2, 2)
false
>>> any_int(3, -2, 1)
true
>>> any_int(3.6, -2.2, 2)
false"""
function any_int(x::Float64, y::Float64, z::Float64)::Bool

using Test

@testset begin

candidate = any_int;
	@test(candidate(2, 3, 1) == true)
	@test(candidate(2.5, 2, 3) == false)
	@test(candidate(1.5, 5, 3.5) == false)
	@test(candidate(2, 6, 2) == false)
	@test(candidate(4, 2, 2) == true)
	@test(candidate(2.2, 2.2, 2.2) == false)
	@test(candidate(-4, 6, 2) == true)
	@test(candidate(2, 1, 1) == true)
	@test(candidate(3, 4, 7) == true)
	@test(candidate(3.0, 4, 7) == false)
end


Prompt:
"""Write a function that takes a message, and encodes in such a
way that it swaps case of all letters, replaces all vowels in
the message with the letter that appears 2 places ahead of that
vowel in the english alphabet.
Assume only letters.
Examples:
>>> encode("test")
"TGST"
>>> encode("This is a message")
"tHKS KS C MGSSCGG""""
function encode(message::String)::String

using Test

@testset begin

candidate = encode;
	@test(candidate("TEST") == "tgst")
	@test(candidate("Mudasir") == "mWDCSKR")
	@test(candidate("YES") == "ygs")
	@test(candidate("This is a message") == "tHKS KS C MGSSCGG")
	@test(candidate("I DoNt KnOw WhAt tO WrItE") == "k dQnT kNqW wHcT Tq wRkTg")
end


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


Prompt:
"""Given a dictionary, return True if all keys are strings in lower
case or all keys are strings in upper case, else return False.
The function should return False is the given dictionary is empty.
Examples:
>>> check_dict_case(Dict("a" => "apple", "b" => "banana"))
true
>>> check_dict_case(Dict("a" => "apple", "A" => "banana", "B" => "banana"))
false
>>> check_dict_case(Dict("a" => "apple", 8 => "banana", "a" => "apple"))
false
>>> check_dict_case(Dict("Name" => "John", "Age" => "36", "City" => "Houston"))
false
>>> check_dict_case(Dict("STATE" => "NC", "ZIP" => "12345"))
true"""
function check_dict_case(dict::Dict{String, String}>)::Bool

using Test

@testset begin

candidate = check_dict_case;
	@test(candidate(Dict("p" => "pineapple", "b" => "banana")) == true)
	@test(candidate(Dict("p" => "pineapple", "A" => "banana", "B" => "banana")) == false)
	@test(candidate(Dict("p" => "pineapple", "5" => "banana", "a" => "apple")) == false)
	@test(candidate(Dict("Name" => "John", "Age" => "36", "City" => "Houston")) == false)
	@test(candidate(Dict("STATE" => "NC", "ZIP" => "12345")) == true)
	@test(candidate(Dict("fruit" => "Orange", "taste" => "Sweet")) == true)
	@test(candidate(Dict()) == false)
end


Prompt:
"""Implement a function that takes an non-negative integer and returns an array of the first n
integers that are prime numbers and less than n.
for example:
>>> count_up_to(5)
[2, 3]
>>> count_up_to(11)
[2, 3, 5, 7]
>>> count_up_to(0)
[]
>>> count_up_to(20)
[2, 3, 5, 7, 11, 13, 17, 19]
>>> count_up_to(1)
[]
>>> count_up_to(18)
[2, 3, 5, 7, 11, 13, 17]"""
function count_up_to(n::Int64)::Vector{Int64}


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

using Test

@testset begin

candidate = multiply;
	@test(candidate(148, 412) == 16)
	@test(candidate(19, 28) == 72)
	@test(candidate(2020, 1851) == 0)
	@test(candidate(14, -15) == 20)
	@test(candidate(76, 67) == 42)
	@test(candidate(17, 27) == 49)
	@test(candidate(0, 1) == 0)
	@test(candidate(0, 0) == 0)
end


Prompt:
"""Given a string s, count the number of uppercase vowels in even indices.
For example:
>>> count_upper("aBCdEf")
1
>>> count_upper("abcdefg")
0
>>> count_upper("dBBE")
0"""
function count_upper(s::String)::Int64

using Test

@testset begin

candidate = count_upper;
	@test(candidate("aBCdEf") == 1)
	@test(candidate("abcdefg") == 0)
	@test(candidate("dBBE") == 0)
	@test(candidate("B") == 0)
	@test(candidate("U") == 1)
	@test(candidate("") == 0)
	@test(candidate("EEEE") == 2)
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:
""" From a given list of integers, generate a list 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