Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- array = []
- input = $stdin.gets.chomp
- letters = input.split('') #=> array ['w'...]
- # count = 0
- # index = 0
- # while count < letters.size
- # count += 1
- # index -= 1
- # array << letters[index]
- # end
- letters.each {|item| array.unshift(item)}
- puts array.join
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement