Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 735 Bytes

File metadata and controls

20 lines (14 loc) · 735 Bytes

Is One Array a Rotation of Another

Problem Description

Write a function that returns True if one array is a rotation of another. Example: [1, 2, 3, 4, 5, 6, 7] is a rotation of [4, 5, 6, 7, 1, 2, 3]. NOTE: There are no duplicates in each of these arrays. REMINDER: Use lists instead of arrays in Python for simplicity.

Solution

I've written an implementation that determines the solution in O(n) time complexity, where n is the number of elements in array 1.

Languages Implemented: