Given two sequences of celestial body identifications, determine if they can be made identical by rotating one of the sequences. If possible, find the minimum number of rotations required to make them identical.
Explanation: Step-by-step: Given two sequences [1, 2, 3, 4, 5, 0] and [1, 2, 3, 4, 0], we can rotate the second sequence by one position to the right to make it identical to the first sequence. Therefore, the minimum number of rotations required is 1.
Explanation: Step-by-step: Given two sequences [1, 1, 2, 2, 3, 3] and [1, 2, 3, 2, 1, 3], we can rotate the second sequence by two positions to the right to make it identical to the first sequence. Therefore, the minimum number of rotations required is 2.
Master coding challenges related to Arrays and solve the [Backup] Galactic Vessel Alignment problem optimally.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak