String
Last updated
Was this helpful?
Last updated
Was this helpful?
substring()
is O(n)
key: 1) no need 2d table 2) 2 rounds: 1st round, aba; 2nd round, abba
map char:counts
lookup words from string in dict:
lookup words from dict in string:
toCharArray(), 2 pointers
trick: 1.reverse whole array -> 2. reverse partial array
+ - * /
operationsKey points: carry
curr % 10
curr / 10
Start from right end plus max length max(len1, len2) + 1
, multiply max length len1 + len2
stack iterative and recursion thing in a parenthesis is a new recursion
need 2d table key: 2 pointers
map+set