Can Construct with Tabulation
Updated: 01 February 2024
Problem
The same problem as the Can Construct Memoization Problem but implemented using the tabular style in the previous problems
In this case, we will store an index for each letter and the value of whether or not it is possible to start a substring from that position - if it is possible then we will go to the end of ths substring and mark that position as false
Tabulation Implementation
The implementation of this can be seen below:
In the above, the time complexity and space complexity
The reason we say and not in the time complexity is because of the array copy operation that we do to assign the latest value