A clean abstract illustration of a tree-like branching structure with connected nodes, rendered in deep indigo and soft blue tones

Problem Solving

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.

Featured Problems

A selection of LeetCode problems with detailed solutions published on hello ML.

Average Waiting Time

Published June 10, 2021

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.

Find the Duplicate Number

Published 2021

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.

Longest Substring Without Repeating Characters

Published 2021

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 Stack — Cracking the Coding Interview

Published 2021

Sort a stack using only one additional temporary stack. The article details the insertion-sort–style strategy with step-by-step stack-state diagrams.

Check if an Array is Strictly Increasing or Strictly Decreasing

Published 2021

A straightforward linear-scan problem from BinarySearch.com. The solution checks monotonicity in a single pass with early termination on violation.

Find the Index with Equal Left and Right Sum

Published 2021

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.

Abstract visualization of data points and error margins on a dark gradient background with soft blue and purple tones
Problem solving is about pattern recognition — each challenge builds intuition for the next.

Related Topics

Problem solving draws heavily on a solid foundation in data structures and algorithms. Explore these companion sections for deeper coverage.

  • Algorithms — sorting, searching, and complexity analysis.
  • Data Structures — binary search trees, queues, linked lists, and more.

Keep Practicing

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 Home

hello ML publishes free articles. We do not sell courses.