Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
cogom
Could you explain the time complexity further?

cogom

Sep 3, 2023

Could you please explain further why it is O(N^2) time complexity when we use memoization? Thank you!

0

0

Comments
Comments
Shubham Vora
Shubham Voraa year ago

Memoization

With memoization, we store the results of subproblems in a map (map in the code) to avoid redundant computations. This ensures that each subproblem is solved only once.

Time Complexity Analysis

  1. Number of Subproblems:

The function `countT...

On this page