Skip to content

Commit 18692ea

Browse files
authored
Merge pull request neetcode-gh#3162 from DaltonVislisel/main
Added 0344-reverse-string.cs
2 parents ef31e10 + 79a414b commit 18692ea

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)