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.
I’m working on the Borrowing Money challenge and I’m unsure about the right modeling. Is this solvable with a greedy strategy, or do we need DP / binary search over an answer? The tricky parts for me are precision (floats vs integers), large input sizes, and edge cases like zero-interest periods or ties where borrowing now vs later costs the same. Any hints on structuring the state and avoiding precision traps would be appreciated.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Demanding Money
You are viewing a single comment's thread. Return to all comments →
I’m working on the Borrowing Money challenge and I’m unsure about the right modeling. Is this solvable with a greedy strategy, or do we need DP / binary search over an answer? The tricky parts for me are precision (floats vs integers), large input sizes, and edge cases like zero-interest periods or ties where borrowing now vs later costs the same. Any hints on structuring the state and avoiding precision traps would be appreciated.