vakilsearch interview question

rotate an array k times