Take K of Each Character From Left and Right | Leetcode 2516