Error:
unable to solve out. It need to inference a formula:
From the formula, we know that we can check if we already have S(i - 1) or not, then return the result in O(n)
update:
too many edge case:
- first need to initial m[0] = -1;
- if k == 0, we do not divide it, just look up it there any sum equal to 0.
- find the map first, and remember use else to insert, do not directly insert.