Apr 2, 2026
Given an m x n integer matrix, if an element is 0, set its entire row and column to 0. You must do it in place.
leetcodemediummatrixarray
Apr 1, 2026
Given n nodes labeled 0 to n-1 and a list of undirected edges, determine if these edges form a valid tree.
leetcodemediumgraphdsudfs
Mar 31, 2026
Given an integer array nums where exactly two elements appear once and all other elements appear exactly twice, find the two elements that appear only once. Return them in any...
leetcodemediumbit-manipulation
Mar 30, 2026
You are given n train rides with distances dist[i]. Each train departs at an integer hour, so you must wait until the next whole hour to board the next train...
leetcodemediumbinary-search
Mar 29, 2026
Implement a thread-safe bounded blocking queue with the following methods: BoundedBlockingQueue(int capacity) – initialize with max capacity void enqueue(int element) – add element to the back; blocks if the queue...
leetcodemediumconcurrencydesign
Mar 28, 2026
Two different threads will call foo and bar respectively. Design a mechanism so that "foobar" is printed n times by alternating between the two threads: foo always prints first, then...
leetcodemediumconcurrency
Mar 27, 2026
Given an input string s, reverse the order of the words. A word is a sequence of non-space characters. Words are separated by at least one space. Return a string...
leetcodemediumstringtwo-pointers
Mar 27, 2026
You are given two strings s and t. String t is generated by randomly shuffling s and then adding one more letter at a random position. Return the letter that...
leetcodeeasybit-manipulationstring
Mar 27, 2026
Given two strings word1 and word2, merge them by adding letters in alternating order, starting with word1. If one string is longer, append the remaining letters at the end.
leetcodeeasystringtwo-pointers
Mar 26, 2026
Given a string s representing a list of words, where each letter can be replaced by a group of letters inside braces {a,b,c}, return all possible words in sorted order....
leetcodemediumbacktrackingstring