v2 time O(k*n) space O(1) TLE!

this is v2. v1 was not saved. v1 has various compiling errors related to java details:

- forgot to import Iterator
- forgot to cast the returned value of iterator.next()
- used removeAt instead of remove (there is no removeAt in java List)