Tic Toc Interview Question

First two supre easy then Binary search, Dynamic programming