Created
January 28, 2022 17:10
-
-
Save IAFahim/5b4fd3803a609ed59164dba9f50699f4 to your computer and use it in GitHub Desktop.
reverse byte form a-b
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 reverse(arr []byte, start, end int) { | |
for i, j := start, end-1; i < end/2; i, j = i+1, j-1 { | |
arr[i], arr[j] = arr[j], arr[i] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment