Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Check out longest common subsequence, it's a good introduction to dynamic programming
-
Also if you already have the recursion you can memoize the results of each call by storing the result of each call with the input parameters as the key (indexes into a 2d array in this case)
-
donuts236786y@beegC0de yes that's what I did... Maybe it's just a Java problem... Asked my CS BRO... solved in 10mins... In c++.
-
@billgates he may not have used recursive calls, you can solve it iteratively by working backwards from base cases
-
donuts236786y@beegC0de no he did but much simpler than what I did. I guess he just recognized the problem set and knew what the solution would like like although it feels like now Algorithmic coding is just like a different thing from application/OOP coding.
Low level primitives, arrays vs classes.
Related Rants
Is HackerRank a good site to prepare for technical interviews? And I guess the general question is how to best prepare?
The problems are interesting but it seems most of the Medium+ ones require knowledge of a specific approach or the large test cases will terminate with timeouts or out of memory.
Been sitting on this for a week. Just implemented the recursive versionwhich is better but now times out.
https://hackerrank.com/challenges/...
question