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.
Good clean solution, very similar to what I did, but I didn't introduce a new important variable and just directly decremented k instead and checked if k was greater than 0 instead of important < k.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Luck Balance
You are viewing a single comment's thread. Return to all comments →
Good clean solution, very similar to what I did, but I didn't introduce a new important variable and just directly decremented k instead and checked if k was greater than 0 instead of important < k.