Prompt:
-- | Check if in given list of numbers, are any two numbers closer to each other than
--  given threshold.
--  >>> hasCloseElements [1.0,2.0,3.0] 0.5
--  False
--  >>> hasCloseElements [1.0,2.8,3.0,4.0,5.0,2.0] 0.3
--  True
hasCloseElements :: [Float] -> Float -> Bool
hasCloseElements numbers threshold =

main :: IO ()
main = do
  let candidate = hasCloseElements
  if candidate [1.0,2.0,3.9,4.0,5.0,2.2] 0.3 == True then pure () else error "assertion failed"
  if candidate [1.0,2.0,3.9,4.0,5.0,2.2] 0.05 == False then pure () else error "assertion failed"
  if candidate [1.0,2.0,5.9,4.0,5.0] 0.95 == True then pure () else error "assertion failed"
  if candidate [1.0,2.0,5.9,4.0,5.0] 0.8 == False then pure () else error "assertion failed"
  if candidate [1.0,2.0,3.0,4.0,5.0,2.0] 0.1 == True then pure () else error "assertion failed"
  if candidate [1.1,2.2,3.1,4.1,5.1] 1.0 == True then pure () else error "assertion failed"
  if candidate [1.1,2.2,3.1,4.1,5.1] 0.5 == False then pure () else error "assertion failed"
  pure ()


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 list, where element at index
--  i represents the number of stones in the level (i+1).
--  Examples:
--  >>> makeAPile 3
--  [3,5,7]
makeAPile :: Int -> [Int]
makeAPile n =

main :: IO ()
main = do
  let candidate = makeAPile
  if candidate 3 == [3,5,7] then pure () else error "assertion failed"
  if candidate 4 == [4,6,8,10] then pure () else error "assertion failed"
  if candidate 5 == [5,7,9,11,13] then pure () else error "assertion failed"
  if candidate 6 == [6,8,10,12,14,16] then pure () else error "assertion failed"
  if candidate 8 == [8,10,12,14,16,18,20,22] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | You will be given a string of words separated by commas or spaces. Your task is
--  to split the string into words and return an array of the words.
--  For example:
--  >>> wordsString "Hi, my name is John"
--  ["Hi","my","name","is","John"]
--  >>> wordsString "One, two, three, four, five, six"
--  ["One","two","three","four","five","six"]
wordsString :: String -> [String]
wordsString s =

main :: IO ()
main = do
  let candidate = wordsString
  if candidate "Hi, my name is John" == ["Hi","my","name","is","John"] then pure () else error "assertion failed"
  if candidate "One, two, three, four, five, six" == ["One","two","three","four","five","six"] then pure () else error "assertion failed"
  if candidate "Hi, my name" == ["Hi","my","name"] then pure () else error "assertion failed"
  if candidate "One,, two, three, four, five, six," == ["One","two","three","four","five","six"] then pure () else error "assertion failed"
  if candidate "" == [] then pure () else error "assertion failed"
  if candidate "ahmed     , gamal" == ["ahmed","gamal"] then pure () else error "assertion failed"
  pure ()


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:
--  >>> chooseNum 12 15
--  14
--  >>> chooseNum 13 12
--  (-1)
chooseNum :: Int -> Int -> Int
chooseNum x y =

main :: IO ()
main = do
  let candidate = chooseNum
  if candidate 12 15 == 14 then pure () else error "assertion failed"
  if candidate 13 12 == (-1) then pure () else error "assertion failed"
  if candidate 33 12354 == 12354 then pure () else error "assertion failed"
  if candidate 5234 5233 == (-1) then pure () else error "assertion failed"
  if candidate 6 29 == 28 then pure () else error "assertion failed"
  if candidate 27 10 == (-1) then pure () else error "assertion failed"
  if candidate 7 7 == (-1) then pure () else error "assertion failed"
  if candidate 546 546 == 546 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a list of positive integers x. return a sorted list of all
--  elements that hasn't any even digit.
--  Note: Returned list should be sorted in increasing order.
--  For example:
--  >>> uniqueDigits [15,33,1422,1]
--  [1,15,33]
--  >>> uniqueDigits [152,323,1422,10]
--  []
uniqueDigits :: [Int] -> [Int]
uniqueDigits x =

main :: IO ()
main = do
  let candidate = uniqueDigits
  if candidate [15,33,1422,1] == [1,15,33] then pure () else error "assertion failed"
  if candidate [152,323,1422,10] == [] then pure () else error "assertion failed"
  if candidate [12345,2033,111,151] == [111,151] then pure () else error "assertion failed"
  if candidate [135,103,31] == [31,135] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given an array of integers, sort the integers that are between 1 and 9 inclusive,
--  reverse the resulting array, and then replace each digit by its corresponding name from
--  "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
--  For example:
--  >>> byLength [2,1,1,4,5,8,2,3]
--  ["Eight","Five","Four","Three","Two","Two","One","One"]
--  If the array is empty, return an empty array:
--  >>> byLength []
--  []
--  If the array has any strange number ignore it:
--  >>> byLength [1,(-1),55]
--  ["One"]
byLength :: [Int] -> [String]
byLength arr =

main :: IO ()
main = do
  let candidate = byLength
  if candidate [2,1,1,4,5,8,2,3] == ["Eight","Five","Four","Three","Two","Two","One","One"] then pure () else error "assertion failed"
  if candidate [] == [] then pure () else error "assertion failed"
  if candidate [1,(-1),55] == ["One"] then pure () else error "assertion failed"
  if candidate [1,(-1),3,2] == ["Three","Two","One"] then pure () else error "assertion failed"
  if candidate [9,4,8] == ["Nine","Eight","Four"] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Implement the function f that takes n as a parameter,
--  and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
--  or the sum of numbers from 1 to i otherwise.
--  i starts from 1.
--  the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).
--  Example:
--  >>> f 5
--  [1,2,6,24,15]
f :: Int -> [Int]
f n =

main :: IO ()
main = do
  let candidate = f
  if candidate 5 == [1,2,6,24,15] then pure () else error "assertion failed"
  if candidate 7 == [1,2,6,24,15,720,28] then pure () else error "assertion failed"
  if candidate 1 == [1] then pure () else error "assertion failed"
  if candidate 3 == [1,2,6] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a positive integer n, return a tuple that has the number of even and odd
--  integer palindromes that fall within the range(1, n), inclusive.
--  Example 1:
--  >>> evenOddPalindrome 3
--  (1, 2)
--  Explanation:
--  Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.
--  Example 2:
--  >>> evenOddPalindrome 12
--  (4, 6)
--  Explanation:
--  Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.
--  Note:
--  1. 1 <= n <= 10^3
--  2. returned tuple has the number of even and odd integer palindromes respectively.
evenOddPalindrome :: Int -> (Int, Int)
evenOddPalindrome n =

main :: IO ()
main = do
  let candidate = evenOddPalindrome
  if candidate 123 == (8, 13) then pure () else error "assertion failed"
  if candidate 12 == (4, 6) then pure () else error "assertion failed"
  if candidate 3 == (1, 2) then pure () else error "assertion failed"
  if candidate 63 == (6, 8) then pure () else error "assertion failed"
  if candidate 25 == (5, 6) then pure () else error "assertion failed"
  if candidate 19 == (4, 6) then pure () else error "assertion failed"
  if candidate 9 == (4, 5) then pure () else error "assertion failed"
  if candidate 1 == (0, 1) then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Write a function count_nums which takes an array of integers and returns
--  the number of elements which has a sum of digits > 0.
--  If a number is negative, then its first signed digit will be negative:
--  e.g. -123 has signed digits -1, 2, and 3.
--  >>> countNums []
--  0
--  >>> countNums [(-1),11,(-11)]
--  1
--  >>> countNums [1,1,2]
--  3
countNums :: [Int] -> Int
countNums arr =

main :: IO ()
main = do
  let candidate = countNums
  if candidate [] == 0 then pure () else error "assertion failed"
  if candidate [(-1),(-2),0] == 0 then pure () else error "assertion failed"
  if candidate [1,1,2,(-2),3,4,5] == 6 then pure () else error "assertion failed"
  if candidate [1,6,9,(-6),0,1,5] == 5 then pure () else error "assertion failed"
  if candidate [1,100,98,(-7),1,(-1)] == 4 then pure () else error "assertion failed"
  if candidate [12,23,34,(-45),(-56),0] == 5 then pure () else error "assertion failed"
  if candidate [0,1] == 1 then pure () else error "assertion failed"
  if candidate [1] == 1 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The
--  numbers in the array will be randomly ordered. Your task is to determine if
--  it is possible to get an array sorted in non-decreasing order by performing
--  the following operation on the given array:
--  You are allowed to perform right shift operation any number of times.
--  One right shift operation means shifting all elements of the array by one
--  position in the right direction. The last element of the array will be moved to
--  the starting position in the array i.e. 0th index.
--  If it is possible to obtain the sorted array by performing the above operation
--  then return True else return False.
--  If the given array is empty then return True.
--  Note: The given list is guaranteed to have unique elements.
--  For Example:
--  >>> moveOneBall [3,4,5,1,2]
--  True
--  Explanation: By performin 2 right shift operations, non-decreasing order can
--  be achieved for the given array.
--  >>> moveOneBall [3,5,4,1,2]
--  False
--  Explanation:It is not possible to get non-decreasing order for the given
--  array by performing any number of right shift operations.
moveOneBall :: [Int] -> Bool
moveOneBall arr =

main :: IO ()
main = do
  let candidate = moveOneBall
  if candidate [3,4,5,1,2] == True then pure () else error "assertion failed"
  if candidate [3,5,10,1,2] == True then pure () else error "assertion failed"
  if candidate [4,3,1,2] == False then pure () else error "assertion failed"
  if candidate [3,5,4,1,2] == False then pure () else error "assertion failed"
  if candidate [] == True then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Find the shortest palindrome that begins with a supplied string.
--  Algorithm idea is simple:
--  - Find the longest postfix of supplied string that is a palindrome.
--  - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
--  >>> makePalindrome ""
--  ""
--  >>> makePalindrome "cat"
--  "catac"
--  >>> makePalindrome "cata"
--  "catac"
makePalindrome :: String -> String
makePalindrome string =

main :: IO ()
main = do
  let candidate = makePalindrome
  if candidate "" == "" then pure () else error "assertion failed"
  if candidate "x" == "x" then pure () else error "assertion failed"
  if candidate "xyz" == "xyzyx" then pure () else error "assertion failed"
  if candidate "xyx" == "xyx" then pure () else error "assertion failed"
  if candidate "jerry" == "jerryrrej" then pure () else error "assertion failed"
  pure ()


Prompt:
-- | In this problem, you will implement a function that takes two lists of numbers,
--  and determines whether it is possible to perform an exchange of elements
--  between them to make lst1 a list of only even numbers.
--  There is no limit on the number of exchanged elements between lst1 and lst2.
--  If it is possible to exchange elements between the lst1 and lst2 to make
--  all the elements of lst1 to be even, return "YES".
--  Otherwise, return "NO".
--  For example:
--  >>> exchange [1,2,3,4] [1,2,3,4]
--  "YES"
--  >>> exchange [1,2,3,4] [1,5,3,4]
--  "NO"
--  It is assumed that the input lists will be non-empty.
exchange :: [Int] -> [Int] -> String
exchange lst1 lst2 =

