👋 Welcome Gophers! In this challenge, you will be tasked with finding out how many rotations an ordered int
slice has undergone and shifted by.
Examples:
arr := []int{1, 2, 3, 4, 5}
MinRotations(arr) // returns 2
arr := []int{3, 4, 5, 1, 2}
MinRotations(arr) // returns 3
See the Solution
Feel free to have a look at the forum discussion thread for this challenge and contribute with your own solutions here - Challenge 18 - Minimum Rotations
Further Reading:
If you enjoyed this challenge, you may also enjoy some of the other challenges on this site: