Ad
Numbers
Data Types
Integers

Unfibonacci. You are given a positive integer number. Find the two smallest integers (>=0) that you can start a fibonacci-like sequence with to get to that number. Which means, you take two integers, add them, you get a third one, let's say you start with 3 and 4. Add them, you get 7. Then add 7+4=11. 11+7=18 etc. In the end, you have to get the number that you're given.

function unfibonacci(n) {
  return [0,1]; // given the number n that belongs to the fibonacci-like sequence, 
                // return an array of two smallest integers that can be a start of this sequence
}
Code
Diff
  • print("%s %s" % ("hello", "world"))
    • print('%s %s' % ('hello', 'world'))
    • print("%s %s" % ("hello", "world"))