You are viewing a single comment's thread. Return to all comments →
Pretty smart, but are you sure you are not copying the kth eleement, in ruby it would be:
def array_left_rotation(a, k)
a[k..-1] + a[0...k]
In ruby, ... means excluding the right number.