solution to string cutting
new input case (big size)