319 challenges in the catalogue. Browse freely; sign in to open the editor and submit.
id is the primary key and an auto-increment column. Find all numbers that appear at least three times consecutively. Return the result table with the column name ConsecutiveNums. Return the result in any order. Input: Logs table: | id |…
Sign in to solveGiven the root of a binary tree, return the level order traversal of its nodes' values (i.e., from left to right, level by level). Example 1: Example 2: Example 3: The number of nodes in the tree is in the range [0, 2000]. -1000 <=…
Sign in to solveGiven an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0). The distance between two points on the X-Y plane is the Euclidean distance (i.e.,…
Sign in to solveGiven two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string "".…
Sign in to solveThere are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer array points where points[i] = [xstart, xend] denotes a balloon whose horizontal diameter stretches between…
Sign in to solveImplement a class FooBar with two methods foo and bar that are called from separate async contexts. They should alternate execution so that the output is "foobar" repeated n times. foo() prints "foo" and bar() prints "bar". They run…
Sign in to solveAssume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor g[i], which is the minimum size of a cookie that the child will be content…
Sign in to solveGiven a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-2^31, 2^31 - 1], then return 0. Assume the environment does not allow you to store 64-bit…
Sign in to solveDesign a high-performance API Gateway that acts as a single entry point for a microservices architecture. The gateway should handle core cross-cutting concerns such as authentication, rate limiting, request routing, and protocol…
Sign in to solveWrite a SQL query to find all dates' Id with higher temperatures compared to its previous dates (yesterday). Table: Weather | Column Name | Type | | :--- | :--- | | id | int | | recordDate | date | | temperature | int | id is the primary…
Sign in to solveGiven a string containing just the characters '(' and ')', return the length of the longest valid (well-formed) parentheses substring. Input: s = "(()" Output: 2 Explanation: The longest valid parentheses substring is "()". Input: s =…
Sign in to solveGiven an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an algorithm with O(log n) runtime…
Sign in to solve