@@ -0,0 +1,629 @@
+package com.sunny.grokkingalgorithms.fasttrack.week8;%0A%0Aimport java.util.Arrays;%0A%0A/**%0A * Created by sundas on 7/31/2018.%0A */%0Apublic class ReverseString %7B%0A%0A  /**%0A   *%0A   * @param input%0A   * @return%0A   */%0A  public static char%5B%5D reverse(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%5Bj%5D;%0A      input%5Bj%5D = input%5Bi%5D;%0A      input%5Bi%5D = temp;%0A      i++;%0A      j--;%0A    %7D%0A    return input;%0A  %7D%0A%0A  /**%0A   *%0A   * @param args%0A   */%0A  public static void main(String%5B%5D args) %7B%0A    char%5B%5D input = new char%5B%5D%7B'a','b','c','d'%7D;%0A    System.out.println(Arrays.toString(reverse(input)));%0A  %7D%0A%0A%7D%0A

Reverse a string O(n)