© 2026 Hashnode
Imagine you've just created an algorithm, and it works lightning-fast on your brand-new computer. You're thrilled with the results and can't wait to share your success, so you ask your friend to give it a try. However, when your friend runs the same ...

Cyclic sort is an in-place and unstable sorting algorithm that is specifically designed to efficiently sort arrays where numbers are in a known range like from 1 to N. How does it work? Let’s take the following array as an example. We need to sort it...

After solving the “find maximum number in an array” problem yesterday, I didn’t want to jump into something new immediately. I wanted to stay with the same concept and really let it sink in. So today, I picked the opposite version of the same problem...

I'm starting my DSA journey, and honestly, I was looking for something simple enough that I wouldn't feel completely lost, but also something that would make me think a little. Finding the maximum number in an array seemed perfect—it's not scary, and...

LeetCode 961: N-Repeated Element in Size 2N Array is usually solved with a simple Hash Set (O(N) space) or randomized checks. But recently, I challenged myself to solve it deterministically using O(1) space. The result? A modified version of Moore’s ...
