题解 | #反转字符串#
反转字符串
http://www.nowcoder.com/practice/c3a6afee325e472386a1c4eb1ef987f3
/**
字符串装字符数组处理,双指针交换两指针的值
public static String solve (String str) {
// write code here
char[] chars = str.toCharArray();
int l=0;
int r=chars.length-1;
while (l<r){
char temp=' ';
temp=chars[r];
chars[r]=chars[l];
chars[l]=temp;
l++;r--;
}
return new String(chars);
}

