@@ -0,0 +1,670 @@
+package com.sunny.grokkingalgorithms.boot2019.phleps;%0A%0Apublic class ReverseAString %7B%0A%0A    public static char%5B%5D reverseString(char%5B%5D input)%7B%0A        int i = 0;%0A        int j = input.length - 1;%0A        while(i %3C j)%7B%0A            char temp = input%5Bi%5D;%0A            input%5Bi%5D = input%5Bj%5D;%0A            input%5Bj%5D = temp;%0A            i++;%0A            j--;%0A        %7D%0A        return input;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        char%5B%5D input = new char%5B%5D%7B's','u','n','n','y'%7D;%0A        System.out.println(String.valueOf(reverseString(input)));%0A        input = new char%5B%5D%7B's','u','n','n'%7D;%0A        System.out.println(String.valueOf(reverseString(input)));%0A    %7D%0A%7D%0A

Reverse a string inplace O(n).