-
Notifications
You must be signed in to change notification settings - Fork 1
Programming test
Questions:
-
Find the count of prime numbers given by the user? test cases
countPrime(100) = 25 countPrime(100000) = 9592
fun countPrime(number: Int):Int { - your code }
-
you are given a string of space separated numbers, and have to return the highest and lowest number.
highAndLow("1 2 3 4 5") // return "5 1" highAndLow("1 2 -3 4 5") // return "5 -3" highAndLow("1 9 3 4 -5") // return "9 -5"
-
You will be given an array and a limit value. You must check that all values in the array are below or equal to the limit value. If they are, return true. Else, return false.
smallEnough([10,5, 6 ,5], 11) = true smallEnough([10,5, 6 ,5], 5) = false
-
Return the number (count) of vowels in the given string.
countVowel('hello how you doing') = 7
-
Find missing letter Write a method that takes an array of consecutive (increasing) letters as input and that returns the missing letter in the array.
You will always get an valid array. And it will be always exactly one letter be missing. The length of the array will always be at least 2. The array will always contain letters in only one case. Example:
['a','b','c','d','f'] -> 'e' ['O','Q','R','S'] -> 'P'