main :: IO ()
main = do
  let candidate = exchange
  if candidate [1,2,3,4] [1,2,3,4] == "YES" then pure () else error "assertion failed"
  if candidate [1,2,3,4] [1,5,3,4] == "NO" then pure () else error "assertion failed"
  if candidate [1,2,3,4] [2,1,4,3] == "YES" then pure () else error "assertion failed"
  if candidate [5,7,3] [2,6,4] == "YES" then pure () else error "assertion failed"
  if candidate [5,7,3] [2,6,3] == "NO" then pure () else error "assertion failed"
  if candidate [3,2,6,1,8,9] [3,5,5,1,1,1] == "NO" then pure () else error "assertion failed"
  if candidate [100,200] [200,200] == "YES" then pure () else error "assertion failed"
  pure ()


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 "a b c"
--  [("a", 1), ("b", 1), ("c", 1)]
--  >>> histogram "a b b a"
--  [("a", 2), ("b", 2)]
--  >>> histogram "a b c a b"
--  [("a", 2), ("b", 2)]
--  >>> histogram "b b b b a"
--  [("b", 4)]
--  >>> histogram ""
--  []
histogram :: String -> [(String, Int)]
histogram test =

main :: IO ()
main = do
  let candidate = histogram
  if candidate "a b b a" == [("a", 2), ("b", 2)] then pure () else error "assertion failed"
  if candidate "a b c a b" == [("a", 2), ("b", 2)] then pure () else error "assertion failed"
  if candidate "a b c d g" == [("a", 1), ("b", 1), ("c", 1), ("d", 1), ("g", 1)] then pure () else error "assertion failed"
  if candidate "r t g" == [("r", 1), ("t", 1), ("g", 1)] then pure () else error "assertion failed"
  if candidate "b b b b a" == [("b", 4)] then pure () else error "assertion failed"
  if candidate "r t g" == [("r", 1), ("t", 1), ("g", 1)] then pure () else error "assertion failed"
  if candidate "" == [] then pure () else error "assertion failed"
  if candidate "a" == [("a", 1)] then pure () else error "assertion failed"
  pure ()


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
--  >>> reverseDelete "abcde" "ae"
--  ("bcd", False)
--  >>> reverseDelete "abcdef" "b"
--  ("acdef", False)
--  >>> reverseDelete "abcdedcba" "ab"
--  ("cdedc", True)
reverseDelete :: String -> String -> (String, Bool)
reverseDelete s c =

main :: IO ()
main = do
  let candidate = reverseDelete
  if candidate "abcde" "ae" == ("bcd", False) then pure () else error "assertion failed"
  if candidate "abcdef" "b" == ("acdef", False) then pure () else error "assertion failed"
  if candidate "abcdedcba" "ab" == ("cdedc", True) then pure () else error "assertion failed"
  if candidate "dwik" "w" == ("dik", False) then pure () else error "assertion failed"
  if candidate "a" "a" == ("", True) then pure () else error "assertion failed"
  if candidate "abcdedcba" "" == ("abcdedcba", True) then pure () else error "assertion failed"
  if candidate "abcdedcba" "v" == ("abcdedcba", True) then pure () else error "assertion failed"
  if candidate "vabba" "v" == ("abba", True) then pure () else error "assertion failed"
  if candidate "mamma" "mia" == ("", True) then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a list of strings, where each string consists of only digits, return a list.
--  Each element i of the output should be "the number of odd elements in the
--  string i of the input." where all the i's should be replaced by the number
--  of odd digits in the i'th string of the input.
--  >>> oddCount ["1234567"]
--  ["the number of odd elements 4n the str4ng 4 of the 4nput."]
--  >>> oddCount ["3","11111111"]
--  ["the number of odd elements 1n the str1ng 1 of the 1nput.","the number of odd elements 8n the str8ng 8 of the 8nput."]
oddCount :: [String] -> [String]
oddCount lst =

main :: IO ()
main = do
  let candidate = oddCount
  if candidate ["1234567"] == ["the number of odd elements 4n the str4ng 4 of the 4nput."] then pure () else error "assertion failed"
  if candidate ["3","11111111"] == ["the number of odd elements 1n the str1ng 1 of the 1nput.","the number of odd elements 8n the str8ng 8 of the 8nput."] then pure () else error "assertion failed"
  if candidate ["271","137","314"] == ["the number of odd elements 2n the str2ng 2 of the 2nput.","the number of odd elements 3n the str3ng 3 of the 3nput.","the number of odd elements 2n the str2ng 2 of the 2nput."] then pure () else error "assertion failed"
  pure ()


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

main :: IO ()
main = do
  let candidate = minsubarraysum
  if candidate [2,3,4,1,2,4] == 1 then pure () else error "assertion failed"
  if candidate [(-1),(-2),(-3)] == (-6) then pure () else error "assertion failed"
  if candidate [(-1),(-2),(-3),2,(-10)] == (-14) then pure () else error "assertion failed"
  if candidate [(-9999999999999999)] == (-9999999999999999) then pure () else error "assertion failed"
  if candidate [0,10,20,1000000] == 0 then pure () else error "assertion failed"
  if candidate [(-1),(-2),(-3),10,(-5)] == (-6) then pure () else error "assertion failed"
  if candidate [100,(-1),(-2),(-3),10,(-5)] == (-6) then pure () else error "assertion failed"
  if candidate [10,11,13,8,3,4] == 3 then pure () else error "assertion failed"
  if candidate [100,(-33),32,(-1),0,(-2)] == (-33) then pure () else error "assertion failed"
  if candidate [(-10)] == (-10) then pure () else error "assertion failed"
  if candidate [7] == 7 then pure () else error "assertion failed"
  if candidate [1,(-1)] == (-1) then pure () else error "assertion failed"
  pure ()


Prompt:
-- | You are given a rectangular grid of wells. Each row represents a single well,
--  and each 1 in a row represents a single unit of water.
--  Each well has a corresponding bucket that can be used to extract water from it,
--  and all buckets have the same capacity.
--  Your task is to use the buckets to empty the wells.
--  Output the number of times you need to lower the buckets.
--  Example 1:
--  >>> maxFill [[0,0,1,0],[0,1,0,0],[1,1,1,1]] 1
--  6
--  Example 2:
--  >>> maxFill [[0,0,1,1],[0,0,0,0],[1,1,1,1],[0,1,1,1]] 2
--  5
--  Example 3:
--  >>> maxFill [[0,0,0],[0,0,0]] 5
--  0
--  Constraints:
--  * all wells have the same length
--  * 1 <= grid.length <= 10^2
--  * 1 <= grid[:,1].length <= 10^2
--  * grid[i][j] -> 0 | 1
--  * 1 <= capacity <= 10
maxFill :: [[Int]] -> Int -> Int
maxFill grid capacity =

main :: IO ()
main = do
  let candidate = maxFill
  if candidate [[0,0,1,0],[0,1,0,0],[1,1,1,1]] 1 == 6 then pure () else error "assertion failed"
  if candidate [[0,0,1,1],[0,0,0,0],[1,1,1,1],[0,1,1,1]] 2 == 5 then pure () else error "assertion failed"
  if candidate [[0,0,0],[0,0,0]] 5 == 0 then pure () else error "assertion failed"
  if candidate [[1,1,1,1],[1,1,1,1]] 2 == 4 then pure () else error "assertion failed"
  if candidate [[1,1,1,1],[1,1,1,1]] 9 == 2 then pure () else error "assertion failed"
  pure ()


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:
--  >>> sortArray [1,5,2,3,4]
--  [1,2,3,4,5]
--  >>> sortArray [(-2),(-3),(-4),(-5),(-6)]
--  [(-6),(-5),(-4),(-3),(-2)]
--  >>> sortArray [1,0,2,3,4]
--  [0,1,2,3,4]
sortArray :: [Int] -> [Int]
sortArray arr =

main :: IO ()
main = do
  let candidate = sortArray
  if candidate [1,5,2,3,4] == [1,2,4,3,5] then pure () else error "assertion failed"
  if candidate [(-2),(-3),(-4),(-5),(-6)] == [(-4),(-2),(-6),(-5),(-3)] then pure () else error "assertion failed"
  if candidate [1,0,2,3,4] == [0,1,2,4,3] then pure () else error "assertion failed"
  if candidate [] == [] then pure () else error "assertion failed"
  if candidate [2,5,77,4,5,3,5,7,2,3,4] == [2,2,4,4,3,3,5,5,5,7,77] then pure () else error "assertion failed"
  if candidate [3,6,44,12,32,5] == [32,3,5,6,12,44] then pure () else error "assertion failed"
  if candidate [2,4,8,16,32] == [2,4,8,16,32] then pure () else error "assertion failed"
  if candidate [2,4,8,16,32] == [2,4,8,16,32] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a string s and a natural number n, you have been tasked to implement
--  a function that returns a list of all words from string s that contain exactly
--  n consonants, in order these words appear in the string s.
--  If the string s is empty then the function should return an empty list.
--  Note: you may assume the input string contains only letters and spaces.
--  Examples:
--  >>> selectWords "Mary had a little lamb" 4
--  ["little"]
--  >>> selectWords "Mary had a little lamb" 3
--  ["Mary","lamb"]
--  >>> selectWords "simple white space" 2
--  []
--  >>> selectWords "Hello world" 4
--  ["world"]
--  >>> selectWords "Uncle sam" 3
--  ["Uncle"]
selectWords :: String -> Int -> [String]
selectWords s n =

main :: IO ()
main = do
  let candidate = selectWords
  if candidate "Mary had a little lamb" 4 == ["little"] then pure () else error "assertion failed"
  if candidate "Mary had a little lamb" 3 == ["Mary","lamb"] then pure () else error "assertion failed"
  if candidate "simple white space" 2 == [] then pure () else error "assertion failed"
  if candidate "Hello world" 4 == ["world"] then pure () else error "assertion failed"
  if candidate "Uncle sam" 3 == ["Uncle"] then pure () else error "assertion failed"
  if candidate "" 4 == [] then pure () else error "assertion failed"
  if candidate "a b c d e f" 1 == ["b","c","d","f"] then pure () else error "assertion failed"
  pure ()


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:
--  >>> getClosestVowel "yogurt"
--  "u"
--  >>> getClosestVowel "FULL"
--  "U"
--  >>> getClosestVowel "quick"
--  ""
--  >>> getClosestVowel "ab"
--  ""
getClosestVowel :: String -> String
getClosestVowel word =

main :: IO ()
main = do
  let candidate = getClosestVowel
  if candidate "yogurt" == "u" then pure () else error "assertion failed"
  if candidate "full" == "u" then pure () else error "assertion failed"
  if candidate "easy" == "" then pure () else error "assertion failed"
  if candidate "eAsy" == "" then pure () else error "assertion failed"
  if candidate "ali" == "" then pure () else error "assertion failed"
  if candidate "bad" == "a" then pure () else error "assertion failed"
  if candidate "most" == "o" then pure () else error "assertion failed"
  if candidate "ab" == "" then pure () else error "assertion failed"
  if candidate "ba" == "" then pure () else error "assertion failed"
  if candidate "quick" == "" then pure () else error "assertion failed"
  if candidate "anime" == "i" then pure () else error "assertion failed"
  if candidate "Asia" == "" then pure () else error "assertion failed"
  if candidate "Above" == "o" then pure () else error "assertion failed"
  pure ()


Prompt:
-- | You are given a list of two strings, both strings consist of open
--  parentheses '(' or close parentheses ')' only.
--  Your job is to check if it is possible to concatenate the two strings in
--  some order, that the resulting string will be good.
--  A string S is considered to be good if and only if all parentheses in S
--  are balanced. For example: the string '(())()' is good, while the string
--  '())' is not.
--  Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.
--  Examples:
--  >>> matchParens ["()(",")"]
--  "Yes"
--  >>> matchParens [")",")"]
--  "No"
matchParens :: [String] -> String
matchParens lst =

