@user2967 nice idea
Posts made by elastico
RE: Design a Data Structure that supports get(int idx), set(int idx, int val), and setAll(int val) all in constant time.
@new2500 setAll is technically still O(n), this just transfers the work to garbage collector
RE: Remove Substring Recursively
@Dexter7620 Similar to this problem :https://leetcode.com/problems/remove-boxes/description/
Let dp[p][len][i] = the number of times we can remove t from a string W that is the concatenation of length p prefix of t and the substring of s of length len starting at i.
Actually the complexity is O(S^3T)