I got these questions in a Hackerrank assessment for a CA based company. Wasn't practicing leetcode at the time, so failed both of them.



First question seems like standard DP, something I should've been able to do. The second one seems like a graph problem? I still don't understand, would love some help solving it.