You are viewing a single comment's thread. Return to all comments →
Other way to look at this solution is :
Every number is going to be maximum at some point.
Now this number can only be maximum only for all numbers less that or equal to itself. (second for loop where j<=i)
We iterate through array using this fact and update all entries in precompute array whose factors are i and j.
Seems like cookies are disabled on this browser, please enable them to open this website
Down to Zero II
You are viewing a single comment's thread. Return to all comments →
Other way to look at this solution is :
Every number is going to be maximum at some point.
Now this number can only be maximum only for all numbers less that or equal to itself. (second for loop where j<=i)
We iterate through array using this fact and update all entries in precompute array whose factors are i and j.