import java.util.*; public class Solution { /** * 反转字符串 * @param str string字符串 * @return string字符串 */ public String solve (String str) { // write code here if(str == null) return null; char[] c = str.toCharArray(); for(int i = 0, j = c.length - 1; i < j; ++i,--j){ char temp = c[i]; c[i] = c[j]; c[j] = temp; } return new String(c); } }