main :: IO ()
main = do
  let candidate = matchParens
  if candidate ["()(",")"] == "Yes" then pure () else error "assertion failed"
  if candidate [")",")"] == "No" then pure () else error "assertion failed"
  if candidate ["(()(())","())())"] == "No" then pure () else error "assertion failed"
  if candidate [")())","(()()("] == "Yes" then pure () else error "assertion failed"
  if candidate ["(())))","(()())(("] == "Yes" then pure () else error "assertion failed"
  if candidate ["()","())"] == "No" then pure () else error "assertion failed"
  if candidate ["(()(","()))()"] == "Yes" then pure () else error "assertion failed"
  if candidate ["((((","((())"] == "No" then pure () else error "assertion failed"
  if candidate [")(()","(()("] == "No" then pure () else error "assertion failed"
  if candidate [")(",")("] == "No" then pure () else error "assertion failed"
  if candidate ["(",")"] == "Yes" then pure () else error "assertion failed"
  if candidate [")","("] == "Yes" then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Input are two strings a and b consisting only of 1s and 0s.
--  Perform binary XOR on these inputs and return result also as a string.
--  >>> stringXor "010" "110"
--  "100"
stringXor :: String -> String -> String
stringXor a b =

main :: IO ()
main = do
  let candidate = stringXor
  if candidate "111000" "101010" == "010010" then pure () else error "assertion failed"
  if candidate "1" "1" == "0" then pure () else error "assertion failed"
  if candidate "0101" "0000" == "0101" then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given an array arr of integers and a positive integer k, return a sorted list
--  of length k with the maximum k numbers in arr.
--  Example 1:
--  >>> maximum [(-3),(-4),5] 3
--  [(-4),(-3),5]
--  Example 2:
--  >>> maximum [4,(-4),4] 2
--  [4,4]
--  Example 3:
--  >>> maximum [(-3),2,1,2,(-1),(-2),1] 1
--  [2]
--  Note:
--  1. The length of the array will be in the range of [1, 1000].
--  2. The elements in the array will be in the range of [-1000, 1000].
--  3. 0 <= k <= len(arr)
maximum :: [Int] -> Int -> [Int]
maximum arr k =

main :: IO ()
main = do
  let candidate = maximum
  if candidate [(-3),(-4),5] 3 == [(-4),(-3),5] then pure () else error "assertion failed"
  if candidate [4,(-4),4] 2 == [4,4] then pure () else error "assertion failed"
  if candidate [(-3),2,1,2,(-1),(-2),1] 1 == [2] then pure () else error "assertion failed"
  if candidate [123,(-123),20,0,1,2,(-3)] 3 == [2,20,123] then pure () else error "assertion failed"
  if candidate [(-123),20,0,1,2,(-3)] 4 == [0,1,2,20] then pure () else error "assertion failed"
  if candidate [5,15,0,3,(-13),(-8),0] 7 == [(-13),(-8),0,0,3,5,15] then pure () else error "assertion failed"
  if candidate [(-1),0,2,5,3,(-10)] 2 == [3,5] then pure () else error "assertion failed"
  if candidate [1,0,5,(-7)] 1 == [5] then pure () else error "assertion failed"
  if candidate [4,(-4)] 2 == [(-4),4] then pure () else error "assertion failed"
  if candidate [(-10),10] 2 == [(-10),10] then pure () else error "assertion failed"
  if candidate [1,2,3,(-23),243,(-400),0] 0 == [] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.
--  Examples
--  >>> solution [5,8,7,1]
--  12
--  >>> solution [3,3,3,3,3]
--  9
--  >>> solution [30,13,24,321]
--  0
solution :: [Int] -> Int
solution lst =

main :: IO ()
main = do
  let candidate = solution
  if candidate [5,8,7,1] == 12 then pure () else error "assertion failed"
  if candidate [3,3,3,3,3] == 9 then pure () else error "assertion failed"
  if candidate [30,13,24,321] == 0 then pure () else error "assertion failed"
  if candidate [5,9] == 5 then pure () else error "assertion failed"
  if candidate [2,4,8] == 0 then pure () else error "assertion failed"
  if candidate [30,13,23,32] == 23 then pure () else error "assertion failed"
  if candidate [3,13,2,9] == 3 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a non-empty array of integers arr and an integer k, return
--  the sum of the elements with at most two digits from the first k elements of arr.
--  Example:
--  >>> addElements [111,21,3,4000,5,6,7,8,9] 4
--  24
--  Constraints:
--  1. 1 <= len(arr) <= 100
--  2. 1 <= k <= len(arr)
addElements :: [Int] -> Int -> Int
addElements arr k =

main :: IO ()
main = do
  let candidate = addElements
  if candidate [1,(-2),(-3),41,57,76,87,88,99] 3 == (-4) then pure () else error "assertion failed"
  if candidate [111,121,3,4000,5,6] 2 == 0 then pure () else error "assertion failed"
  if candidate [11,21,3,90,5,6,7,8,9] 4 == 125 then pure () else error "assertion failed"
  if candidate [111,21,3,4000,5,6,7,8,9] 4 == 24 then pure () else error "assertion failed"
  if candidate [1] 1 == 1 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a positive integer n, return a sorted list 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 list 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.
--  >>> getOddCollatz 5
--  [1,5]
getOddCollatz :: Int -> [Int]
getOddCollatz n =

main :: IO ()
main = do
  let candidate = getOddCollatz
  if candidate 14 == [1,5,7,11,13,17] then pure () else error "assertion failed"
  if candidate 5 == [1,5] then pure () else error "assertion failed"
  if candidate 12 == [1,3,5] then pure () else error "assertion failed"
  if candidate 1 == [1] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | You have to write a function which validates a given date string and
--  returns True if the date is valid otherwise False.
--  The date is valid if all of the following rules are satisfied:
--  1. The date string is not empty.
--  2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.
--  3. The months should not be less than 1 or higher than 12.
--  4. The date should be in the format: mm-dd-yyyy
--  >>> validDate "03-11-2000"
--  True
--  >>> validDate "15-01-2012"
--  False
--  >>> validDate "04-0-2040"
--  False
--  >>> validDate "06-04-2020"
--  True
--  >>> validDate "06/04/2020"
--  False
validDate :: String -> Bool
validDate date =

main :: IO ()
main = do
  let candidate = validDate
  if candidate "03-11-2000" == True then pure () else error "assertion failed"
  if candidate "15-01-2012" == False then pure () else error "assertion failed"
  if candidate "04-0-2040" == False then pure () else error "assertion failed"
  if candidate "06-04-2020" == True then pure () else error "assertion failed"
  if candidate "01-01-2007" == True then pure () else error "assertion failed"
  if candidate "03-32-2011" == False then pure () else error "assertion failed"
  if candidate "" == False then pure () else error "assertion failed"
  if candidate "04-31-3000" == False then pure () else error "assertion failed"
  if candidate "06-06-2005" == True then pure () else error "assertion failed"
  if candidate "21-31-2000" == False then pure () else error "assertion failed"
  if candidate "04-12-2003" == True then pure () else error "assertion failed"
  if candidate "04122003" == False then pure () else error "assertion failed"
  if candidate "20030412" == False then pure () else error "assertion failed"
  if candidate "2003-04" == False then pure () else error "assertion failed"
  if candidate "2003-04-12" == False then pure () else error "assertion failed"
  if candidate "04-2003" == False then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a list of numbers, return whether or not they are sorted
--  in ascending order. If list has more than 1 duplicate of the same
--  number, return False. Assume no negative numbers and only integers.
--  Examples
--  >>> isSorted [5]
--  True
--  >>> isSorted [1,2,3,4,5]
--  True
--  >>> isSorted [1,3,2,4,5]
--  False
--  >>> isSorted [1,2,3,4,5,6]
--  True
--  >>> isSorted [1,2,3,4,5,6,7]
--  True
--  >>> isSorted [1,3,2,4,5,6,7]
--  False
--  >>> isSorted [1,2,2,3,3,4]
--  True
--  >>> isSorted [1,2,2,2,3,4]
--  False
isSorted :: [Int] -> Bool
isSorted lst =

main :: IO ()
main = do
  let candidate = isSorted
  if candidate [5] == True then pure () else error "assertion failed"
  if candidate [1,2,3,4,5] == True then pure () else error "assertion failed"
  if candidate [1,3,2,4,5] == False then pure () else error "assertion failed"
  if candidate [1,2,3,4,5,6] == True then pure () else error "assertion failed"
  if candidate [1,2,3,4,5,6,7] == True then pure () else error "assertion failed"
  if candidate [1,3,2,4,5,6,7] == False then pure () else error "assertion failed"
  if candidate [] == True then pure () else error "assertion failed"
  if candidate [1] == True then pure () else error "assertion failed"
  if candidate [3,2,1] == False then pure () else error "assertion failed"
  if candidate [1,2,2,2,3,4] == False then pure () else error "assertion failed"
  if candidate [1,2,3,3,3,4] == False then pure () else error "assertion failed"
  if candidate [1,2,2,3,3,4] == True then pure () else error "assertion failed"
  if candidate [1,2,3,4] == True then pure () else error "assertion failed"
  pure ()


Prompt:
-- | You are given two intervals,
--  where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).
--  The given intervals are closed which means that the interval (start, end)
--  includes both start and end.
--  For each given interval, it is assumed that its start is less or equal its end.
--  Your task is to determine whether the length of intersection of these two
--  intervals is a prime number.
--  Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)
--  which its length is 1, which not a prime number.
--  If the length of the intersection is a prime number, return "YES",
--  otherwise, return "NO".
--  If the two intervals don't intersect, return "NO".
--  [input/output] samples:
--  >>> intersection (1, 2) (2, 3)
--  "NO"
--  >>> intersection ((-1), 1) (0, 4)
--  "NO"
--  >>> intersection ((-3), (-1)) ((-5), 5)
--  "YES"
intersection :: (Int, Int) -> (Int, Int) -> String
intersection interval1 interval2 =

main :: IO ()
main = do
  let candidate = intersection
  if candidate (1, 2) (2, 3) == "NO" then pure () else error "assertion failed"
  if candidate ((-1), 1) (0, 4) == "NO" then pure () else error "assertion failed"
  if candidate ((-3), (-1)) ((-5), 5) == "YES" then pure () else error "assertion failed"
  if candidate ((-2), 2) ((-4), 0) == "YES" then pure () else error "assertion failed"
  if candidate ((-11), 2) ((-1), (-1)) == "NO" then pure () else error "assertion failed"
  if candidate (1, 2) (3, 5) == "NO" then pure () else error "assertion failed"
  if candidate (1, 2) (1, 2) == "NO" then pure () else error "assertion failed"
  if candidate ((-2), (-2)) ((-3), (-2)) == "NO" then pure () else error "assertion failed"
  pure ()


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 None for empty arr.
--  Example:
--  >>> prodSigns [1,2,2,(-4)]
--  Just (9)
--  >>> prodSigns [0,1]
--  Just (0)
--  >>> prodSigns []
--  Just (Nothing)
prodSigns :: [Int] -> Maybe Int
prodSigns arr =

main :: IO ()
main = do
  let candidate = prodSigns
  if candidate [1,2,2,(-4)] == Just ((-9)) then pure () else error "assertion failed"
  if candidate [0,1] == Just (0) then pure () else error "assertion failed"
  if candidate [1,1,1,2,3,(-1),1] == Just ((-10)) then pure () else error "assertion failed"
  if candidate [] == Just (Nothing) then pure () else error "assertion failed"
  if candidate [2,4,1,2,(-1),(-1),9] == Just (20) then pure () else error "assertion failed"
  if candidate [(-1),1,(-1),1] == Just (4) then pure () else error "assertion failed"
  if candidate [(-1),1,1,1] == Just ((-4)) then pure () else error "assertion failed"
  if candidate [(-1),1,1,0] == Just (0) then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a grid with N rows and N columns (N >= 2) and a positive integer k,
