We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Search
- Sherlock and Array
- Discussions
Sherlock and Array
Sherlock and Array
Sort by
recency
|
965 Discussions
|
Please Login in order to post a comment
Here is my c++ solution, you can watch the explanation here : https://youtu.be/-kwepBHt_jM
My Java solution with O(n) time complexity and O(1) space complexity:
Linear scan
Perl solution:
Java: