Loading...
A growing set of coding problems solved locally with tests, then published as concise markdown explanations.
All · 21 problems
5 min read
Given an integer array, return all unique triplets where the three values sum to zero.
3 min read
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.
9 min read
Design a frequency tracker with constant-time increments, decrements, and minimum or maximum key lookup.
2 min read
Given an integer array nums, return true if any value appears at least twice, and false if all elements are distinct.
3 min read
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.
2 min read
Given a string s, return the index of the first non-repeating character, or -1 if none exists.
4 min read
Given an array of strings, group all anagrams together and return the groups in any order.
4 min read
Given a string of words and spaces, return the length of the last word.
3 min read
Given an array of strings, return the longest common prefix shared by all strings.
9 min read
Design a fixed-capacity cache with constant-time reads and writes that evicts the least recently used key once it runs out of room.
3 min read
Return each position's product of every other array value in linear time without division.
3 min read
Use a stack to collect characters; each star pops the most recent one. Join the stack at the end to get the result.