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
Mar 25, 2026
Given a circular integer array nums, find the maximum possible sum of a non-empty subarray. A circular subarray can wrap around the end back to the beginning.
leetcodemediumdparraykadane
Mar 24, 2026
You are given a nested list of integers nestedList. Each element is either an integer or a list whose elements may also be integers or other lists. Implement an iterator...
leetcodemediumdesignstackiterator
Mar 22, 2026
There are n gas stations along a circular route. Station i has gas[i] units of gas. It costs cost[i] units to travel from station i to station i+1. Starting with...
leetcodemediumgreedyarray
Mar 21, 2026
Given an array of positive integers nums and an integer k, return the number of contiguous subarrays where the product of all elements is strictly less than k.
leetcodemediumsliding-windowtwo-pointers