Online test, 45 minutes 2 problems at hackerrank.com.
1. Complete the function fibonacci to return an array containing the first N Fibonacci numbers.
2. Given N unique positive integers, we want to count the total pairs of numbers whose difference is K. The solution should minimize computational time complexity to the best of your ability.
1st line contains N and K, separated by a space
2nd line contains N integers that form the set.
One integer, the number of pairs of numbers that have difference K.
1 5 3 4 2