Last active
January 18, 2021 04:47
-
-
Save shuklaneerajdev/8f1244c0221473f96942c0d3371027f3 to your computer and use it in GitHub Desktop.
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
def reverse(input) | |
rev = "" | |
i = input.length-1 | |
while i>=0 do | |
rev = rev+input[i] | |
i=i-1 | |
end | |
puts rev | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment