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
}
// TODO: Add your tests here
// Starting from Node 10.x, [Mocha](https://mochajs.org) is used instead of our custom test framework.
// [Codewars' assertion methods](https://github.com/Codewars/codewars.com/wiki/Codewars-JavaScript-Test-Framework)
// are still available for now.
//
// For new tests, using [Chai](https://chaijs.com/) is recommended.
// You can use it by requiring:
// const assert = require("chai").assert;
// If the failure output for deep equality is truncated, `chai.config.truncateThreshold` can be adjusted.
const expect = require("chai").expect;
describe("Solution", function() {
it("should test for something", function() {
var checks = [ {n:377,n1:0,n2:1}, {n:12,n1:1,n2:4} ];
for (var c of checks) {
var r = unfibonacci(c.n);
expect(r).to.have.members([c.n1,c.n2]);
}
});
});