Cure.Fit interview question

They asked me Word Break II problem(Round3- HM round)

Interview Answer

Anonymous

30 Sept 2022

At first I told the backtracking approach for the problem, whose time complexity was exponential. Then the interviewer asked me if it was possible to reduce the time complexity. Then I memoized my approach as there were lot of recurring subproblems and explained how it will give a much lesser time complexity of O(n^2).