Loading...
A growing set of coding problems solved locally with tests, then published as concise markdown explanations.
June 27, 2026
Use a stack to collect characters; each star pops the most recent one. Join the stack at the end to get the result.
May 29, 2026
Given an elevation map of unit-width bars, compute how much rain water is trapped between them.
May 23, 2026
A class that builds strings efficiently by accumulating chunks in an array and joining once. Avoids the O(n²) cost of repeated string concatenation in a loop.
May 14, 2026
Given an integer array, return all unique triplets where the three values sum to zero.
March 13, 2026
Given an array of strings, group all anagrams together and return the groups in any order.
March 11, 2026
Scan the Roman numeral string and subtract a symbol's value when it precedes a larger one, otherwise add it.
March 10, 2026
Given two binary strings, return their sum as a binary string. We use BigInt for correct arbitrary-precision arithmetic instead of a manual carry simulation.
March 7, 2026
Given a string of words and spaces, return the length of the last word.
March 7, 2026
Use a stack of opening brackets and match each closing bracket against the most recent unmatched opener.
March 3, 2026
Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 when needle is not part of haystack.
March 2, 2026
Given an array of strings, return the longest common prefix shared by all strings.
February 28, 2026
Given a string s, return the index of the first non-repeating character, or -1 if none exists.
February 27, 2026
Write a function that reverses a string represented as an array of characters in-place with O(1) extra space.
February 27, 2026
Given a string s, return true if it is a palindrome after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters.
February 26, 2026
Given an integer array nums, return true if any value appears at least twice, and false if all elements are distinct.
February 26, 2026
Given two strings s and t, return true if t is an anagram of s, and false otherwise.
February 25, 2026
Given an array of integers and a target, return the indices of two numbers that add up to the target.