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.
Same here. I have two problems about the editorial solution:
1) what is the "obvious" reason for coming up with dp[alpha][beta][theta] from dp[alpha][beta][gamma] ?
2) how is the recursion for dp[alpha][beta][theta] deducted? I tried multiple approach but could not arrive at the same recursion.
And the code itself is even more cryptic, it took me hours to figure out "how" it works but I still don't understand "why" it works.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Fair Cut
You are viewing a single comment's thread. Return to all comments →
Same here. I have two problems about the editorial solution: 1) what is the "obvious" reason for coming up with dp[alpha][beta][theta] from dp[alpha][beta][gamma] ? 2) how is the recursion for dp[alpha][beta][theta] deducted? I tried multiple approach but could not arrive at the same recursion.
And the code itself is even more cryptic, it took me hours to figure out "how" it works but I still don't understand "why" it works.