Reverse

#344 Reverse String
Given a string, reverse it.
Use two pointers - low and high.

1
2
3
4
while(low < hight){
swap low and high;
low++ and high--;
}

My code


#151 Reverse Words in a String
Given a string, reverse the string word by word.
Pretty like the above one, before swaping, first we make String -> Char Array.
My code