Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Because at that point of the algorithm 2 is the page that has been sitting inside the memory the longer, so that is the one to replace (so basically is at the front of the queue) and its position inside the memory is occupied by the new page
You are supposed to generate the values of the Fibonacci sequence up to
n
terms (heren=5
is the input).This means - starting at 1 -
[1,1,2,3,5]
.If you are having problems with this, you should read any resource on the Fibonacci sequence - for example:
Fibonacci number on wikipedia
Then you must consider the elements you obtained, and replace those that are divisible by
3
or by5
according to the other rules mentioned in the description.This comment is hidden because it contains spoiler information about the solution