Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 380 Bytes

344. Reverse String.md

File metadata and controls

17 lines (15 loc) · 380 Bytes

344. Reverse String

Reverse String - LeetCode

class Solution {
    public void reverseString(char[] s) {
        int length = s.length;
        for (int i = 0 , j = length-1 ; i < length/2  ; i++ , j--)
        {
            char temp = s[i];
            s[i] = s[j];
            s[j] = temp;
        }
    }
}