class Solution {
public void swap(char[] charArray, int i, int j) {
char temp = charArray[i];
charArray[i] = charArray[j];
charArray[j] = temp;
}
public String reverseLeftWords(String s, int n) {
char[] charArray = s.toCharArray();
for (int i = 0, j = charArray.length - 1; i < j; i++, j--) swap(charArray, i, j);
for (int i = 0, j = charArray.length - n - 1; i < j; i++, j--) swap(charArray, i, j);
for (int i = charArray.length - n, j = charArray.length - 1; i < j; i++, j--) swap(charArray, i, j);
return String.valueOf(charArray);
}
}