We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
1) There is no way you are going to be able to build an actual string of most fibonacci words involved here.
2) The trick is to track where a and b are in each word in the sequence, and the total length of each word, without copying anything.
3) You can't avoid dealing with numbers that are higher than most built-in long int data types. I used javascript and wrote some simple functions to do arithmetic with integers in strings (i.e., '134534234345' instead of 134534234345).
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #230: Fibonacci Words
You are viewing a single comment's thread. Return to all comments →
Here are some hints
1) There is no way you are going to be able to build an actual string of most fibonacci words involved here.
2) The trick is to track where a and b are in each word in the sequence, and the total length of each word, without copying anything.
3) You can't avoid dealing with numbers that are higher than most built-in long int data types. I used javascript and wrote some simple functions to do arithmetic with integers in strings (i.e., '134534234345' instead of 134534234345).