Skip to content

Commit 79a414b

Browse files
committed
Added 0344-reverse-string.cs
1 parent 1f653e9 commit 79a414b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

csharp/0344-reverse-string.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
public class Solution
2+
{
3+
public void ReverseString(char[] s)
4+
{
5+
var h = s.Length / 2;
6+
for (int i = 0; i < h; i++)
7+
{
8+
var temp = s[i];
9+
s[i] = s[s.Length - i - 1];
10+
s[s.Length - i - 1] = temp;
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)