319 challenges in the catalogue. Browse freely; sign in to open the editor and submit.
Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. Example 1: Example 2: Example 3: 1 <= nums.length <= 10^5 -10^9 <= nums[i] <= 10^9
Sign in to solveWrite a SQL query to find employees who have the highest salary in each of the departments. Return the result table with columns Department, Employee, and Salary in any order. If multiple employees have the same highest salary in a…
Sign in to solveImplement a simplified version of React's useEffect hook. Your implementation should: Run the effect callback after each render when dependencies change Support cleanup functions returned by the effect Handle three dependency modes: no…
Sign in to solveGiven a binary tree, determine if it is height-balanced. A height-balanced binary tree is a binary tree in which the depth of the two subtrees of every node never differs by more than one. Example 1: Example 2: Example 3: The number of…
Sign in to solveImplement a promiseAll function that behaves like Promise.all. It takes an array of promises (or plain values) and returns a single promise that: Resolves with an array of results when ALL input promises resolve, maintaining the original…
Sign in to solveGiven a string columnTitle that represents the column title as it appears in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 Input: columnTitle = "A" Output: 1 Input:…
Sign in to solveGiven an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where: '.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entire…
Sign in to solveYou are given an m x n integer matrix matrix with the following two properties: Each row is sorted in non-decreasing order. The first integer of each row is greater than the last integer of the previous row. Given an integer target, return…
Sign in to solveGiven an array of intervals intervals where intervals[i] = [start_i, end_i], return the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping. Example 1: Example 2: Example 3: 1 <=…
Sign in to solveYou are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions…
Sign in to solveGiven two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1: Example 2: Example 3: nums1.length == m nums2.length == n…
Sign in to solveImplement a deepClone function that creates a deep copy of a given value. The cloned value must have no shared references with the original — modifying the clone should never affect the original. Your implementation should handle:…
Sign in to solve