why is the complexity is o(n^2)?
abcd string and worst case.
i=1, ab, a
i=2, abc, bc, c
i=3, abcd, bcd, cd, d
and the total operation is 10 a lot less than n^2 (16 where n=4)
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.