From fd82c6c8ec2d1287a4b579d18f6e242c1ebba56b Mon Sep 17 00:00:00 2001 From: William Sirotkin <87153798+williamsirotkin@users.noreply.github.com> Date: Tue, 25 Jan 2022 18:09:25 -0500 Subject: [PATCH 1/2] csip-fork --- csip-fork | 1 + 1 file changed, 1 insertion(+) create mode 100644 csip-fork diff --git a/csip-fork b/csip-fork new file mode 100644 index 0000000..4938c28 --- /dev/null +++ b/csip-fork @@ -0,0 +1 @@ +william sirotkin From 3561a5435b68f8f3d606890e26bac5654cd842fa Mon Sep 17 00:00:00 2001 From: William Sirotkin <87153798+williamsirotkin@users.noreply.github.com> Date: Tue, 25 Jan 2022 18:19:58 -0500 Subject: [PATCH 2/2] Create reverse-string-william-sirotkin --- reverse-string-william-sirotkin | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 reverse-string-william-sirotkin diff --git a/reverse-string-william-sirotkin b/reverse-string-william-sirotkin new file mode 100644 index 0000000..c9b236e --- /dev/null +++ b/reverse-string-william-sirotkin @@ -0,0 +1,12 @@ +class Solution { + public void reverseString(char[] s) { + char placeHolder = 'a'; + int swapsLeft = s.length / 2; + + for (int i = 0; i < swapsLeft; i++) { + placeHolder = s[i]; + s[i] = s[s.length - i - 1]; + s[s.length - i - 1] = placeHolder; + } // for + } +}