Problem 2501 · Medium

Longest Square Streak in an Array

Start from each value in a hash set and follow repeated squaring while the squares stay present; the longest chain of two or more wins.

Open the interactive visualisation