Simple C# SOLUTION


  • 0
    P
                                 public class Solution {
                                      public string ReverseString(string s) {
        
                                             char[] ar = s.ToCharArray();
                                             int j = 0;
                                            for(int i=s.Length-1;i>=0;i--)
                                           {
                                                   ar[j] = s[i];
                                                       j++;
                                           }
                                             return new string(ar);
                                         }
                                    }

Log in to reply
 

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