← All problemsSign in

3411. Maximum Subarray With Equal Products

LeetCodeArrayMathSliding WindowEnumerationNumber TheoryOpen on judge ↗

You are given an array of positive integers nums. An array arr is called product equivalent if prod(arr) == lcm(arr) * gcd(arr), where: - prod(arr) is the product of all elements of arr. - gcd(arr) is the GCD of all elements of arr. - lcm(arr) is the LCM of all elements of arr. Return the length of the longest product equivalent subarray of nums. Example 1: Input: nums = [1,2,1,2,1,1,1]

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start