This is a question about reversing a string : <p>Write a function that reverses a string. The input string is given as an array of characters char[].</p>

<p>Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.</p>

<p>You may assume all the characters consist of printable ascii characters.</p>

<p>Example 1:</p>

<p>Input: ["h","e","l","l","o"]
Output: ["o","l","l","e","h"]</p>

<pre><code>class Solution {
    public void reverseString(char[] s) {
        for(int i=0; i&lt;s.length/2; i++){
            for(int j=s.length-1; j&gt;i; j--){
               char temp = s[j];
                s[j] = s[i];
                s[i] = temp;

            }
        }
    }
}
</code></pre>

<p>Input: ["h","e","l","l","o"]</p>

<p>My output["e","l","o","h","l"]</p>

<p>expected: ["o","l","l","e","h"]</p>

<p>Can anyone tell where am I wrong.</p>
