Average Waiting Time
A simulation-based problem that asks for the average waiting time given a list of customer arrival and preparation times. The solution walks through the cumulative time-tracking approach with a clean iterative implementation.
Step-by-step solutions to coding problems from platforms like LeetCode, with explanations and code in multiple languages.
This section is dedicated to breaking down coding challenges — primarily from LeetCode — into clear, methodical solutions. Each article walks through the problem statement, the reasoning behind the approach, and a complete implementation. Solutions are provided in Java and C++, making them accessible to readers comfortable with either language.
Whether you are preparing for technical interviews or sharpening your algorithmic thinking, these write-ups emphasize understanding over memorization. Topics span array manipulation, string processing, hashing, and more.
A selection of LeetCode problems with detailed solutions published on hello ML.
A simulation-based problem that asks for the average waiting time given a list of customer arrival and preparation times. The solution walks through the cumulative time-tracking approach with a clean iterative implementation.
Given an array of n + 1 integers where each value is between 1 and n, find the single duplicate. The article covers the Floyd's cycle-detection (tortoise and hare) approach alongside a binary-search alternative.
A classic sliding-window problem. The solution explains how to maintain a dynamic window of unique characters using a hash set or character-index map, achieving O(n) time complexity.
Sort a stack using only one additional temporary stack. The article details the insertion-sort–style strategy with step-by-step stack-state diagrams.
A straightforward linear-scan problem from BinarySearch.com. The solution checks monotonicity in a single pass with early termination on violation.
Also known as the pivot-index problem. The article explains the prefix-sum technique to find the equilibrium point in O(n) time with O(1) extra space.
Problem solving draws heavily on a solid foundation in data structures and algorithms. Explore these companion sections for deeper coverage.
Consistent practice is the most reliable way to improve at coding interviews and competitive programming. Browse the full collection of articles on hello ML.
Back to Homehello ML publishes free articles. We do not sell courses.