Created
December 15, 2022 23:30
-
-
Save abdulrahmanAlotaibi/2bee69214ee53a1e1bf82d2862b3eab6 to your computer and use it in GitHub Desktop.
Strings : Reverse String
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func reverseString(s []byte) { | |
for i, j:= 0, len(s)-1 ; i < j && i < len(s) ; i,j= i+1, j-1 { | |
s[i], s[j] = s[j], s[i] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment