Created
December 16, 2022 08:05
-
-
Save Piyush-Chaudhary/9083302c1addcf42b35ea59bd15f2265 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 rev_str(a) | |
rev = '' | |
for i in 1..a.length | |
puts a[i] | |
rev += a[a.length - i] | |
end | |
puts rev | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment