leetle

Daily challenge for 2025-12-12

346. Array Rotation Check

Given two integer arrays nums1 and nums2, return true if nums2 is a rotation of nums1, or false otherwise.

A rotation means shifting all elements by some positions, wrapping around.

Example:
Input: nums1 = [1,2,3,4,5], nums2 = [3,4,5,1,2]
Output: true

Explanation: nums2 is nums1 rotated left by 2 positions.

Run this challenge interactively in Python or JavaScript when the app loads.