nums.squareStreak to store the streak lengths.best to keep track of the longest streak.x, calculate its square root.
b. If the square root is a perfect square and exists in squareStreak, update the streak length for x in the HashMap.
c. Update best with the maximum streak length found so far.best if it's greater than 1, otherwise return -1.