This is my simple JAVA code


  • 0
    C

    This is my simple JAVA code with runtime 5ms

    public class Solution {
        public String reverseString(String s) {
            char s1[] = s.toCharArray();
            for(int i = 0 ; i < s1.length/2 ; i++){
                char t = s1[i];
                s1[i] = s1[s1.length-1-i];
                s1[s1.length-1-i] = t;
               
            }
            s = new String(s1); 
            return s;
        }
    }
    

  • 1
    M

    You must be kidding me!!!


  • 0
    J

    hahahahha, it is just a joke


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.