DSA: DP, DFS

Intuition
There are 2**n subsequences in a list of size n. This is why backtracking algorithms (un-memoized DFS) are O(2**n) complexity

Implementation

 

Visual