Available question text
Find the maximum length (≥2) subsequence of nums whose elements, when sorted, form a chain a, a^2, a^4, ... (each element is the square of the previous); return -1 if no such subsequence exists. The challenge is to match values to their squared successors while respecting original index order efficiently for n up to 1e5.
Related questions
Continue with questions that share topics or the same question type.
- Longest Mountain in Array
Coding · Array · Dynamic Programming · Enumeration
- Longest Team Pass Streak
Coding
- Longest Winning Streak
Coding
- A Graph question, a string question, a couple of array questions.
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2501. Longest Square Streak in an Array
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source