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.
That's rather sloppy of them. The greedy algorithm fails on e.g. making 84 from [2, 3, 7, 12, 14], since the optimal factorization is 7*12 which you can't find if you start by selecting 14; you'd think they'd include some such tests.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
K Factorization
You are viewing a single comment's thread. Return to all comments →
That's rather sloppy of them. The greedy algorithm fails on e.g. making 84 from [2, 3, 7, 12, 14], since the optimal factorization is 7*12 which you can't find if you start by selecting 14; you'd think they'd include some such tests.