Skip to content

Instantly share code, notes, and snippets.

@gcasa
Created May 6, 2019 17:52
Show Gist options
  • Save gcasa/61cd810d8fdcba621c52a67d624373a1 to your computer and use it in GitHub Desktop.
Save gcasa/61cd810d8fdcba621c52a67d624373a1 to your computer and use it in GitHub Desktop.
# you can write to stdout for debugging purposes, e.g.
# puts "this is a debug message"
def solution(a, k)
# write your code in Ruby 2.2
r = a.reverse
rot = r.rotate(k)
result = rot.reverse
result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment