abhisek247767 / LeetCode2024-6Companies30Days

Make your first Pull Request on Hacktoberfest 2024. Don't forget to spread love and if you like give us a ⭐️
40 stars 64 forks source link

📃: Longest Square streak in array #163

Closed abhayjoshi201 closed 1 month ago

abhayjoshi201 commented 1 month ago

🟢 Title: Longest Square Streak in Array 🟢 Programming Language: C++ 🟢 Objective: To find the length of the longest square streak in an array. A square streak is defined as a subsequence where each element (after sorting) is the square of the previous element, and the length of the subsequence is at least 2. If no such streak exists, return -1.

🟢 Summary: This solution finds the longest square streak by utilizing a bitset for fast lookups. The algorithm iterates over each element, checking if subsequent squares are present. It updates the maximum streak length if a longer one is found and returns -1 if no valid streak exists.

✅ Details to Include When Taking the Issue: Name: Abhay Joshi

github-actions[bot] commented 1 month ago

👋 Thanks for opening this issue! First please star the repository and follow me in github. We appreciate your feedback and will look into it as soon as possible.

abhayjoshi201 commented 1 month ago

Done!

github-actions[bot] commented 1 month ago

Hello @abhayjoshi201! Your issue #163 has been successfully closed. ✅ Thank you for your contribution and helping us improve the project! If you have any more ideas or run into other issues, feel free to open a new one. Happy coding! 🚀