Leetcode 3388. Count Beautiful Splits in an Array
Count the number of ways to split an array into three contiguous parts nums1, nums2, nums3 such that either nums1 is a prefix of nums2 or nums2 is a prefix of nums3. The core challenge is efficiently testing many subarray prefix-equality conditions (n ≤ 5000), often solved with string-like prefix comparisons or rolling hashes to avoid brute-force checks.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.