Pregunta de entrevista de Tic Toc

First two supre easy then Binary search, Dynamic programming