educative.io

A naive solution to this problem is to calculate the sum of all possible subsequences with no adjacent elements and keep track of the subsequence with the maximum sum. The time complexity of this approach is O(n^2)

Complexity of naive solution is O(2^n) not O(n^2).

“A naive solution to this problem is to calculate the sum of all possible subsequences with no adjacent elements and keep track of the subsequence with the maximum sum. The time complexity of this approach is O(n^2).”

Hey, can you point out the lesson you are referring to?
Thanks