class Solution {
public String solution(String my_string, int[][] queries) {
char[] charArr_my_string = my_string.toCharArray();
char temp = ' ';
for(int[] query : queries){
int reverseLength = (query[1] - query[0] +1)/2;
int sttIdx = query[0];
int endIdx = query[1];
for(int i = 0; i < reverseLength; i++){
if(!(sttIdx > endIdx)){
temp = charArr_my_string[sttIdx];
charArr_my_string[sttIdx] = charArr_my_string[endIdx];
charArr_my_string[endIdx] = temp;
sttIdx ++;
endIdx --;
}
}
}
String answer = new String(charArr_my_string);
return answer;
}
}