Beats 100%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(n.logn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int longestSquareStreak(vector<int>& n) {\n        sort(n.begin(),n.end());\n        int a=0;\n        for(int i=0; i<n.size();++i){\n            long long c=1,sqr=n[i];\n            while(binary_search(n.begin(),n.end(),sqr*sqr*1LL)){\n                ++c;\n                sqr=sqr*sqr;\n            }\n            if(c>1)a=max(c,a*1LL);\n            \n        }\n        if(a==0)a=-1;\n        return a;\n    }\n};\n```
['Binary Search', 'Sorting', 'C++']