--  each cell of the grid contains a value. Every integer in the range [1, N * N]
--  inclusive appears exactly once on the cells of the grid.
--  You have to find the minimum path of length k in the grid. You can start
--  from any cell, and in each step you can move to any of the neighbor cells,
--  in other words, you can go to cells which share an edge with you current
--  cell.
--  Please note that a path of length k means visiting exactly k cells (not
--  necessarily distinct).
--  You CANNOT go off the grid.
--  A path A (of length k) is considered less than a path B (of length k) if
--  after making the ordered lists of the values on the cells that A and B go
--  through (let's call them lst_A and lst_B), lst_A is lexicographically less
--  than lst_B, in other words, there exist an integer index i (1 <= i <= k)
--  such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have
--  lst_A[j] = lst_B[j].
--  It is guaranteed that the answer is unique.
--  Return an ordered list of the values on the cells that the minimum path go through.
--  Examples:
--  >>> minpath [[1,2,3],[4,5,6],[7,8,9]] 3
--  [1,2,1]
--  >>> minpath [[5,9,3],[4,1,6],[7,8,2]] 1
--  [1]
minpath :: [[Int]] -> Int -> [Int]
minpath grid k =


Prompt:
-- | Out of list 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 list is empty.
--  >>> longest []
--  Just (Nothing)
--  >>> longest ["a","b","c"]
--  Just ("a")
--  >>> longest ["a","bb","ccc"]
--  Just ("ccc")
longest :: [String] -> Maybe String
longest strings =

main :: IO ()
main = do
  let candidate = longest
  if candidate [] == Just (Nothing) then pure () else error "assertion failed"
  if candidate ["x","y","z"] == Just ("x") then pure () else error "assertion failed"
  if candidate ["x","yyy","zzzz","www","kkkk","abc"] == Just ("zzzz") then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in
--  the last couple centuries. However, what people don't know is Tribonacci sequence.
--  Tribonacci sequence is defined by the recurrence:
--  tri(1) = 3
--  tri(n) = 1 + n / 2, if n is even.
--  tri(n) =  tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.
--  For example:
--  tri(2) = 1 + (2 / 2) = 2
--  tri(4) = 3
--  tri(3) = tri(2) + tri(1) + tri(4)
--  = 2 + 3 + 3 = 8
--  You are given a non-negative integer number n, you have to a return a list of the
--  first n + 1 numbers of the Tribonacci sequence.
--  Examples:
--  >>> tri 3
--  [1,3,2,8]
tri :: Int -> [Int]
tri n =

main :: IO ()
main = do
  let candidate = tri
  if candidate 3 == [1,3,2,8] then pure () else error "assertion failed"
  if candidate 4 == [1,3,2,8,3] then pure () else error "assertion failed"
  if candidate 5 == [1,3,2,8,3,15] then pure () else error "assertion failed"
  if candidate 6 == [1,3,2,8,3,15,4] then pure () else error "assertion failed"
  if candidate 7 == [1,3,2,8,3,15,4,24] then pure () else error "assertion failed"
  if candidate 8 == [1,3,2,8,3,15,4,24,5] then pure () else error "assertion failed"
  if candidate 9 == [1,3,2,8,3,15,4,24,5,35] then pure () else error "assertion failed"
  if candidate 20 == [1,3,2,8,3,15,4,24,5,35,6,48,7,63,8,80,9,99,10,120,11] then pure () else error "assertion failed"
  if candidate 0 == [1] then pure () else error "assertion failed"
  if candidate 1 == [1,3] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a positive integer n, return the product of the odd digits.
--  Return 0 if all digits are even.
--  For example:
--  >>> digits 1
--  1
--  >>> digits 4
--  0
--  >>> digits 235
--  15
digits :: Int -> Int
digits n =

main :: IO ()
main = do
  let candidate = digits
  if candidate 5 == 5 then pure () else error "assertion failed"
  if candidate 54 == 5 then pure () else error "assertion failed"
  if candidate 120 == 1 then pure () else error "assertion failed"
  if candidate 5014 == 5 then pure () else error "assertion failed"
  if candidate 98765 == 315 then pure () else error "assertion failed"
  if candidate 5576543 == 2625 then pure () else error "assertion failed"
  if candidate 2468 == 0 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Create a function that takes a string as input which contains only square brackets.
--  The function should return True if and only if there is a valid subsequence of brackets
--  where at least one bracket in the subsequence is nested.
--  >>> isNested "[[]]"
--  True
--  >>> isNested "[]]]]]]][[[[[]"
--  False
--  >>> isNested "[][]"
--  False
--  >>> isNested "[]"
--  False
--  >>> isNested "[[][]]"
--  True
--  >>> isNested "[[]][["
--  True
isNested :: String -> Bool
isNested string =

main :: IO ()
main = do
  let candidate = isNested
  if candidate "[[]]" == True then pure () else error "assertion failed"
  if candidate "[]]]]]]][[[[[]" == False then pure () else error "assertion failed"
  if candidate "[][]" == False then pure () else error "assertion failed"
  if candidate "[]" == False then pure () else error "assertion failed"
  if candidate "[[[[]]]]" == True then pure () else error "assertion failed"
  if candidate "[]]]]]]]]]]" == False then pure () else error "assertion failed"
  if candidate "[][][[]]" == True then pure () else error "assertion failed"
  if candidate "[[]" == False then pure () else error "assertion failed"
  if candidate "[]]" == False then pure () else error "assertion failed"
  if candidate "[[]][[" == True then pure () else error "assertion failed"
  if candidate "[[][]]" == True then pure () else error "assertion failed"
  if candidate "" == False then pure () else error "assertion failed"
  if candidate "[[[[[[[[" == False then pure () else error "assertion failed"
  if candidate "]]]]]]]]" == False then pure () else error "assertion failed"
  pure ()


Prompt:
-- | You are given a list of numbers.
--  You need to return the sum of squared numbers in the given list,
--  round each element in the list to the upper int(Ceiling) first.
--  Examples:
--  >>> lst [1.0,2.0,3.0]
--  14
--  >>> lst [1.0,4.0,9.0]
--  98
--  >>> lst [1.0,3.0,5.0,7.0]
--  84
--  >>> lst [1.4,4.2,0.0]
--  29
--  >>> lst [-2.4,1.0,1.0]
--  6
sumSquares :: [Float] -> Int
sumSquares lst =

main :: IO ()
main = do
  let candidate = sumSquares
  if candidate [1.0,2.0,3.0] == 14 then pure () else error "assertion failed"
  if candidate [1.0,2.0,3.0] == 14 then pure () else error "assertion failed"
  if candidate [1.0,3.0,5.0,7.0] == 84 then pure () else error "assertion failed"
  if candidate [1.4,4.2,0.0] == 29 then pure () else error "assertion failed"
  if candidate [-2.4,1.0,1.0] == 6 then pure () else error "assertion failed"
  if candidate [100.0,1.0,15.0,2.0] == 10230 then pure () else error "assertion failed"
  if candidate [10000.0,10000.0] == 200000000 then pure () else error "assertion failed"
  if candidate [-1.4,4.6,6.3] == 75 then pure () else error "assertion failed"
  if candidate [-1.4,17.9,18.9,19.9] == 1086 then pure () else error "assertion failed"
  if candidate [0.0] == 0 then pure () else error "assertion failed"
  if candidate [-1.0] == 1 then pure () else error "assertion failed"
  if candidate [-1.0,1.0,0.0] == 2 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Create a function that returns True if the last character
--  of a given string is an alphabetical character and is not
--  a part of a word, and False otherwise.
--  Note: "word" is a group of characters separated by space.
--  Examples:
--  >>> checkIfLastCharIsALetter "apple pie"
--  False
--  >>> checkIfLastCharIsALetter "apple pi e"
--  True
--  >>> checkIfLastCharIsALetter "apple pi e "
--  False
--  >>> checkIfLastCharIsALetter ""
--  False
checkIfLastCharIsALetter :: String -> Bool
checkIfLastCharIsALetter txt =

main :: IO ()
main = do
  let candidate = checkIfLastCharIsALetter
  if candidate "apple" == False then pure () else error "assertion failed"
  if candidate "apple pi e" == True then pure () else error "assertion failed"
  if candidate "eeeee" == False then pure () else error "assertion failed"
  if candidate "A" == True then pure () else error "assertion failed"
  if candidate "Pumpkin pie " == False then pure () else error "assertion failed"
  if candidate "Pumpkin pie 1" == False then pure () else error "assertion failed"
  if candidate "" == False then pure () else error "assertion failed"
  if candidate "eeeee e " == False then pure () else error "assertion failed"
  if candidate "apple pie" == False then pure () else error "assertion failed"
  if candidate "apple pi e " == False then pure () else error "assertion failed"
  pure ()


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:
--  >>> canArrange [1,2,4,3,5]
--  3
--  >>> canArrange [1,2,3]
--  (-1)
canArrange :: [Int] -> Int
canArrange arr =

main :: IO ()
main = do
  let candidate = canArrange
  if candidate [1,2,4,3,5] == 3 then pure () else error "assertion failed"
  if candidate [1,2,4,5] == (-1) then pure () else error "assertion failed"
  if candidate [1,4,2,5,6,7,8,9,10] == 2 then pure () else error "assertion failed"
  if candidate [4,8,5,7,3] == 4 then pure () else error "assertion failed"
  if candidate [] == (-1) then pure () else error "assertion failed"
  pure ()


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 list.
--  If there is no negative or positive integers, return them as None.
--  Examples:
--  >>> largestSmallestIntegers [2,4,1,3,5,7]
--  (Nothing, 1)
--  >>> largestSmallestIntegers []
--  (Nothing, Nothing)
--  >>> largestSmallestIntegers [0]
--  (Nothing, Nothing)
largestSmallestIntegers :: [Int] -> (Maybe Int, Maybe Int)
largestSmallestIntegers lst =

main :: IO ()
main = do
  let candidate = largestSmallestIntegers
  if candidate [2,4,1,3,5,7] == (Nothing, 1) then pure () else error "assertion failed"
  if candidate [2,4,1,3,5,7,0] == (Nothing, 1) then pure () else error "assertion failed"
  if candidate [1,3,2,4,5,6,(-2)] == ((-2), 1) then pure () else error "assertion failed"
  if candidate [4,5,3,6,2,7,(-7)] == ((-7), 2) then pure () else error "assertion failed"
  if candidate [7,3,8,4,9,2,5,(-9)] == ((-9), 2) then pure () else error "assertion failed"
  if candidate [] == (Nothing, Nothing) then pure () else error "assertion failed"
  if candidate [0] == (Nothing, Nothing) then pure () else error "assertion failed"
  if candidate [(-1),(-3),(-5),(-6)] == ((-1), Nothing) then pure () else error "assertion failed"
  if candidate [(-1),(-3),(-5),(-6),0] == ((-1), Nothing) then pure () else error "assertion failed"
  if candidate [(-6),(-4),(-4),(-3),1] == ((-3), 1) then pure () else error "assertion failed"
  if candidate [(-6),(-4),(-4),(-3),(-100),1] == ((-3), 1) then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers
--  Example
--  >>> isEqualToSumEven 4
--  False
--  >>> isEqualToSumEven 6
--  False
--  >>> isEqualToSumEven 8
--  True
isEqualToSumEven :: Int -> Bool
isEqualToSumEven n =

main :: IO ()
main = do
  let candidate = isEqualToSumEven
  if candidate 4 == False then pure () else error "assertion failed"
  if candidate 6 == False then pure () else error "assertion failed"
  if candidate 8 == True then pure () else error "assertion failed"
  if candidate 10 == True then pure () else error "assertion failed"
  if candidate 11 == False then pure () else error "assertion failed"
  if candidate 12 == True then pure () else error "assertion failed"
  if candidate 13 == False then pure () else error "assertion failed"
  if candidate 16 == True then pure () else error "assertion failed"
  pure ()


Prompt:
-- | The Brazilian factorial is defined as:
--  brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!
--  where n > 0
--  For example:
--  >>> specialFactorial 4
--  288
--  The function will receive an integer as input and should return the special
--  factorial of this integer.
specialFactorial :: Int -> Int
specialFactorial n =

main :: IO ()
main = do
  let candidate = specialFactorial
  if candidate 4 == 288 then pure () else error "assertion failed"
  if candidate 5 == 34560 then pure () else error "assertion failed"
  if candidate 7 == 125411328000 then pure () else error "assertion failed"
  if candidate 1 == 1 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Return a greatest common divisor of two integers a and b
--  >>> greatestCommonDivisor 3 5
--  1
--  >>> greatestCommonDivisor 25 15
--  5
greatestCommonDivisor :: Int -> Int -> Int
greatestCommonDivisor a b =

main :: IO ()
main = do
  let candidate = greatestCommonDivisor
  if candidate 3 7 == 1 then pure () else error "assertion failed"
  if candidate 10 15 == 5 then pure () else error "assertion failed"
  if candidate 49 14 == 7 then pure () else error "assertion failed"
  if candidate 144 60 == 12 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a string text, replace all spaces in it with underscores,
--  and if a string has more than 2 consecutive spaces,
--  then replace all consecutive spaces with -
--  >>> fixSpaces " Example"
--  "Example"
--  >>> fixSpaces " Example 1"
--  "Example_1"
--  >>> fixSpaces " Example 2"
--  "_Example_2"
--  >>> fixSpaces " Example 3"
--  "_Example-3"
fixSpaces :: String -> String
fixSpaces text =

main :: IO ()
main = do
  let candidate = fixSpaces
  if candidate "Example" == "Example" then pure () else error "assertion failed"
  if candidate "Mudasir Hanif " == "Mudasir_Hanif_" then pure () else error "assertion failed"
  if candidate "Yellow Yellow  Dirty  Fellow" == "Yellow_Yellow__Dirty__Fellow" then pure () else error "assertion failed"
  if candidate "Exa   mple" == "Exa-mple" then pure () else error "assertion failed"
  if candidate "   Exa 1 2 2 mple" == "-Exa_1_2_2_mple" then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Create a function which takes a string representing a file's name, and returns
--  'Yes' if the the file's name is valid, and returns 'No' otherwise.
--  A file's name is considered to be valid if and only if all the following conditions
--  are met:
--  - There should not be more than three digits ('0'-'9') in the file's name.
--  - The file's name contains exactly one dot '.'
--  - The substring before the dot should not be empty, and it starts with a letter from
--  the latin alphapet ('a'-'z' and 'A'-'Z').
--  - The substring after the dot should be one of these: ['txt', 'exe', 'dll']
--  Examples:
--  >>> fileNameCheck "example.txt"
--  "Yes"
--  >>> fileNameCheck "1example.dll"
--  "No"
fileNameCheck :: String -> String
fileNameCheck file_name =

main :: IO ()
main = do
  let candidate = fileNameCheck
  if candidate "example.txt" == "Yes" then pure () else error "assertion failed"
  if candidate "1example.dll" == "No" then pure () else error "assertion failed"
  if candidate "s1sdf3.asd" == "No" then pure () else error "assertion failed"
  if candidate "K.dll" == "Yes" then pure () else error "assertion failed"
  if candidate "MY16FILE3.exe" == "Yes" then pure () else error "assertion failed"
  if candidate "His12FILE94.exe" == "No" then pure () else error "assertion failed"
  if candidate "_Y.txt" == "No" then pure () else error "assertion failed"
  if candidate "?aREYA.exe" == "No" then pure () else error "assertion failed"
  if candidate "/this_is_valid.dll" == "No" then pure () else error "assertion failed"
  if candidate "this_is_valid.wow" == "No" then pure () else error "assertion failed"
  if candidate "this_is_valid.txt" == "Yes" then pure () else error "assertion failed"
  if candidate "this_is_valid.txtexe" == "No" then pure () else error "assertion failed"
  if candidate "#this2_i4s_5valid.ten" == "No" then pure () else error "assertion failed"
  if candidate "@this1_is6_valid.exe" == "No" then pure () else error "assertion failed"
  if candidate "this_is_12valid.6exe4.txt" == "No" then pure () else error "assertion failed"
  if candidate "all.exe.txt" == "No" then pure () else error "assertion failed"
  if candidate "I563_No.exe" == "Yes" then pure () else error "assertion failed"
  if candidate "Is3youfault.txt" == "Yes" then pure () else error "assertion failed"
  if candidate "no_one#knows.dll" == "Yes" then pure () else error "assertion failed"
  if candidate "1I563_Yes3.exe" == "No" then pure () else error "assertion failed"
  if candidate "I563_Yes3.txtt" == "No" then pure () else error "assertion failed"
  if candidate "final..txt" == "No" then pure () else error "assertion failed"
  if candidate "final132" == "No" then pure () else error "assertion failed"
  if candidate "_f4indsartal132." == "No" then pure () else error "assertion failed"
  if candidate ".txt" == "No" then pure () else error "assertion failed"
  if candidate "s." == "No" then pure () else error "assertion failed"
  pure ()


Prompt:
-- | "
--  This function will take a list of integers. For all entries in the list, 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 list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries.
--  Examples:
--  >>> lst
--  [1,2,3]
--  >>> lst
--  []
--  >>> lst
--  [(-1),(-5),2,(-1),(-5)]
sumSquares :: [Int] -> Int
sumSquares lst =

main :: IO ()
main = do
  let candidate = sumSquares
  if candidate [1,2,3] == 6 then pure () else error "assertion failed"
  if candidate [1,4,9] == 14 then pure () else error "assertion failed"
  if candidate [] == 0 then pure () else error "assertion failed"
  if candidate [1,1,1,1,1,1,1,1,1] == 9 then pure () else error "assertion failed"
  if candidate [(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1)] == (-3) then pure () else error "assertion failed"
  if candidate [0] == 0 then pure () else error "assertion failed"
  if candidate [(-1),(-5),2,(-1),(-5)] == (-126) then pure () else error "assertion failed"
  if candidate [(-56),(-99),1,0,(-2)] == 3030 then pure () else error "assertion failed"
  if candidate [(-1),0,0,0,0,0,0,0,(-1)] == 0 then pure () else error "assertion failed"
  if candidate [(-16),(-9),(-2),36,36,26,(-20),25,(-40),20,(-4),12,(-26),35,37] == (-14196) then pure () else error "assertion failed"
  if candidate [(-1),(-3),17,(-1),(-15),13,(-1),14,(-14),(-12),(-5),14,(-14),6,13,11,16,16,4,10] == (-1448) then pure () else error "assertion failed"
  pure ()


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:
--  >>> wordsInSentence "This is a test"
--  "is"
--  Example 2:
--  >>> wordsInSentence "lets go for swimming"
--  "go for"
--  Constraints:
--  * 1 <= len(sentence) <= 100
--  * sentence contains only letters
wordsInSentence :: String -> String
wordsInSentence sentence =

main :: IO ()
main = do
  let candidate = wordsInSentence
  if candidate "This is a test" == "is" then pure () else error "assertion failed"
  if candidate "lets go for swimming" == "go for" then pure () else error "assertion failed"
  if candidate "there is no place available here" == "there is no place" then pure () else error "assertion failed"
  if candidate "Hi I am Hussein" == "Hi am Hussein" then pure () else error "assertion failed"
  if candidate "go for it" == "go for it" then pure () else error "assertion failed"
  if candidate "here" == "" then pure () else error "assertion failed"
  if candidate "here is" == "is" then pure () else error "assertion failed"
  pure ()


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 "1/5" "5/1"
--  True
--  >>> simplify "1/6" "2/1"
--  False
--  >>> simplify "7/10" "10/2"
--  False
simplify :: String -> String -> Bool
simplify x n =

main :: IO ()
main = do
  let candidate = simplify
  if candidate "1/5" "5/1" == True then pure () else error "assertion failed"
  if candidate "1/6" "2/1" == False then pure () else error "assertion failed"
  if candidate "5/1" "3/1" == True then pure () else error "assertion failed"
  if candidate "7/10" "10/2" == False then pure () else error "assertion failed"
  if candidate "2/10" "50/10" == True then pure () else error "assertion failed"
  if candidate "7/2" "4/2" == True then pure () else error "assertion failed"
  if candidate "11/6" "6/1" == True then pure () else error "assertion failed"
  if candidate "2/3" "5/2" == False then pure () else error "assertion failed"
  if candidate "5/2" "3/5" == False then pure () else error "assertion failed"
  if candidate "2/4" "8/4" == True then pure () else error "assertion failed"
  if candidate "2/4" "4/2" == True then pure () else error "assertion failed"
  if candidate "1/5" "5/1" == True then pure () else error "assertion failed"
  if candidate "1/5" "1/5" == False then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Write a function which sorts the given list of integers
--  in ascending order according to the sum of their digits.
--  Note: if there are several items with similar sum of their digits,
--  order them based on their index in original list.
--  For example:
--  >>> orderByPoints [1,11,(-1),(-11),(-12)]
--  [(-1),(-11),1,(-12),11]
--  >>> orderByPoints []
--  []
orderByPoints :: [Int] -> [Int]
orderByPoints nums =


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 [15,(-73),14,(-15)]
--  1
--  >>> specialfilter [33,(-2),(-3),45,21,109]
--  2
specialfilter :: [Int] -> Int
specialfilter nums =

main :: IO ()
main = do
  let candidate = specialfilter
  if candidate [5,(-2),1,(-5)] == 0 then pure () else error "assertion failed"
  if candidate [15,(-73),14,(-15)] == 1 then pure () else error "assertion failed"
  if candidate [33,(-2),(-3),45,21,109] == 2 then pure () else error "assertion failed"
  if candidate [43,(-12),93,125,121,109] == 4 then pure () else error "assertion failed"
  if candidate [71,(-2),(-33),75,21,19] == 3 then pure () else error "assertion failed"
  if candidate [1] == 0 then pure () else error "assertion failed"
  if candidate [] == 0 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | You are given a positive integer n. You have to create an integer array a of length n.
--  For each i (1 â‰¤ i â‰¤ n), the value of a[i] = i * i - i + 1.
--  Return the number of triples (a[i], a[j], a[k]) of a where i < j < k,
--  and a[i] + a[j] + a[k] is a multiple of 3.
--  Example :
--  >>> getMaxTriples 5
--  1
--  Explanation:
--  a = [1, 3, 7, 13, 21]
--  The only valid triple is (1, 7, 13).
getMaxTriples :: Int -> Int
getMaxTriples n =

main :: IO ()
main = do
  let candidate = getMaxTriples
  if candidate 5 == 1 then pure () else error "assertion failed"
  if candidate 6 == 4 then pure () else error "assertion failed"
  if candidate 10 == 36 then pure () else error "assertion failed"
  if candidate 100 == 53361 then pure () else error "assertion failed"
  pure ()


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

main :: IO ()
main = do
  let candidate = sortedListSum
  if candidate ["aa","a","aaa"] == ["aa"] then pure () else error "assertion failed"
  if candidate ["school","AI","asdf","b"] == ["AI","asdf","school"] then pure () else error "assertion failed"
  if candidate ["d","b","c","a"] == [] then pure () else error "assertion failed"
  if candidate ["d","dcba","abcd","a"] == ["abcd","dcba"] then pure () else error "assertion failed"
  if candidate ["AI","ai","au"] == ["AI","ai","au"] then pure () else error "assertion failed"
  if candidate ["a","b","b","c","c","a"] == [] then pure () else error "assertion failed"
  if candidate ["aaaa","bbbb","dd","cc"] == ["cc","dd","aaaa","bbbb"] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Return list of all prefixes from shortest to longest of the input string
--  >>> allPrefixes "abc"
--  ["a","ab","abc"]
allPrefixes :: String -> [String]
allPrefixes string =

main :: IO ()
main = do
  let candidate = allPrefixes
  if candidate "" == [] then pure () else error "assertion failed"
  if candidate "asdfgh" == ["a","as","asd","asdf","asdfg","asdfgh"] then pure () else error "assertion failed"
  if candidate "WWW" == ["W","WW","WWW"] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | A simple program which should return the value of x if n is
--  a prime number and should return the value of y otherwise.
--  Examples:
--  >>> xOrY 7 34 12
--  34
--  >>> xOrY 15 8 5
--  5
xOrY :: Int -> Int -> Int -> Int
xOrY n x y =

main :: IO ()
main = do
  let candidate = xOrY
  if candidate 7 34 12 == 34 then pure () else error "assertion failed"
  if candidate 15 8 5 == 5 then pure () else error "assertion failed"
  if candidate 3 33 5212 == 33 then pure () else error "assertion failed"
  if candidate 1259 3 52 == 3 then pure () else error "assertion failed"
  if candidate 7919 (-1) 12 == (-1) then pure () else error "assertion failed"
  if candidate 3609 1245 583 == 583 then pure () else error "assertion failed"
  if candidate 91 56 129 == 129 then pure () else error "assertion failed"
  if candidate 6 34 1234 == 1234 then pure () else error "assertion failed"
  if candidate 1 2 0 == 0 then pure () else error "assertion failed"
  if candidate 2 2 0 == 2 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a list of numbers, return the sum of squares of the numbers
--  in the list that are odd. Ignore numbers that are negative or not integers.
--  >>> doubleTheDifference [1,3,2,0]
--  10
--  >>> doubleTheDifference [(-1),(-2),0]
--  0
--  >>> doubleTheDifference [9,(-2)]
--  81
--  >>> doubleTheDifference [0]
--  0
--  If the input list is empty, return 0.
doubleTheDifference :: [Float] -> Int
doubleTheDifference lst =

main :: IO ()
main = do
  let candidate = doubleTheDifference
  if candidate [.0] == 0 then pure () else error "assertion failed"
  if candidate [5.0,4.0] == 25 then pure () else error "assertion failed"
  if candidate [0.1,0.2,0.3] == 0 then pure () else error "assertion failed"
  if candidate [-10.0,-20.0,-30.0] == 0 then pure () else error "assertion failed"
  if candidate [-1.0,-2.0,8.0] == 0 then pure () else error "assertion failed"
  if candidate [0.2,3.0,5.0] == 34 then pure () else error "assertion failed"
  if candidate [-9.0,-7.0,-5.0,-3.0,-1.0,1.0,3.0,5.0,7.0,9.0] == 165 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | I think we all remember that feeling when the result of some long-awaited
--  event is finally known. The feelings and thoughts you have at that moment are
--  definitely worth noting down and comparing.
--  Your task is to determine if a person correctly guessed the results of a number of matches.
--  You are given two arrays of scores and guesses of equal length, where each index shows a match.
--  Return an array of the same length denoting how far off each guess was. If they have guessed correctly,
--  the value is 0, and if not, the value is the absolute difference between the guess and the score.
--  example:
--  >>> compare [1,2,3,4,5,1] [1,2,3,4,2,(-2)]
--  [0,0,0,0,3,3]
--  >>> compare [0,5,0,0,0,4] [4,1,1,0,0,(-2)]
--  [4,4,1,0,0,6]
compare :: [Int] -> [Int] -> [Int]
compare game guess =

main :: IO ()
main = do
  let candidate = compare
  if candidate [1,2,3,4,5,1] [1,2,3,4,2,(-2)] == [0,0,0,0,3,3] then pure () else error "assertion failed"
  if candidate [0,0,0,0,0,0] [0,0,0,0,0,0] == [0,0,0,0,0,0] then pure () else error "assertion failed"
  if candidate [1,2,3] [(-1),(-2),(-3)] == [2,4,6] then pure () else error "assertion failed"
  if candidate [1,2,3,5] [(-1),2,3,4] == [2,0,0,1] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | You will be given the name of a class (a string) and a list of extensions.
--  The extensions are to be used to load additional classes to the class. The
--  strength of the extension is as follows: Let CAP be the number of the uppercase
--  letters in the extension's name, and let SM be the number of lowercase letters
--  in the extension's name, the strength is given by the fraction CAP - SM.
--  You should find the strongest extension and return a string in this
--  format: ClassName.StrongestExtensionName.
--  If there are two or more extensions with the same strength, you should
--  choose the one that comes first in the list.
--  For example, if you are given "Slices" as the class and a list of the
--  extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should
--  return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension
--  (its strength is -1).
--  Example:
--  >>> strongestExtension "my_class" ["AA","Be","CC"]
--  "my_class.AA"
strongestExtension :: String -> [String] -> String
strongestExtension class_name extensions =

main :: IO ()
main = do
  let candidate = strongestExtension
  if candidate "Watashi" ["tEN","niNE","eIGHt8OKe"] == "Watashi.eIGHt8OKe" then pure () else error "assertion failed"
  if candidate "Boku123" ["nani","NazeDa","YEs.WeCaNe","32145tggg"] == "Boku123.YEs.WeCaNe" then pure () else error "assertion failed"
  if candidate "__YESIMHERE" ["t","eMptY","nothing","zeR00","NuLl__","123NoooneB321"] == "__YESIMHERE.NuLl__" then pure () else error "assertion failed"
  if candidate "K" ["Ta","TAR","t234An","cosSo"] == "K.TAR" then pure () else error "assertion failed"
  if candidate "__HAHA" ["Tab","123","781345","-_-"] == "__HAHA.123" then pure () else error "assertion failed"
  if candidate "YameRore" ["HhAas","okIWILL123","WorkOut","Fails","-_-"] == "YameRore.okIWILL123" then pure () else error "assertion failed"
  if candidate "finNNalLLly" ["Die","NowW","Wow","WoW"] == "finNNalLLly.WoW" then pure () else error "assertion failed"
  if candidate "_" ["Bb","91245"] == "_.Bb" then pure () else error "assertion failed"
  if candidate "Sp" ["671235","Bb"] == "Sp.671235" then pure () else error "assertion failed"
  pure ()


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
--  >>> cycpatternCheck "abcd" "abd"
--  False
--  >>> cycpatternCheck "hello" "ell"
--  True
--  >>> cycpatternCheck "whassup" "psus"
--  False
--  >>> cycpatternCheck "abab" "baa"
--  True
--  >>> cycpatternCheck "efef" "eeff"
--  False
--  >>> cycpatternCheck "himenss" "simen"
--  True
cycpatternCheck :: String -> String -> Bool
cycpatternCheck a b =

main :: IO ()
main = do
  let candidate = cycpatternCheck
  if candidate "xyzw" "xyw" == False then pure () else error "assertion failed"
  if candidate "yello" "ell" == True then pure () else error "assertion failed"
  if candidate "whattup" "ptut" == False then pure () else error "assertion failed"
  if candidate "efef" "fee" == True then pure () else error "assertion failed"
  if candidate "abab" "aabb" == False then pure () else error "assertion failed"
  if candidate "winemtt" "tinem" == True then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given an integer. return a tuple that has the number of even and odd digits respectively.
--  Example:
--  >>> evenOddCount (-12)
--  (1, 1)
--  >>> evenOddCount 123
--  (1, 2)
evenOddCount :: Int -> (Int, Int)
evenOddCount num =

main :: IO ()
main = do
  let candidate = evenOddCount
  if candidate 7 == (0, 1) then pure () else error "assertion failed"
  if candidate (-78) == (1, 1) then pure () else error "assertion failed"
  if candidate 3452 == (2, 2) then pure () else error "assertion failed"
  if candidate 346211 == (3, 3) then pure () else error "assertion failed"
  if candidate (-345821) == (3, 3) then pure () else error "assertion failed"
  if candidate (-2) == (1, 0) then pure () else error "assertion failed"
  if candidate (-45347) == (2, 3) then pure () else error "assertion failed"
  if candidate 0 == (1, 0) then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a positive integer, obtain its roman numeral equivalent as a string,
--  and return it in lowercase.
--  Restrictions: 1 <= num <= 1000
--  Examples:
--  >>> intToMiniRoman 19
--  "xix"
--  >>> intToMiniRoman 152
--  "clii"
--  >>> intToMiniRoman 426
--  "cdxxvi"
intToMiniRoman :: Int -> String
intToMiniRoman number =

main :: IO ()
main = do
  let candidate = intToMiniRoman
  if candidate 19 == "xix" then pure () else error "assertion failed"
  if candidate 152 == "clii" then pure () else error "assertion failed"
  if candidate 251 == "ccli" then pure () else error "assertion failed"
  if candidate 426 == "cdxxvi" then pure () else error "assertion failed"
  if candidate 500 == "d" then pure () else error "assertion failed"
  if candidate 1 == "i" then pure () else error "assertion failed"
  if candidate 4 == "iv" then pure () else error "assertion failed"
  if candidate 43 == "xliii" then pure () else error "assertion failed"
  if candidate 90 == "xc" then pure () else error "assertion failed"
  if candidate 94 == "xciv" then pure () else error "assertion failed"
  if candidate 532 == "dxxxii" then pure () else error "assertion failed"
  if candidate 900 == "cm" then pure () else error "assertion failed"
  if candidate 994 == "cmxciv" then pure () else error "assertion failed"
  if candidate 1000 == "m" then pure () else error "assertion failed"
  pure ()


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:
--  >>> rightAngleTriangle 3 4 5
--  True
--  >>> rightAngleTriangle 1 2 3
--  False
rightAngleTriangle :: Int -> Int -> Int -> Bool
rightAngleTriangle a b c =

main :: IO ()
main = do
  let candidate = rightAngleTriangle
  if candidate 3 4 5 == True then pure () else error "assertion failed"
  if candidate 1 2 3 == False then pure () else error "assertion failed"
  if candidate 10 6 8 == True then pure () else error "assertion failed"
  if candidate 2 2 2 == False then pure () else error "assertion failed"
  if candidate 7 24 25 == True then pure () else error "assertion failed"
  if candidate 10 5 7 == False then pure () else error "assertion failed"
  if candidate 5 12 13 == True then pure () else error "assertion failed"
  if candidate 15 8 17 == True then pure () else error "assertion failed"
  if candidate 48 55 73 == True then pure () else error "assertion failed"
  if candidate 1 1 1 == False then pure () else error "assertion failed"
  if candidate 2 2 10 == False then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Write a function that accepts a list of strings.
--  The list 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.
--  >>> findMax ["name","of","string"]
--  "string"
--  >>> findMax ["name","enam","game"]
--  "enam"
--  >>> findMax ["aaaaaaa","bb","cc"]
--  "aaaaaaa"
findMax :: [String] -> String
findMax words =

main :: IO ()
main = do
  let candidate = findMax
  if candidate ["name","of","string"] == "string" then pure () else error "assertion failed"
  if candidate ["name","enam","game"] == "enam" then pure () else error "assertion failed"
  if candidate ["aaaaaaa","bb","cc"] == "aaaaaaa" then pure () else error "assertion failed"
  if candidate ["abc","cba"] == "abc" then pure () else error "assertion failed"
  if candidate ["play","this","game","of","footbott"] == "footbott" then pure () else error "assertion failed"
  if candidate ["we","are","gonna","rock"] == "gonna" then pure () else error "assertion failed"
  if candidate ["we","are","a","mad","nation"] == "nation" then pure () else error "assertion failed"
  if candidate ["this","is","a","prrk"] == "this" then pure () else error "assertion failed"
  if candidate ["b"] == "b" then pure () else error "assertion failed"
  if candidate ["play","play","play"] == "play" then pure () else error "assertion failed"
  pure ()


Prompt:
-- | You're a hungry rabbit, and you already have eaten a certain number of carrots,
--  but now you need to eat more carrots to complete the day's meals.
--  you should return an array of [ total number of eaten carrots after your meals,
--  the number of carrots left after your meals ]
--  if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.
--  Example:
--  >>> eat 5 6 10
--  [11,4]
--  >>> eat 4 8 9
--  [12,1]
--  >>> eat 1 10 10
--  [11,0]
--  >>> eat 2 11 5
--  [7,0]
--  Variables:
--  @number : integer
--  the number of carrots that you have eaten.
--  @need : integer
--  the number of carrots that you need to eat.
--  @remaining : integer
--  the number of remaining carrots thet exist in stock
--  Constrain:
--  * 0 <= number <= 1000
--  * 0 <= need <= 1000
--  * 0 <= remaining <= 1000
--  Have fun :)
eat :: Int -> Int -> Int -> [Int]
eat number need remaining =

