word break issue, from geeksforgeeks