main :: IO ()
main = do
  let candidate = eat
  if candidate 5 6 10 == [11,4] then pure () else error "assertion failed"
  if candidate 4 8 9 == [12,1] then pure () else error "assertion failed"
  if candidate 1 10 10 == [11,0] then pure () else error "assertion failed"
  if candidate 2 11 5 == [7,0] then pure () else error "assertion failed"
  if candidate 4 5 7 == [9,2] then pure () else error "assertion failed"
  if candidate 4 5 1 == [5,0] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Return a string containing space-delimited numbers starting from 0 upto n inclusive.
--  >>> stringSequence 0
--  "0"
--  >>> stringSequence 5
--  "0 1 2 3 4 5"
stringSequence :: Int -> String
stringSequence n =

main :: IO ()
main = do
  let candidate = stringSequence
  if candidate 0 == "0" then pure () else error "assertion failed"
  if candidate 3 == "0 1 2 3" then pure () else error "assertion failed"
  if candidate 10 == "0 1 2 3 4 5 6 7 8 9 10" then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given two lists operator, and operand. The first list has basic algebra operations, and
--  the second list is a list of integers. Use the two given lists to build the algebric
--  expression and return the evaluation of this expression.
--  The basic algebra operations:
--  Addition ( + )
--  Subtraction ( - )
--  Multiplication ( * )
--  Floor division ( // )
--  Exponentiation ( ** )
--  Example:
--  operator['+', '*', '-']
--  array = [2, 3, 4, 5]
--  result = 2 + 3 * 4 - 5
--  => result = 9
--  Note:
--  The length of operator list is equal to the length of operand list minus one.
--  Operand is a list of of non-negative integers.
--  Operator list has at least one operator, and operand list has at least two operands.
doAlgebra :: [String] -> [Int] -> Int
doAlgebra operator operand =

main :: IO ()
main = do
  let candidate = doAlgebra
  if candidate ["**","*","+"] [2,3,4,5] == 37 then pure () else error "assertion failed"
  if candidate ["+","*","-"] [2,3,4,5] == 9 then pure () else error "assertion failed"
  if candidate ["//","*"] [7,3,4] == 8 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | You are given a string s.
--  if s[i] is a letter, reverse its case from lower to upper or vise versa,
--  otherwise keep it as it is.
--  If the string contains no letters, reverse the string.
--  The function should return the resulted string.
--  Examples
--  >>> solve "1234"
--  "4321"
--  >>> solve "ab"
--  "AB"
--  >>> solve "#a@C"
--  "#A@c"
solve :: String -> String
solve s =

main :: IO ()
main = do
  let candidate = solve
  if candidate "AsDf" == "aSdF" then pure () else error "assertion failed"
  if candidate "1234" == "4321" then pure () else error "assertion failed"
  if candidate "ab" == "AB" then pure () else error "assertion failed"
  if candidate "#a@C" == "#A@c" then pure () else error "assertion failed"
  if candidate "#AsdfW^45" == "#aSDFw^45" then pure () else error "assertion failed"
  if candidate "#6@2" == "2@6#" then pure () else error "assertion failed"
  if candidate "#$a^D" == "#$A^d" then pure () else error "assertion failed"
  if candidate "#ccc" == "#CCC" then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a string 'text', return its md5 hash equivalent string.
--  If 'text' is an empty string, return None.
--  >>> stringToMd5 "Hello world"
--  Just ("3e25960a79dbc69b674cd4ec67a72c62")
stringToMd5 :: String -> Maybe String
stringToMd5 text =

main :: IO ()
main = do
  let candidate = stringToMd5
  if candidate "Hello world" == Just ("3e25960a79dbc69b674cd4ec67a72c62") then pure () else error "assertion failed"
  if candidate "" == Just (Nothing) then pure () else error "assertion failed"
  if candidate "A B C" == Just ("0ef78513b0cb8cef12743f5aeb35f888") then pure () else error "assertion failed"
  if candidate "password" == Just ("5f4dcc3b5aa765d61d8327deb882cf99") then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given two positive integers a and b, return the even digits between a
--  and b, in ascending order.
--  For example:
--  >>> generateIntegers 2 8
--  [2,4,6,8]
--  >>> generateIntegers 8 2
--  [2,4,6,8]
--  >>> generateIntegers 10 14
--  []
generateIntegers :: Int -> Int -> [Int]
generateIntegers a b =

main :: IO ()
main = do
  let candidate = generateIntegers
  if candidate 2 10 == [2,4,6,8] then pure () else error "assertion failed"
  if candidate 10 2 == [2,4,6,8] then pure () else error "assertion failed"
  if candidate 132 2 == [2,4,6,8] then pure () else error "assertion failed"
  if candidate 17 89 == [] then pure () else error "assertion failed"
  pure ()


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

main :: IO ()
main = do
  let candidate = countDistinctCharacters
  if candidate "" == 0 then pure () else error "assertion failed"
  if candidate "abcde" == 5 then pure () else error "assertion failed"
  if candidate "abcdecadeCADE" == 5 then pure () else error "assertion failed"
  if candidate "aaaaAAAAaaaa" == 1 then pure () else error "assertion failed"
  if candidate "Jerry jERRY JeRRRY" == 5 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Input to this function is a string representing musical notes in a special ASCII format.
--  Your task is to parse this string and return list of integers corresponding to how many beats does each
--  not last.
--  Here is a legend:
--  'o' - whole note, lasts four beats
--  'o|' - half note, lasts two beats
--  '.|' - quater note, lasts one beat
--  >>> parseMusic "o o| .| o| o| .| .| .| .| o o"
--  [4,2,1,2,2,1,1,1,1,4,4]
parseMusic :: String -> [Int]
parseMusic music_string =

main :: IO ()
main = do
  let candidate = parseMusic
  if candidate "" == [] then pure () else error "assertion failed"
  if candidate "o o o o" == [4,4,4,4] then pure () else error "assertion failed"
  if candidate ".| .| .| .|" == [1,1,1,1] then pure () else error "assertion failed"
  if candidate "o| o| .| .| o o o o" == [2,2,1,1,4,4,4,4] then pure () else error "assertion failed"
  if candidate "o| .| o| .| o o| o o|" == [2,1,2,1,4,2,4,2] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Find how many times a given substring can be found in the original string. Count overlaping cases.
--  >>> howManyTimes "" "a"
--  0
--  >>> howManyTimes "aaa" "a"
--  3
--  >>> howManyTimes "aaaa" "aa"
--  3
howManyTimes :: String -> String -> Int
howManyTimes string substring =

main :: IO ()
main = do
  let candidate = howManyTimes
  if candidate "" "x" == 0 then pure () else error "assertion failed"
  if candidate "xyxyxyx" "x" == 4 then pure () else error "assertion failed"
  if candidate "cacacacac" "cac" == 4 then pure () else error "assertion failed"
  if candidate "john doe" "john" == 1 then pure () else error "assertion failed"
  pure ()


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
--  >>> sortNumbers "three one five"
--  "one three five"
sortNumbers :: String -> String
sortNumbers numbers =

main :: IO ()
main = do
  let candidate = sortNumbers
  if candidate "" == "" then pure () else error "assertion failed"
  if candidate "three" == "three" then pure () else error "assertion failed"
  if candidate "three five nine" == "three five nine" then pure () else error "assertion failed"
  if candidate "five zero four seven nine eight" == "zero four five seven eight nine" then pure () else error "assertion failed"
  if candidate "six five four three two one zero" == "zero one two three four five six" then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Input to this function is a string containing multiple groups of nested parentheses. Your goal is to
--  separate those group into separate strings and return the list of those.
--  Separate groups are balanced (each open brace is properly closed) and not nested within each other
--  Ignore any spaces in the input string.
--  >>> separateParenGroups "( ) (( )) (( )( ))"
--  ["()","(())","(()())"]
separateParenGroups :: String -> [String]
separateParenGroups paren_string =


Prompt:
-- | From a supplied list of numbers (of length at least two) select and return two that are the closest to each
--  other and return them in order (smaller number, larger number).
--  >>> findClosestElements [1.0,2.0,3.0,4.0,5.0,2.2]
--  (2.0, 2.2)
--  >>> findClosestElements [1.0,2.0,3.0,4.0,5.0,2.0]
--  (2.0, 2.0)
findClosestElements :: [Float] -> (Float, Float)
findClosestElements numbers =

main :: IO ()
main = do
  let candidate = findClosestElements
  if candidate [1.0,2.0,3.9,4.0,5.0,2.2] == (3.9, 4.0) then pure () else error "assertion failed"
  if candidate [1.0,2.0,5.9,4.0,5.0] == (5.0, 5.9) then pure () else error "assertion failed"
  if candidate [1.0,2.0,3.0,4.0,5.0,2.2] == (2.0, 2.2) then pure () else error "assertion failed"
  if candidate [1.0,2.0,3.0,4.0,5.0,2.0] == (2.0, 2.0) then pure () else error "assertion failed"
  if candidate [1.1,2.2,3.1,4.1,5.1] == (2.2, 3.1) then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given list of numbers (of at least two elements), apply a linear transform to that list,
--  such that the smallest number will become 0 and the largest will become 1
--  >>> rescaleToUnit [1.0,2.0,3.0,4.0,5.0]
--  [0.0,0.25,0.5,0.75,1.0]
rescaleToUnit :: [Float] -> [Float]
rescaleToUnit numbers =

main :: IO ()
main = do
  let candidate = rescaleToUnit
  if candidate [2.0,49.9] == [0.0,1.0] then pure () else error "assertion failed"
  if candidate [100.0,49.9] == [1.0,0.0] then pure () else error "assertion failed"
  if candidate [1.0,2.0,3.0,4.0,5.0] == [0.0,0.25,0.5,0.75,1.0] then pure () else error "assertion failed"
  if candidate [2.0,1.0,5.0,3.0,4.0] == [0.25,0.0,1.0,0.5,0.75] then pure () else error "assertion failed"
  if candidate [12.0,11.0,15.0,13.0,14.0] == [0.25,0.0,1.0,0.5,0.75] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Return length of given string
--  >>> strlen ""
--  0
--  >>> strlen "abc"
--  3
strlen :: String -> Int
strlen string =

main :: IO ()
main = do
  let candidate = strlen
  if candidate "" == 0 then pure () else error "assertion failed"
  if candidate "x" == 1 then pure () else error "assertion failed"
  if candidate "asdasnakj" == 9 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | For a given number n, find the largest number that divides n evenly, smaller than n
--  >>> largestDivisor 15
--  5
largestDivisor :: Int -> Int
largestDivisor n =

main :: IO ()
main = do
  let candidate = largestDivisor
  if candidate 3 == 1 then pure () else error "assertion failed"
  if candidate 7 == 1 then pure () else error "assertion failed"
  if candidate 10 == 5 then pure () else error "assertion failed"
  if candidate 100 == 50 then pure () else error "assertion failed"
  if candidate 49 == 7 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Return list of prime factors of given integer in the order from smallest to largest.
--  Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.
--  Input number should be equal to the product of all factors
--  >>> factorize 8
--  [2,2,2]
--  >>> factorize 25
--  [5,5]
--  >>> factorize 70
--  [2,5,7]
factorize :: Int -> [Int]
factorize n =

main :: IO ()
main = do
  let candidate = factorize
  if candidate 2 == [2] then pure () else error "assertion failed"
  if candidate 4 == [2,2] then pure () else error "assertion failed"
  if candidate 8 == [2,2,2] then pure () else error "assertion failed"
  if candidate 57 == [3,19] then pure () else error "assertion failed"
  if candidate 3249 == [3,3,19,19] then pure () else error "assertion failed"
  if candidate 185193 == [3,3,3,19,19,19] then pure () else error "assertion failed"
  if candidate 20577 == [3,19,19,19] then pure () else error "assertion failed"
  if candidate 18 == [2,3,3] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | From a list of integers, remove all elements that occur more than once.
--  Keep order of elements left the same as in the input.
--  >>> removeDuplicates [1,2,3,2,4]
--  [1,3,4]
removeDuplicates :: [Int] -> [Int]
removeDuplicates numbers =

main :: IO ()
main = do
  let candidate = removeDuplicates
  if candidate [] == [] then pure () else error "assertion failed"
  if candidate [1,2,3,4] == [1,2,3,4] then pure () else error "assertion failed"
  if candidate [1,2,3,2,4,3,5] == [1,4,5] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | For a given string, flip lowercase characters to uppercase and uppercase to lowercase.
--  >>> flipCase "Hello"
--  "hELLO"
flipCase :: String -> String
flipCase string =

main :: IO ()
main = do
  let candidate = flipCase
  if candidate "" == "" then pure () else error "assertion failed"
  if candidate "Hello!" == "hELLO!" then pure () else error "assertion failed"
  if candidate "These violent delights have violent ends" == "tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS" then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Concatenate list of strings into a single string
--  >>> concatenate []
--  ""
--  >>> concatenate ["a","b","c"]
--  "abc"
concatenate :: [String] -> String
concatenate strings =

main :: IO ()
main = do
  let candidate = concatenate
  if candidate [] == "" then pure () else error "assertion failed"
  if candidate ["x","y","z"] == "xyz" then pure () else error "assertion failed"
  if candidate ["x","y","z","w","k"] == "xyzwk" then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Filter an input list of strings only for ones that start with a given prefix.
--  >>> filterByPrefix [] "a"
--  []
--  >>> filterByPrefix ["abc","bcd","cde","array"] "a"
--  ["abc","array"]
filterByPrefix :: [String] -> String -> [String]
filterByPrefix strings prefix =

main :: IO ()
main = do
  let candidate = filterByPrefix
  if candidate [] "john" == [] then pure () else error "assertion failed"
  if candidate ["xxx","asd","xxy","john doe","xxxAAA","xxx"] "xxx" == ["xxx","xxxAAA","xxx"] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Given a positive floating point number, it can be decomposed into
--  and integer part (largest integer smaller than given number) and decimals
--  (leftover part always smaller than 1).
--  Return the decimal part of the number.
--  >>> truncateNumber 3.5
--  0.5
truncateNumber :: Float -> Float
truncateNumber number =

main :: IO ()
main = do
  let candidate = truncateNumber
  if candidate 3.5 == 0.5 then pure () else error "assertion failed"
  if candidate 1.25 == 0.25 then pure () else error "assertion failed"
  if candidate 123.0 == 0.0 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Return only positive numbers in the list.
--  >>> getPositive [(-1),2,(-4),5,6]
--  [2,5,6]
--  >>> getPositive [5,3,(-5),2,(-3),3,9,0,123,1,(-10)]
--  [5,3,2,3,9,123,1]
getPositive :: [Int] -> [Int]
getPositive l =

main :: IO ()
main = do
  let candidate = getPositive
  if candidate [(-1),(-2),4,5,6] == [4,5,6] then pure () else error "assertion failed"
  if candidate [5,3,(-5),2,3,3,9,0,123,1,(-10)] == [5,3,2,3,3,9,123,1] then pure () else error "assertion failed"
  if candidate [(-1),(-2)] == [] then pure () else error "assertion failed"
  if candidate [] == [] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Return true if a given number is prime, and false otherwise.
--  >>> isPrime 6
--  False
--  >>> isPrime 101
--  True
--  >>> isPrime 11
--  True
--  >>> isPrime 13441
--  True
--  >>> isPrime 61
--  True
--  >>> isPrime 4
--  False
--  >>> isPrime 1
--  False
isPrime :: Int -> Bool
isPrime n =

main :: IO ()
main = do
  let candidate = isPrime
  if candidate 6 == False then pure () else error "assertion failed"
  if candidate 101 == True then pure () else error "assertion failed"
  if candidate 11 == True then pure () else error "assertion failed"
  if candidate 13441 == True then pure () else error "assertion failed"
  if candidate 61 == True then pure () else error "assertion failed"
  if candidate 4 == False then pure () else error "assertion failed"
  if candidate 1 == False then pure () else error "assertion failed"
  if candidate 5 == True then pure () else error "assertion failed"
  if candidate 11 == True then pure () else error "assertion failed"
  if candidate 17 == True then pure () else error "assertion failed"
  if candidate 85 == False then pure () else error "assertion failed"
  if candidate 77 == False then pure () else error "assertion failed"
  if candidate 255379 == False then pure () else error "assertion failed"
  pure ()


Prompt:
-- | This function takes a list l and returns a list 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.
--  >>> sortThird [1,2,3]
--  [1,2,3]
--  >>> sortThird [5,6,3,4,8,9,2]
--  [2,6,3,4,8,9,5]
sortThird :: [Int] -> [Int]
sortThird l =

main :: IO ()
main = do
  let candidate = sortThird
  if candidate [5,6,3,4,8,9,2] == [2,6,3,4,8,9,5] then pure () else error "assertion failed"
  if candidate [5,8,3,4,6,9,2] == [2,8,3,4,6,9,5] then pure () else error "assertion failed"
  if candidate [5,6,9,4,8,3,2] == [2,6,9,4,8,3,5] then pure () else error "assertion failed"
  if candidate [5,6,3,4,8,9,2,1] == [2,6,3,4,8,9,5,1] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Return sorted unique elements in a list
--  >>> unique [5,3,5,2,3,3,9,0,123]
--  [0,2,3,5,9,123]
unique :: [Int] -> [Int]
unique l =

main :: IO ()
main = do
  let candidate = unique
  if candidate [5,3,5,2,3,3,9,0,123] == [0,2,3,5,9,123] then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Return maximum element in the list.
--  >>> maxElement [1,2,3]
--  3
--  >>> maxElement [5,3,(-5),2,(-3),3,9,0,123,1,(-10)]
--  123
maxElement :: [Int] -> Int
maxElement l =

main :: IO ()
main = do
  let candidate = maxElement
  if candidate [1,2,3] == 3 then pure () else error "assertion failed"
  if candidate [5,3,(-5),2,(-3),3,9,0,124,1,(-10)] == 124 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.
--  >>> fizzBuzz 50
--  0
--  >>> fizzBuzz 78
--  2
--  >>> fizzBuzz 79
--  3
fizzBuzz :: Int -> Int
fizzBuzz n =

main :: IO ()
main = do
  let candidate = fizzBuzz
  if candidate 50 == 0 then pure () else error "assertion failed"
  if candidate 78 == 2 then pure () else error "assertion failed"
  if candidate 79 == 3 then pure () else error "assertion failed"
  if candidate 100 == 3 then pure () else error "assertion failed"
  if candidate 200 == 6 then pure () else error "assertion failed"
  if candidate 4000 == 192 then pure () else error "assertion failed"
  if candidate 10000 == 639 then pure () else error "assertion failed"
  if candidate 100000 == 8026 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | This function takes a list l and returns a list 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.
--  >>> sortEven [1,2,3]
--  [1,2,3]
--  >>> sortEven [5,6,3,4]
--  [3,6,5,4]
sortEven :: [Int] -> [Int]
sortEven l =


Prompt:
-- | prime_fib returns n-th number that is a Fibonacci number and it's also prime.
--  >>> primeFib 1
--  2
--  >>> primeFib 2
--  3
--  >>> primeFib 3
--  5
--  >>> primeFib 4
--  13
--  >>> primeFib 5
--  89
primeFib :: Int -> Int
primeFib n =

main :: IO ()
main = do
  let candidate = primeFib
  if candidate 1 == 2 then pure () else error "assertion failed"
  if candidate 2 == 3 then pure () else error "assertion failed"
  if candidate 3 == 5 then pure () else error "assertion failed"
  if candidate 4 == 13 then pure () else error "assertion failed"
  if candidate 5 == 89 then pure () else error "assertion failed"
  if candidate 6 == 233 then pure () else error "assertion failed"
  if candidate 7 == 1597 then pure () else error "assertion failed"
  if candidate 8 == 28657 then pure () else error "assertion failed"
  if candidate 9 == 514229 then pure () else error "assertion failed"
  if candidate 10 == 433494437 then pure () else error "assertion failed"
  pure ()


Prompt:
-- | You're given a list 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.
--  >>> belowZero [1,2,3]
--  False
--  >>> belowZero [1,2,(-4),5]
--  True
belowZero :: [Int] -> Bool
belowZero operations =

main :: IO ()
main = do
  let candidate = belowZero
  if candidate [] == False then pure () else error "assertion failed"
  if candidate [1,2,(-3),1,2,(-3)] == False then pure () else error "assertion failed"
  if candidate [1,2,(-4),5,6] == True then pure () else error "assertion failed"
  if candidate [1,(-1),2,(-2),5,(-5),4,(-4)] == False then pure () else error "assertion failed"
  if candidate [1,(-1),2,(-2),5,(-5),4,(-5)] == True then pure () else error "assertion failed"
  if candidate [1,(-2),2,(-2),5,(-5),4,(-4)] == True then pure () else error "assertion failed"
  pure ()


Prompt:
-- | triples_sum_to_zero takes a list of integers as an input.
--  it returns True if there are three distinct elements in the list that
--  sum to zero, and False otherwise.
--  >>> triplesSumToZero [1,3,5,0]
--  False
--  >>> triplesSumToZero [1,3,(-2),1]
--  True
--  >>> triplesSumToZero [1,2,3,7]
--  False
--  >>> triplesSumToZero [2,4,(-5),3,9,7]
--  True
--  >>> triplesSumToZero [1]
--  False
triplesSumToZero :: [Int] -> Bool
triplesSumToZero l =

main :: IO ()
main = do
  let candidate = triplesSumToZero
  if candidate [1,3,5,0] == False then pure () else error "assertion failed"
  if candidate [1,3,5,(-1)] == False then pure () else error "assertion failed"
  if candidate [1,3,(-2),1] == True then pure () else error "assertion failed"
  if candidate [1,2,3,7] == False then pure () else error "assertion failed"
  if candidate [1,2,5,7] == False then pure () else error "assertion failed"
  if candidate [2,4,(-5),3,9,7] == True then pure () else error "assertion failed"
  if candidate [1] == False then pure () else error "assertion failed"
  if candidate [1,3,5,(-100)] == False then pure () else error "assertion failed"
  if candidate [100,3,5,(-100)] == False then pure () else error "assertion failed"
  pure ()