question_id int64 1 3.24k | task_id stringlengths 3 77 | difficulty stringclasses 3
values | problem_description stringlengths 193 3.69k | canonical_tests dict | public_tests listlengths 1 5 | hints listlengths 0 8 | metadata dict | language stringclasses 9
values | interface dict |
|---|---|---|---|---|---|---|---|---|---|
844 | backspace-string-compare | Easy | Given two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace character.
Note that after backspacing an empty text, the text will continue empty.
Example 1:
Input: s = "ab#c", t = "ad#c"
Output: true
Explanation: Both s and t become "ac".
Example 2:
Inp... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(s = \"#a#c\",t = \"c\") == True\n assert candidate(s = \"xywrrmp\",t = \"xywrrmu#p\") == True\n assert candidate(s = \"bbbextm#w\",t = \"bb#bbbextm#w\") == False\n assert candidate(s = \"ab\",t = \"a#b\") == False\n assert ca... | [
"\"ab#c\"\n\"ad#c\"",
"\"ab##\"\n\"c#d#\"",
"\"a#c\"\n\"b\""
] | [] | {
"canonical_parameter_names": [
"s",
"t"
],
"leetcode_dataset_entry_point": "Solution().backspaceCompare",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:01:41",
"tests_total": 109,
... | typescript | {
"raw_signature": "function backspaceCompare(s: string, t: string): boolean {",
"container": null,
"callable": "backspaceCompare",
"parameters": [
{
"name": "s",
"type": "string"
},
{
"name": "t",
"type": "string"
}
],
"return_type": "boolean",
"signature_source": ... |
845 | longest-mountain-in-array | Medium | You may recall that an array arr is a mountain array if and only if:
- arr.length >= 3
- There exists some index i (0-indexed) with 0 < i < arr.length - 1 such that:
- arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
- arr[i] > arr[i + 1] > ... > arr[arr.length - 1]
Given an integer array arr, return the length of the... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) == 11\n assert candidate(arr = [0, 1, 0, 2, 1, 0, 1, 3, 2, 1]) == 5\n assert candidate(arr = [5, 4, 3, 2, 1]) == 0\n assert candidate(arr = [1, 3, 1, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5]) == 11\... | [
"[2,1,4,7,3,2,5]",
"[2,2,2]"
] | [] | {
"canonical_parameter_names": [
"arr"
],
"leetcode_dataset_entry_point": "Solution().longestMountain",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:01:43",
"tests_total": 160,
"tests_... | typescript | {
"raw_signature": "function longestMountain(arr: number[]): number {",
"container": null,
"callable": "longestMountain",
"parameters": [
{
"name": "arr",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippe... |
846 | hand-of-straights | Medium | Alice has some number of cards and she wants to rearrange the cards into groups so that each group is of size groupSize, and consists of groupSize consecutive cards.
Given an integer array hand where hand[i] is the value written on the i^th card and an integer groupSize, return true if she can rearrange the cards, or ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(hand = [1, 2, 3, 4, 5, 6],groupSize = 2) == True\n assert candidate(hand = [1, 1, 2, 2, 3, 3],groupSize = 3) == True\n assert candidate(hand = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],groupSize = 4) == True\n assert candidate(han... | [
"[1,2,3,6,2,3,4,7,8]\n3",
"[1,2,3,4,5]\n4"
] | [] | {
"canonical_parameter_names": [
"hand",
"groupSize"
],
"leetcode_dataset_entry_point": "Solution().isNStraightHand",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:01:46",
"tests_tota... | typescript | {
"raw_signature": "function isNStraightHand(hand: number[], groupSize: number): boolean {",
"container": null,
"callable": "isNStraightHand",
"parameters": [
{
"name": "hand",
"type": "number[]"
},
{
"name": "groupSize",
"type": "number"
}
],
"return_type": "boolean"... |
847 | shortest-path-visiting-all-nodes | Hard | You have an undirected, connected graph of n nodes labeled from 0 to n - 1. You are given an array graph where graph[i] is a list of all the nodes connected with node i by an edge.
Return the length of the shortest path that visits every node. You may start and stop at any node, you may revisit nodes multiple times, a... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(graph = [[1, 2], [0, 2, 3], [0, 1], [1]]) == 3\n assert candidate(graph = [[2, 3, 4, 5], [3, 4, 5, 6], [0, 3, 4, 5], [0, 1, 2, 5], [0, 1, 2], [0, 1, 2, 3], [1]]) == 6\n assert candidate(graph = [[1, 3, 4, 5], [0, 2, 3, 4, 5], [1, 3... | [
"[[1,2,3],[0],[0],[0]]",
"[[1],[0,2,4],[1,3,4],[2],[1,2]]"
] | [] | {
"canonical_parameter_names": [
"graph"
],
"leetcode_dataset_entry_point": "Solution().shortestPathLength",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:01:48",
"tests_total": 63,
"te... | typescript | {
"raw_signature": "function shortestPathLength(graph: number[][]): number {",
"container": null,
"callable": "shortestPathLength",
"parameters": [
{
"name": "graph",
"type": "number[][]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetc... |
848 | shifting-letters | Medium | You are given a string s of lowercase English letters and an integer array shifts of the same length.
Call the shift() of a letter, the next letter in the alphabet, (wrapping around so that 'z' becomes 'a').
- For example, shift('a') = 'b', shift('t') = 'u', and shift('z') = 'a'.
Now for each shifts[i] = x, we want ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(s = \"aaa\",shifts = [1, 2, 3]) == \"gfd\"\n assert candidate(s = \"abc\",shifts = [26, 52, 78]) == \"abc\"\n assert candidate(s = \"a\",shifts = [25]) == \"z\"\n assert candidate(s = \"abcdef\",shifts = [0, 0, 0, 0, 0, 0]) == \... | [
"\"abc\"\n[3,5,9]",
"\"aaa\"\n[1,2,3]"
] | [] | {
"canonical_parameter_names": [
"s",
"shifts"
],
"leetcode_dataset_entry_point": "Solution().shiftingLetters",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:01:50",
"tests_total": 88... | typescript | {
"raw_signature": "function shiftingLetters(s: string, shifts: number[]): string {",
"container": null,
"callable": "shiftingLetters",
"parameters": [
{
"name": "s",
"type": "string"
},
{
"name": "shifts",
"type": "number[]"
}
],
"return_type": "string",
"signature... |
849 | maximize-distance-to-closest-person | Medium | You are given an array representing a row of seats where seats[i] = 1 represents a person sitting in the i^th seat, and seats[i] = 0 represents that the i^th seat is empty (0-indexed).
There is at least one empty seat, and at least one person sitting.
Alex wants to sit in the seat such that the distance between him a... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(seats = [0, 0, 0, 1, 0, 1, 0, 0, 0]) == 3\n assert candidate(seats = [0, 0, 1, 0, 0, 0, 0, 1]) == 2\n assert candidate(seats = [0, 0, 0, 1, 0, 0, 0]) == 3\n assert candidate(seats = [1, 0, 0, 0]) == 3\n assert candidate(seats... | [
"[1,0,0,0,1,0,1]",
"[1,0,0,0]",
"[0,1]"
] | [] | {
"canonical_parameter_names": [
"seats"
],
"leetcode_dataset_entry_point": "Solution().maxDistToClosest",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:01:52",
"tests_total": 120,
"tes... | typescript | {
"raw_signature": "function maxDistToClosest(seats: number[]): number {",
"container": null,
"callable": "maxDistToClosest",
"parameters": [
{
"name": "seats",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/code... |
850 | rectangle-area-ii | Hard | You are given a 2D array of axis-aligned rectangles. Each rectangle[i] = [x_i1, y_i1, x_i2, y_i2] denotes the i^th rectangle where (x_i1, y_i1) are the coordinates of the bottom-left corner, and (x_i2, y_i2) are the coordinates of the top-right corner.
Calculate the total area covered by all rectangles in the plane. A... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(rectangles = [[0, 0, 1, 1], [1, 1, 2, 2], [2, 2, 3, 3]]) == 3\n assert candidate(rectangles = [[0, 0, 1, 10], [0, 0, 10, 1], [1, 1, 2, 11], [1, 1, 11, 2]]) == 38\n assert candidate(rectangles = [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3... | [
"[[0,0,2,2],[1,0,2,3],[1,0,3,1]]",
"[[0,0,1000000000,1000000000]]"
] | [] | {
"canonical_parameter_names": [
"rectangles"
],
"leetcode_dataset_entry_point": "Solution().rectangleArea",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:01:54",
"tests_total": 105,
"t... | typescript | {
"raw_signature": "function rectangleArea(rectangles: number[][]): number {",
"container": null,
"callable": "rectangleArea",
"parameters": [
{
"name": "rectangles",
"type": "number[][]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetc... |
851 | loud-and-rich | Medium | There is a group of n people labeled from 0 to n - 1 where each person has a different amount of money and a different level of quietness.
You are given an array richer where richer[i] = [a_i, b_i] indicates that a_i has more money than b_i and an integer array quiet where quiet[i] is the quietness of the i^th person.... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(richer = [],quiet = [0]) == [0]\n assert candidate(richer = [[4, 3], [3, 2], [2, 1], [1, 0]],quiet = [4, 3, 2, 1, 0]) == [4, 4, 4, 4, 4]\n assert candidate(richer = [[1, 0], [2, 0], [3, 0]],quiet = [3, 2, 1, 0]) == [3, 1, 2, 3]\n ... | [
"[[1,0],[2,1],[3,1],[3,7],[4,3],[5,3],[6,3]]\n[3,2,5,4,6,1,7,0]",
"[]\n[0]"
] | [] | {
"canonical_parameter_names": [
"richer",
"quiet"
],
"leetcode_dataset_entry_point": "Solution().loudAndRich",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:01:57",
"tests_total": 10... | typescript | {
"raw_signature": "function loudAndRich(richer: number[][], quiet: number[]): number[] {",
"container": null,
"callable": "loudAndRich",
"parameters": [
{
"name": "richer",
"type": "number[][]"
},
{
"name": "quiet",
"type": "number[]"
}
],
"return_type": "number[]",
... |
852 | peak-index-in-a-mountain-array | Medium | You are given an integer mountain array arr of length n where the values increase to a peak element and then decrease.
Return the index of the peak element.
Your task is to solve it in O(log(n)) time complexity.
Example 1:
Input: arr = [0,1,0]
Output: 1
Example 2:
Input: arr = [0,2,1,0]
Output: 1
Example 3:
Inp... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(arr = [1, 3, 5, 4, 2]) == 2\n assert candidate(arr = [0, 1, 2, 3, 4, 5, 3, 1]) == 5\n assert candidate(arr = [0, 2, 1, 0]) == 1\n assert candidate(arr = [0, 10, 5, 2]) == 1\n assert candidate(arr = [1, 2, 3, 4, 5, 3, 1]) == 4... | [
"[0,1,0]",
"[0,2,1,0]",
"[0,10,5,2]"
] | [] | {
"canonical_parameter_names": [
"arr"
],
"leetcode_dataset_entry_point": "Solution().peakIndexInMountainArray",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:01:59",
"tests_total": 87,
... | typescript | {
"raw_signature": "function peakIndexInMountainArray(arr: number[]): number {",
"container": null,
"callable": "peakIndexInMountainArray",
"parameters": [
{
"name": "arr",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "l... |
853 | car-fleet | Medium | There are n cars at given miles away from the starting mile 0, traveling to reach the mile target.
You are given two integer arrays position and speed, both of length n, where position[i] is the starting mile of the i^th car and speed[i] is the speed of the i^th car in miles per hour.
A car cannot pass another car, b... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(target = 1000,position = [100, 200, 300],speed = [100, 50, 25]) == 1\n assert candidate(target = 100,position = [0, 1, 2, 3, 4],speed = [100, 100, 100, 100, 100]) == 5\n assert candidate(target = 300,position = [0, 50, 100, 150, 20... | [
"12\n[10,8,0,5,3]\n[2,4,1,1,3]",
"10\n[3]\n[3]",
"100\n[0,2,4]\n[4,2,1]"
] | [] | {
"canonical_parameter_names": [
"target",
"position",
"speed"
],
"leetcode_dataset_entry_point": "Solution().carFleet",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:01",
"tes... | typescript | {
"raw_signature": "function carFleet(target: number, position: number[], speed: number[]): number {",
"container": null,
"callable": "carFleet",
"parameters": [
{
"name": "target",
"type": "number"
},
{
"name": "position",
"type": "number[]"
},
{
"name": "speed... |
854 | k-similar-strings | Hard | Strings s1 and s2 are k-similar (for some non-negative integer k) if we can swap the positions of two letters in s1 exactly k times so that the resulting string equals s2.
Given two anagrams s1 and s2, return the smallest k for which s1 and s2 are k-similar.
Example 1:
Input: s1 = "ab", s2 = "ba"
Output: 1
Explanati... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(s1 = \"aabbcc\",s2 = \"ccbbaa\") == 2\n assert candidate(s1 = \"abac\",s2 = \"baca\") == 2\n assert candidate(s1 = \"abcd\",s2 = \"dcba\") == 2\n assert candidate(s1 = \"abc\",s2 = \"bca\") == 2\n assert candidate(s1 = \"abcd... | [
"\"ab\"\n\"ba\"",
"\"abc\"\n\"bca\""
] | [] | {
"canonical_parameter_names": [
"s1",
"s2"
],
"leetcode_dataset_entry_point": "Solution().kSimilarity",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:03",
"tests_total": 47,
"te... | typescript | {
"raw_signature": "function kSimilarity(s1: string, s2: string): number {",
"container": null,
"callable": "kSimilarity",
"parameters": [
{
"name": "s1",
"type": "string"
},
{
"name": "s2",
"type": "string"
}
],
"return_type": "number",
"signature_source": "leetcod... |
856 | score-of-parentheses | Medium | Given a balanced parentheses string s, return the score of the string.
The score of a balanced parentheses string is based on the following rule:
- "()" has score 1.
- AB has score A + B, where A and B are balanced parentheses strings.
- (A) has score 2 * A, where A is a balanced parentheses string.
Example 1:
Inpu... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(s = \"(()())\") == 4\n assert candidate(s = \"(()(()))\") == 6\n assert candidate(s = \"()\") == 1\n assert candidate(s = \"((()))\") == 4\n assert candidate(s = \"((()()()))\") == 12\n assert candidate(s = \"()()(())\") =... | [
"\"()\"",
"\"(())\"",
"\"()()\""
] | [] | {
"canonical_parameter_names": [
"s"
],
"leetcode_dataset_entry_point": "Solution().scoreOfParentheses",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:05",
"tests_total": 55,
"tests_... | typescript | {
"raw_signature": "function scoreOfParentheses(s: string): number {",
"container": null,
"callable": "scoreOfParentheses",
"parameters": [
{
"name": "s",
"type": "string"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets... |
857 | minimum-cost-to-hire-k-workers | Hard | There are n workers. You are given two integer arrays quality and wage where quality[i] is the quality of the i^th worker and wage[i] is the minimum wage expectation for the i^th worker.
We want to hire exactly k workers to form a paid group. To hire a group of k workers, we must pay them according to the following ru... | {
"language": "python",
"source": "def answers_match(result, expected):\n \"\"\"Decimal answers are accepted within 1e-5 (absolute or relative), as on LeetCode.\"\"\"\n import math\n if isinstance(result, list) and isinstance(expected, list):\n return len(result) == len(expected) and all(answers_mat... | [
"[10,20,5]\n[70,50,30]\n2",
"[3,1,10,10,1]\n[4,8,2,2,7]\n3"
] | [] | {
"canonical_parameter_names": [
"quality",
"wage",
"k"
],
"leetcode_dataset_entry_point": "Solution().mincostToHireWorkers",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:08",
... | typescript | {
"raw_signature": "function mincostToHireWorkers(quality: number[], wage: number[], k: number): number {",
"container": null,
"callable": "mincostToHireWorkers",
"parameters": [
{
"name": "quality",
"type": "number[]"
},
{
"name": "wage",
"type": "number[]"
},
{
... |
858 | mirror-reflection | Medium | There is a special square room with mirrors on each of the four walls. Except for the southwest corner, there are receptors on each of the remaining corners, numbered 0, 1, and 2.
The square room has walls of length p and a laser ray from the southwest corner first meets the east wall at a distance q from the 0^th rec... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(p = 2,q = 1) == 2\n assert candidate(p = 10,q = 3) == 2\n assert candidate(p = 6,q = 2) == 1\n assert candidate(p = 4,q = 2) == 2\n assert candidate(p = 10,q = 4) == 0\n assert candidate(p = 5,q = 3) == 1\n assert candi... | [
"2\n1",
"3\n1"
] | [] | {
"canonical_parameter_names": [
"p",
"q"
],
"leetcode_dataset_entry_point": "Solution().mirrorReflection",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:10",
"tests_total": 84,
... | typescript | {
"raw_signature": "function mirrorReflection(p: number, q: number): number {",
"container": null,
"callable": "mirrorReflection",
"parameters": [
{
"name": "p",
"type": "number"
},
{
"name": "q",
"type": "number"
}
],
"return_type": "number",
"signature_source": "l... |
859 | buddy-strings | Easy | Given two strings s and goal, return true if you can swap two letters in s so the result is equal to goal, otherwise, return false.
Swapping letters is defined as taking two indices i and j (0-indexed) such that i != j and swapping the characters at s[i] and s[j].
- For example, swapping at indices 0 and 2 in "abcd" ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(s = \"abcd\",goal = \"dcba\") == False\n assert candidate(s = \"xyy\",goal = \"xyx\") == False\n assert candidate(s = \"abac\",goal = \"abad\") == False\n assert candidate(s = \"aa\",goal = \"aa\") == True\n assert candidate(... | [
"\"ab\"\n\"ba\"",
"\"ab\"\n\"ab\"",
"\"aa\"\n\"aa\""
] | [] | {
"canonical_parameter_names": [
"s",
"goal"
],
"leetcode_dataset_entry_point": "Solution().buddyStrings",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:12",
"tests_total": 126,
... | typescript | {
"raw_signature": "function buddyStrings(s: string, goal: string): boolean {",
"container": null,
"callable": "buddyStrings",
"parameters": [
{
"name": "s",
"type": "string"
},
{
"name": "goal",
"type": "string"
}
],
"return_type": "boolean",
"signature_source": "l... |
860 | lemonade-change | Easy | At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you and order one at a time (in the order specified by bills). Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer so that the net transaction ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(bills = [5, 5, 5, 5, 20, 20, 5, 5, 20, 5]) == False\n assert candidate(bills = [5, 5, 10, 10, 5, 20]) == True\n assert candidate(bills = [5, 5, 5, 5, 5, 5, 10, 10, 10, 20, 20, 20]) == True\n assert candidate(bills = [5, 5, 5, 5,... | [
"[5,5,5,10,20]",
"[5,5,10,10,20]"
] | [] | {
"canonical_parameter_names": [
"bills"
],
"leetcode_dataset_entry_point": "Solution().lemonadeChange",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:15",
"tests_total": 106,
"tests... | typescript | {
"raw_signature": "function lemonadeChange(bills: number[]): boolean {",
"container": null,
"callable": "lemonadeChange",
"parameters": [
{
"name": "bills",
"type": "number[]"
}
],
"return_type": "boolean",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSn... |
861 | score-after-flipping-matrix | Medium | You are given an m x n binary matrix grid.
A move consists of choosing any row or column and toggling each value in that row or column (i.e., changing all 0's to 1's, and all 1's to 0's).
Every row of the matrix is interpreted as a binary number, and the score of the matrix is the sum of these numbers.
Return the hi... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(grid = [[0, 0, 1, 1], [1, 0, 1, 0], [1, 1, 0, 0]]) == 39\n assert candidate(grid = [[1, 0, 0], [0, 1, 1], [1, 1, 0]]) == 19\n assert candidate(grid = [[0, 1, 0, 1, 0], [1, 0, 1, 0, 1], [0, 0, 0, 0, 0]]) == 83\n assert candidate(... | [
"[[0,0,1,1],[1,0,1,0],[1,1,0,0]]",
"[[0]]"
] | [] | {
"canonical_parameter_names": [
"grid"
],
"leetcode_dataset_entry_point": "Solution().matrixScore",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:17",
"tests_total": 80,
"tests_drop... | typescript | {
"raw_signature": "function matrixScore(grid: number[][]): number {",
"container": null,
"callable": "matrixScore",
"parameters": [
{
"name": "grid",
"type": "number[][]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets... |
862 | shortest-subarray-with-sum-at-least-k | Hard | Given an integer array nums and an integer k, return the length of the shortest non-empty subarray of nums with a sum of at least k. If there is no such subarray, return -1.
A subarray is a contiguous part of an array.
Example 1:
Input: nums = [1], k = 1
Output: 1
Example 2:
Input: nums = [1,2], k = 4
Output: -1
... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums = [-1, 2, -3, 4, -5],k = 3) == 1\n assert candidate(nums = [-1, 2],k = 2) == 1\n assert candidate(nums = [2, -1, 2],k = 3) == 3\n assert candidate(nums = [2, 1, 5, 1, 3, 2],k = 7) == 3\n assert candidate(nums = [-1, -2, ... | [
"[1]\n1",
"[1,2]\n4",
"[2,-1,2]\n3"
] | [] | {
"canonical_parameter_names": [
"nums",
"k"
],
"leetcode_dataset_entry_point": "Solution().shortestSubarray",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:19",
"tests_total": 127... | typescript | {
"raw_signature": "function shortestSubarray(nums: number[], k: number): number {",
"container": null,
"callable": "shortestSubarray",
"parameters": [
{
"name": "nums",
"type": "number[]"
},
{
"name": "k",
"type": "number"
}
],
"return_type": "number",
"signature_s... |
864 | shortest-path-to-get-all-keys | Hard | You are given an m x n grid grid where:
- '.' is an empty cell.
- '#' is a wall.
- '@' is the starting point.
- Lowercase letters represent keys.
- Uppercase letters represent locks.
You start at the starting point and one move consists of walking one space in one of the four cardinal directions. You cannot walk outs... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(grid = ['@.b..', '###.#', 'A.B.c']) == -1\n assert candidate(grid = ['@.b', '#.A', 'aBc']) == 8\n assert candidate(grid = ['@Aa']) == -1\n assert candidate(grid = ['@.b..', '#.A#.', 'a.c.C']) == 8\n assert candidate(grid = ['... | [
"[\"@.a..\",\"###.#\",\"b.A.B\"]",
"[\"@..aA\",\"..B#.\",\"....b\"]",
"[\"@Aa\"]"
] | [] | {
"canonical_parameter_names": [
"grid"
],
"leetcode_dataset_entry_point": "Solution().shortestPathAllKeys",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:21",
"tests_total": 60,
"te... | typescript | {
"raw_signature": "function shortestPathAllKeys(grid: string[]): number {",
"container": null,
"callable": "shortestPathAllKeys",
"parameters": [
{
"name": "grid",
"type": "string[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/... |
866 | prime-palindrome | Medium | Given an integer n, return the smallest prime palindrome greater than or equal to n.
An integer is prime if it has exactly two divisors: 1 and itself. Note that 1 is not a prime number.
- For example, 2, 3, 5, 7, 11, and 13 are all primes.
An integer is a palindrome if it reads the same from left to right as it does... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(n = 101) == 101\n assert candidate(n = 8) == 11\n assert candidate(n = 10000000) == 100030001\n assert candidate(n = 10007) == 10301\n assert candidate(n = 999) == 10301\n assert candidate(n = 6) == 7\n assert candidate... | [
"6",
"8",
"13"
] | [] | {
"canonical_parameter_names": [
"n"
],
"leetcode_dataset_entry_point": "Solution().primePalindrome",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:25",
"tests_total": 52,
"tests_dro... | typescript | {
"raw_signature": "function primePalindrome(n: number): number {",
"container": null,
"callable": "primePalindrome",
"parameters": [
{
"name": "n",
"type": "number"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets"
} |
867 | transpose-matrix | Easy | Given a 2D integer array matrix, return the transpose of matrix.
The transpose of a matrix is the matrix flipped over its main diagonal, switching the matrix's row and column indices.
Example 1:
Input: matrix = [[1,2,3],[4,5,6],[7,8,9]]
Output: [[1,4,7],[2,5,8],[3,6,9]]
Example 2:
Input: matrix = [[1,2,3],[4,5,6]]... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(matrix = [[1]]) == [(1,)]\n assert candidate(matrix = [[1, 2], [3, 4], [5, 6]]) == [(1, 3, 5), (2, 4, 6)]\n assert candidate(matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [(1, 4, 7), (2, 5, 8), (3, 6, 9)]\n assert candidate(mat... | [
"[[1,2,3],[4,5,6],[7,8,9]]",
"[[1,2,3],[4,5,6]]"
] | [
"We don't need any special algorithms to do this. You just need to know what the transpose of a matrix looks like. Rows become columns and vice versa!"
] | {
"canonical_parameter_names": [
"matrix"
],
"leetcode_dataset_entry_point": "Solution().transpose",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:28",
"tests_total": 74,
"tests_drop... | typescript | {
"raw_signature": "function transpose(matrix: number[][]): number[][] {",
"container": null,
"callable": "transpose",
"parameters": [
{
"name": "matrix",
"type": "number[][]"
}
],
"return_type": "number[][]",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/code... |
868 | binary-gap | Easy | Given a positive integer n, find and return the longest distance between any two adjacent 1's in the binary representation of n. If there are no two adjacent 1's, return 0.
Two 1's are adjacent if there are only 0's separating them (possibly no 0's). The distance between two 1's is the absolute difference between thei... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(n = 8) == 0\n assert candidate(n = 3) == 1\n assert candidate(n = 1041) == 6\n assert candidate(n = 15) == 1\n assert candidate(n = 22) == 2\n assert candidate(n = 32) == 0\n assert candidate(n = 6) == 1\n assert can... | [
"22",
"8",
"5"
] | [] | {
"canonical_parameter_names": [
"n"
],
"leetcode_dataset_entry_point": "Solution().binaryGap",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:30",
"tests_total": 65,
"tests_dropped":... | typescript | {
"raw_signature": "function binaryGap(n: number): number {",
"container": null,
"callable": "binaryGap",
"parameters": [
{
"name": "n",
"type": "number"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets"
} |
869 | reordered-power-of-2 | Medium | You are given an integer n. We reorder the digits in any order (including the original order) such that the leading digit is not zero.
Return true if and only if we can do this so that the resulting number is a power of two.
Example 1:
Input: n = 1
Output: true
Example 2:
Input: n = 10
Output: false
Constraints:
... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(n = 46875) == False\n assert candidate(n = 3245) == False\n assert candidate(n = 86) == False\n assert candidate(n = 10) == False\n assert candidate(n = 4326) == False\n assert candidate(n = 16) == True\n assert candida... | [
"1",
"10"
] | [] | {
"canonical_parameter_names": [
"n"
],
"leetcode_dataset_entry_point": "Solution().reorderedPowerOf2",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:32",
"tests_total": 87,
"tests_d... | typescript | {
"raw_signature": "function reorderedPowerOf2(n: number): boolean {",
"container": null,
"callable": "reorderedPowerOf2",
"parameters": [
{
"name": "n",
"type": "number"
}
],
"return_type": "boolean",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets... |
870 | advantage-shuffle | Medium | You are given two integer arrays nums1 and nums2 both of the same length. The advantage of nums1 with respect to nums2 is the number of indices i for which nums1[i] > nums2[i].
Return any permutation of nums1 that maximizes its advantage with respect to nums2.
Example 1:
Input: nums1 = [2,7,11,15], nums2 = [1,10,4,1... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums1 = [10, 20, 30, 40, 50],nums2 = [5, 15, 25, 35, 45]) == [10, 20, 30, 40, 50]\n assert candidate(nums1 = [5, 15, 25, 35],nums2 = [10, 20, 30, 40]) == [15, 25, 35, 5]\n assert candidate(nums1 = [2, 7, 11, 15],nums2 = [1, 10, 4, ... | [
"[2,7,11,15]\n[1,10,4,11]",
"[12,24,8,32]\n[13,25,32,11]"
] | [] | {
"canonical_parameter_names": [
"nums1",
"nums2"
],
"leetcode_dataset_entry_point": "Solution().advantageCount",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:34",
"tests_total": ... | typescript | {
"raw_signature": "function advantageCount(nums1: number[], nums2: number[]): number[] {",
"container": null,
"callable": "advantageCount",
"parameters": [
{
"name": "nums1",
"type": "number[]"
},
{
"name": "nums2",
"type": "number[]"
}
],
"return_type": "number[]",
... |
871 | minimum-number-of-refueling-stops | Hard | A car travels from a starting position to a destination which is target miles east of the starting position.
There are gas stations along the way. The gas stations are represented as an array stations where stations[i] = [position_i, fuel_i] indicates that the i^th gas station is position_i miles east of the starting ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(target = 100,startFuel = 100,stations = [[10, 10], [20, 20], [30, 30], [40, 40], [50, 50]]) == 0\n assert candidate(target = 150,startFuel = 50,stations = [[25, 25], [50, 50], [75, 25]]) == 3\n assert candidate(target = 150,startFu... | [
"1\n1\n[]",
"100\n1\n[[10,100]]",
"100\n10\n[[10,60],[20,30],[30,30],[60,40]]"
] | [] | {
"canonical_parameter_names": [
"target",
"startFuel",
"stations"
],
"leetcode_dataset_entry_point": "Solution().minRefuelStops",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:3... | typescript | {
"raw_signature": "function minRefuelStops(target: number, startFuel: number, stations: number[][]): number {",
"container": null,
"callable": "minRefuelStops",
"parameters": [
{
"name": "target",
"type": "number"
},
{
"name": "startFuel",
"type": "number"
},
{
... |
873 | length-of-longest-fibonacci-subsequence | Medium | A sequence x_1, x_2, ..., x_n is Fibonacci-like if:
- n >= 3
- x_i + x_{i+1} == x_{i+2} for all i + 2 <= n
Given a strictly increasing array arr of positive integers forming a sequence, return the length of the longest Fibonacci-like subsequence of arr. If one does not exist, return 0.
A subsequence is derived from ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(arr = [1, 2, 3, 4, 6, 9, 13, 19, 28, 41, 60, 88]) == 3\n assert candidate(arr = [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946]) == 20\n assert candidate(arr = [2, 4, 7, 11, 18, 29, 47, 7... | [
"[1,2,3,4,5,6,7,8]",
"[1,3,7,11,12,14,18]"
] | [
"Can we use dynamic programming here?",
"Consider a sequence ending at index iarr[i], which can be done in linear time per element."
] | {
"canonical_parameter_names": [
"arr"
],
"leetcode_dataset_entry_point": "Solution().lenLongestFibSubseq",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:41",
"tests_total": 122,
"te... | typescript | {
"raw_signature": "function lenLongestFibSubseq(arr: number[]): number {",
"container": null,
"callable": "lenLongestFibSubseq",
"parameters": [
{
"name": "arr",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/co... |
874 | walking-robot-simulation | Medium | A robot on an infinite XY-plane starts at point (0, 0) facing north. The robot receives an array of integers commands, which represents a sequence of moves that it needs to execute. There are only three possible types of instructions the robot can receive:
- -2: Turn left 90 degrees.
- -1: Turn right 90 degrees.
- 1 <... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(commands = [5, -2, 5, -2, 5, -2, 5],obstacles = [[-1, -1], [1, 1]]) == 50\n assert candidate(commands = [1, -2, 1, -2, 1, -2, 1, -2],obstacles = [[0, 1], [1, 0], [-1, 0], [0, -1]]) == 0\n assert candidate(commands = [5, -2, 5, -2, ... | [
"[4,-1,3]\n[]",
"[4,-1,4,-2,4]\n[[2,4]]",
"[-1,9]\n[[5,0],[2,0]]"
] | [] | {
"canonical_parameter_names": [
"commands",
"obstacles"
],
"leetcode_dataset_entry_point": "Solution().robotSim",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:43",
"tests_total":... | typescript | {
"raw_signature": "function robotSim(commands: number[], obstacles: number[][]): number {",
"container": null,
"callable": "robotSim",
"parameters": [
{
"name": "commands",
"type": "number[]"
},
{
"name": "obstacles",
"type": "number[][]"
}
],
"return_type": "number"... |
875 | koko-eating-bananas | Medium | Koko loves to eat bananas. There are n piles of bananas, the i^th pile has piles[i] bananas. The guards have gone and will come back in h hours.
Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile. If the pile has less than k bananas, sh... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(piles = [1, 2, 3],h = 5) == 2\n assert candidate(piles = [1000000000],h = 1000000000) == 1\n assert candidate(piles = [805306457, 805306457, 805306457],h = 1000000000) == 3\n assert candidate(piles = [30, 11, 23, 4, 20],h = 5) =... | [
"[3,6,7,11]\n8",
"[30,11,23,4,20]\n5",
"[30,11,23,4,20]\n6"
] | [] | {
"canonical_parameter_names": [
"piles",
"h"
],
"leetcode_dataset_entry_point": "Solution().minEatingSpeed",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:45",
"tests_total": 124,... | typescript | {
"raw_signature": "function minEatingSpeed(piles: number[], h: number): number {",
"container": null,
"callable": "minEatingSpeed",
"parameters": [
{
"name": "piles",
"type": "number[]"
},
{
"name": "h",
"type": "number"
}
],
"return_type": "number",
"signature_sou... |
877 | stone-game | Medium | Alice and Bob play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of stones piles[i].
The objective of the game is to end with the most stones. The total number of stones across all the piles is odd, so there are no ties.
Alice and Bob tak... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(piles = [15, 30, 5, 10, 20, 25]) == True\n assert candidate(piles = [8, 15, 3, 7]) == True\n assert candidate(piles = [7, 3, 8, 5, 12, 10]) == True\n assert candidate(piles = [1, 2, 3, 4, 5, 6, 7, 8]) == True\n assert candida... | [
"[5,3,4,5]",
"[3,7,2,3]"
] | [] | {
"canonical_parameter_names": [
"piles"
],
"leetcode_dataset_entry_point": "Solution().stoneGame",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:50",
"tests_total": 119,
"tests_drop... | typescript | {
"raw_signature": "function stoneGame(piles: number[]): boolean {",
"container": null,
"callable": "stoneGame",
"parameters": [
{
"name": "piles",
"type": "number[]"
}
],
"return_type": "boolean",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets"
} |
878 | nth-magical-number | Hard | A positive integer is magical if it is divisible by either a or b.
Given the three integers n, a, and b, return the n^th magical number. Since the answer may be very large, return it modulo 10^9 + 7.
Example 1:
Input: n = 1, a = 2, b = 3
Output: 2
Example 2:
Input: n = 4, a = 2, b = 3
Output: 6
Constraints:
- 1 ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(n = 5,a = 6,b = 5) == 15\n assert candidate(n = 10,a = 3,b = 7) == 24\n assert candidate(n = 1000000000,a = 2,b = 3) == 499999993\n assert candidate(n = 10,a = 7,b = 3) == 24\n assert candidate(n = 5,a = 3,b = 5) == 10\n a... | [
"1\n2\n3",
"4\n2\n3"
] | [] | {
"canonical_parameter_names": [
"n",
"a",
"b"
],
"leetcode_dataset_entry_point": "Solution().nthMagicalNumber",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:52",
"tests_total... | typescript | {
"raw_signature": "function nthMagicalNumber(n: number, a: number, b: number): number {",
"container": null,
"callable": "nthMagicalNumber",
"parameters": [
{
"name": "n",
"type": "number"
},
{
"name": "a",
"type": "number"
},
{
"name": "b",
"type": "numb... |
879 | profitable-schemes | Hard | There is a group of n members, and a list of various crimes they could commit. The i^th crime generates a profit[i] and requires group[i] members to participate in it. If a member participates in one crime, that member can't participate in another crime.
Let's call a profitable scheme any subset of these crimes that g... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(n = 4,minProfit = 4,group = [4],profit = [5]) == 1\n assert candidate(n = 3,minProfit = 0,group = [1, 2],profit = [0, 0]) == 4\n assert candidate(n = 100,minProfit = 100,group = [100],profit = [100]) == 1\n assert candidate(n = ... | [
"5\n3\n[2,2]\n[2,3]",
"10\n5\n[2,3,5]\n[6,7,8]"
] | [] | {
"canonical_parameter_names": [
"n",
"minProfit",
"group",
"profit"
],
"leetcode_dataset_entry_point": "Solution().profitableSchemes",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-3... | typescript | {
"raw_signature": "function profitableSchemes(n: number, minProfit: number, group: number[], profit: number[]): number {",
"container": null,
"callable": "profitableSchemes",
"parameters": [
{
"name": "n",
"type": "number"
},
{
"name": "minProfit",
"type": "number"
},
... |
880 | decoded-string-at-index | Medium | You are given an encoded string s. To decode the string to a tape, the encoded string is read one character at a time and the following steps are taken:
- If the character read is a letter, that letter is written onto the tape.
- If the character read is a digit d, the entire current tape is repeatedly written d - 1 m... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(s = \"x5\",k = 15) == \"x\"\n assert candidate(s = \"y959q969u3hb22\",k = 200) == \"y\"\n assert candidate(s = \"abc2d3\",k = 7) == \"d\"\n assert candidate(s = \"y959q969u3hb22\",k = 94921609) == \"y\"\n assert candidate(s =... | [
"\"leet2code3\"\n10",
"\"ha22\"\n5",
"\"a2345678999999999999999\"\n1"
] | [] | {
"canonical_parameter_names": [
"s",
"k"
],
"leetcode_dataset_entry_point": "Solution().decodeAtIndex",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:56",
"tests_total": 101,
"t... | typescript | {
"raw_signature": "function decodeAtIndex(s: string, k: number): string {",
"container": null,
"callable": "decodeAtIndex",
"parameters": [
{
"name": "s",
"type": "string"
},
{
"name": "k",
"type": "number"
}
],
"return_type": "string",
"signature_source": "leetcod... |
881 | boats-to-save-people | Medium | You are given an array people where people[i] is the weight of the i^th person, and an infinite number of boats where each boat can carry a maximum weight of limit. Each boat carries at most two people at the same time, provided the sum of the weight of those people is at most limit.
Return the minimum number of boats... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(people = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],limit = 11) == 5\n assert candidate(people = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],limit = 15) == 5\n assert candidate(people = [3, 2, 2, 1],limit = 3) == 3\n assert candidate(people = [5, 5, 5... | [
"[1,2]\n3",
"[3,2,2,1]\n3",
"[3,5,3,4]\n5"
] | [] | {
"canonical_parameter_names": [
"people",
"limit"
],
"leetcode_dataset_entry_point": "Solution().numRescueBoats",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:02:59",
"tests_total":... | typescript | {
"raw_signature": "function numRescueBoats(people: number[], limit: number): number {",
"container": null,
"callable": "numRescueBoats",
"parameters": [
{
"name": "people",
"type": "number[]"
},
{
"name": "limit",
"type": "number"
}
],
"return_type": "number",
"sig... |
882 | reachable-nodes-in-subdivided-graph | Hard | You are given an undirected graph (the "original graph") with n nodes labeled from 0 to n - 1. You decide to subdivide each edge in the graph into a chain of nodes, with the number of new nodes varying between each edge.
The graph is given as a 2D array of edges where edges[i] = [u_i, v_i, cnt_i] indicates that there ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(edges = [[0, 1, 4], [1, 2, 6], [0, 2, 8], [1, 3, 1]],maxMoves = 10,n = 4) == 23\n assert candidate(edges = [[0, 1, 0], [1, 2, 0]],maxMoves = 3,n = 3) == 3\n assert candidate(edges = [[0, 1, 5]],maxMoves = 5,n = 2) == 6\n assert ... | [
"[[0,1,10],[0,2,1],[1,2,2]]\n6\n3",
"[[0,1,4],[1,2,6],[0,2,8],[1,3,1]]\n10\n4",
"[[1,2,4],[1,4,5],[1,3,1],[2,3,4],[3,4,5]]\n17\n5"
] | [] | {
"canonical_parameter_names": [
"edges",
"maxMoves",
"n"
],
"leetcode_dataset_entry_point": "Solution().reachableNodes",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:01",
"te... | typescript | {
"raw_signature": "function reachableNodes(edges: number[][], maxMoves: number, n: number): number {",
"container": null,
"callable": "reachableNodes",
"parameters": [
{
"name": "edges",
"type": "number[][]"
},
{
"name": "maxMoves",
"type": "number"
},
{
"name"... |
883 | projection-area-of-3d-shapes | Easy | You are given an n x n grid where we place some 1 x 1 x 1 cubes that are axis-aligned with the x, y, and z axes.
Each value v = grid[i][j] represents a tower of v cubes placed on top of the cell (i, j).
We view the projection of these cubes onto the xy, yz, and zx planes.
A projection is like a shadow, that maps our... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(grid = [[2, 2, 2], [2, 1, 2], [2, 2, 2]]) == 21\n assert candidate(grid = [[1, 1, 1], [1, 0, 1], [1, 1, 1]]) == 14\n assert candidate(grid = [[2]]) == 5\n assert candidate(grid = [[1, 2], [3, 4]]) == 17\n assert candidate(gri... | [
"[[1,2],[3,4]]",
"[[2]]",
"[[1,0],[0,2]]"
] | [] | {
"canonical_parameter_names": [
"grid"
],
"leetcode_dataset_entry_point": "Solution().projectionArea",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:03",
"tests_total": 72,
"tests_d... | typescript | {
"raw_signature": "function projectionArea(grid: number[][]): number {",
"container": null,
"callable": "projectionArea",
"parameters": [
{
"name": "grid",
"type": "number[][]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSn... |
884 | uncommon-words-from-two-sentences | Easy | A sentence is a string of single-space separated words where each word consists only of lowercase letters.
A word is uncommon if it appears exactly once in one of the sentences, and does not appear in the other sentence.
Given two sentences s1 and s2, return a list of all the uncommon words. You may return the answer... | {
"language": "python",
"source": "def answers_match(result, expected):\n \"\"\"The answer may list its items in any order (only the top-level order is free).\"\"\"\n if isinstance(result, list) and isinstance(expected, list):\n return sorted(result, key=repr) == sorted(expected, key=repr)\n return ... | [
"\"this apple is sweet\"\n\"this apple is sour\"",
"\"apple apple\"\n\"banana\""
] | [] | {
"canonical_parameter_names": [
"s1",
"s2"
],
"leetcode_dataset_entry_point": "Solution().uncommonFromSentences",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:05",
"tests_total":... | typescript | {
"raw_signature": "function uncommonFromSentences(s1: string, s2: string): string[] {",
"container": null,
"callable": "uncommonFromSentences",
"parameters": [
{
"name": "s1",
"type": "string"
},
{
"name": "s2",
"type": "string"
}
],
"return_type": "string[]",
"sig... |
885 | spiral-matrix-iii | Medium | You start at the cell (rStart, cStart) of an rows x cols grid facing east. The northwest corner is at the first row and column in the grid, and the southeast corner is at the last row and column.
You will walk in a clockwise spiral shape to visit every position in this grid. Whenever you move outside the grid's bounda... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(rows = 5,cols = 6,rStart = 1,cStart = 4) == [[1, 4], [1, 5], [2, 5], [2, 4], [2, 3], [1, 3], [0, 3], [0, 4], [0, 5], [3, 5], [3, 4], [3, 3], [3, 2], [2, 2], [1, 2], [0, 2], [4, 5], [4, 4], [4, 3], [4, 2], [4, 1], [3, 1], [2, 1], [1, 1], ... | [
"1\n4\n0\n0",
"5\n6\n1\n4"
] | [] | {
"canonical_parameter_names": [
"rows",
"cols",
"rStart",
"cStart"
],
"leetcode_dataset_entry_point": "Solution().spiralMatrixIII",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T2... | typescript | {
"raw_signature": "function spiralMatrixIII(rows: number, cols: number, rStart: number, cStart: number): number[][] {",
"container": null,
"callable": "spiralMatrixIII",
"parameters": [
{
"name": "rows",
"type": "number"
},
{
"name": "cols",
"type": "number"
},
{
... |
886 | possible-bipartition | Medium | We want to split a group of n people (labeled from 1 to n) into two groups of any size. Each person may dislike some other people, and they should not go into the same group.
Given the integer n and the array dislikes where dislikes[i] = [a_i, b_i] indicates that the person labeled a_i does not like the person labeled... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(n = 4,dislikes = [[1, 2], [1, 3], [2, 4]]) == True\n assert candidate(n = 5,dislikes = [[1, 2], [2, 3], [3, 4], [4, 5], [1, 5]]) == False\n assert candidate(n = 3,dislikes = [[1, 2]]) == True\n assert candidate(n = 3,dislikes = ... | [
"4\n[[1,2],[1,3],[2,4]]",
"3\n[[1,2],[1,3],[2,3]]"
] | [] | {
"canonical_parameter_names": [
"n",
"dislikes"
],
"leetcode_dataset_entry_point": "Solution().possibleBipartition",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:09",
"tests_tota... | typescript | {
"raw_signature": "function possibleBipartition(n: number, dislikes: number[][]): boolean {",
"container": null,
"callable": "possibleBipartition",
"parameters": [
{
"name": "n",
"type": "number"
},
{
"name": "dislikes",
"type": "number[][]"
}
],
"return_type": "bool... |
887 | super-egg-drop | Hard | You are given k identical eggs and you have access to a building with n floors labeled from 1 to n.
You know that there exists a floor f where 0 <= f <= n such that any egg dropped at a floor higher than f will break, and any egg dropped at or below floor f will not break.
Each move, you may take an unbroken egg and ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(k = 2,n = 1) == 1\n assert candidate(k = 5,n = 1000) == 11\n assert candidate(k = 1,n = 100) == 100\n assert candidate(k = 1,n = 2) == 2\n assert candidate(k = 2,n = 6) == 3\n assert candidate(k = 50,n = 10000) == 14\n ... | [
"1\n2",
"2\n6",
"3\n14"
] | [] | {
"canonical_parameter_names": [
"k",
"n"
],
"leetcode_dataset_entry_point": "Solution().superEggDrop",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:12",
"tests_total": 92,
"tes... | typescript | {
"raw_signature": "function superEggDrop(k: number, n: number): number {",
"container": null,
"callable": "superEggDrop",
"parameters": [
{
"name": "k",
"type": "number"
},
{
"name": "n",
"type": "number"
}
],
"return_type": "number",
"signature_source": "leetcode/... |
888 | fair-candy-swap | Easy | Alice and Bob have a different total number of candies. You are given two integer arrays aliceSizes and bobSizes where aliceSizes[i] is the number of candies of the i^th box of candy that Alice has and bobSizes[j] is the number of candies of the j^th box of candy that Bob has.
Since they are friends, they would like t... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(aliceSizes = [3, 7],bobSizes = [1, 9]) == None\n assert candidate(aliceSizes = [10, 20, 30],bobSizes = [5, 15, 25]) == None\n assert candidate(aliceSizes = [1, 1],bobSizes = [2, 2]) == [1, 2]\n assert candidate(aliceSizes = [5, ... | [
"[1,1]\n[2,2]",
"[1,2]\n[2,3]",
"[2]\n[1,3]"
] | [] | {
"canonical_parameter_names": [
"aliceSizes",
"bobSizes"
],
"leetcode_dataset_entry_point": "Solution().fairCandySwap",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:14",
"tests_t... | typescript | {
"raw_signature": "function fairCandySwap(aliceSizes: number[], bobSizes: number[]): number[] {",
"container": null,
"callable": "fairCandySwap",
"parameters": [
{
"name": "aliceSizes",
"type": "number[]"
},
{
"name": "bobSizes",
"type": "number[]"
}
],
"return_type"... |
890 | find-and-replace-pattern | Medium | Given a list of strings words and a string pattern, return a list of words[i] that match pattern. You may return the answer in any order.
A word matches the pattern if there exists a permutation of letters p so that after replacing every letter x in the pattern with p(x), we get the desired word.
Recall that a permut... | {
"language": "python",
"source": "def answers_match(result, expected):\n \"\"\"The answer may list its items in any order (only the top-level order is free).\"\"\"\n if isinstance(result, list) and isinstance(expected, list):\n return sorted(result, key=repr) == sorted(expected, key=repr)\n return ... | [
"[\"abc\",\"deq\",\"mee\",\"aqq\",\"dkd\",\"ccc\"]\n\"abb\"",
"[\"a\",\"b\",\"c\"]\n\"a\""
] | [] | {
"canonical_parameter_names": [
"words",
"pattern"
],
"leetcode_dataset_entry_point": "Solution().findAndReplacePattern",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:18",
"tests... | typescript | {
"raw_signature": "function findAndReplacePattern(words: string[], pattern: string): string[] {",
"container": null,
"callable": "findAndReplacePattern",
"parameters": [
{
"name": "words",
"type": "string[]"
},
{
"name": "pattern",
"type": "string"
}
],
"return_type"... |
891 | sum-of-subsequence-widths | Hard | The width of a sequence is the difference between the maximum and minimum elements in the sequence.
Given an array of integers nums, return the sum of the widths of all the non-empty subsequences of nums. Since the answer may be very large, return it modulo 10^9 + 7.
A subsequence is a sequence that can be derived fr... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums = [10, 20, 30]) == 60\n assert candidate(nums = [9, 7, 5, 3, 1]) == 144\n assert candidate(nums = [1, 2, 4, 8, 16]) == 261\n assert candidate(nums = [9, 8, 7, 6, 5, 4, 3, 2, 1]) == 3084\n assert candidate(nums = [1, 3, 5... | [
"[2,1,3]",
"[2]"
] | [] | {
"canonical_parameter_names": [
"nums"
],
"leetcode_dataset_entry_point": "Solution().sumSubseqWidths",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:21",
"tests_total": 86,
"tests_... | typescript | {
"raw_signature": "function sumSubseqWidths(nums: number[]): number {",
"container": null,
"callable": "sumSubseqWidths",
"parameters": [
{
"name": "nums",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnip... |
892 | surface-area-of-3d-shapes | Easy | You are given an n x n grid where you have placed some 1 x 1 x 1 cubes. Each value v = grid[i][j] represents a tower of v cubes placed on top of cell (i, j).
After placing these cubes, you have decided to glue any directly adjacent cubes to each other, forming several irregular 3D shapes.
Return the total surface are... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(grid = [[3, 3, 3], [3, 3, 3], [3, 3, 3]]) == 54\n assert candidate(grid = [[2, 2, 2], [2, 1, 2], [2, 2, 2]]) == 46\n assert candidate(grid = [[1, 1, 1], [1, 0, 1], [1, 1, 1]]) == 32\n assert candidate(grid = [[50, 50, 50], [50, ... | [
"[[1,2],[3,4]]",
"[[1,1,1],[1,0,1],[1,1,1]]",
"[[2,2,2],[2,1,2],[2,2,2]]"
] | [] | {
"canonical_parameter_names": [
"grid"
],
"leetcode_dataset_entry_point": "Solution().surfaceArea",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:23",
"tests_total": 78,
"tests_drop... | typescript | {
"raw_signature": "function surfaceArea(grid: number[][]): number {",
"container": null,
"callable": "surfaceArea",
"parameters": [
{
"name": "grid",
"type": "number[][]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets... |
893 | groups-of-special-equivalent-strings | Medium | You are given an array of strings of the same length words.
In one move, you can swap any two even indexed characters or any two odd indexed characters of a string words[i].
Two strings words[i] and words[j] are special-equivalent if after any number of moves, words[i] == words[j].
- For example, words[i] = "zzxy" a... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(words = ['abcd', 'abdc', 'cdab', 'cdba', 'dcba', 'bacd']) == 4\n assert candidate(words = ['abcd', 'abdc', 'cdab', 'cdba']) == 3\n assert candidate(words = ['abc', 'def', 'ghi', 'jkl', 'mno', 'pqr']) == 6\n assert candidate(word... | [
"[\"abcd\",\"cdab\",\"cbad\",\"xyzz\",\"zzxy\",\"zzyx\"]",
"[\"abc\",\"acb\",\"bac\",\"bca\",\"cab\",\"cba\"]"
] | [] | {
"canonical_parameter_names": [
"words"
],
"leetcode_dataset_entry_point": "Solution().numSpecialEquivGroups",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:25",
"tests_total": 81,
... | typescript | {
"raw_signature": "function numSpecialEquivGroups(words: string[]): number {",
"container": null,
"callable": "numSpecialEquivGroups",
"parameters": [
{
"name": "words",
"type": "string[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "lee... |
896 | monotonic-array | Easy | An array is monotonic if it is either monotone increasing or monotone decreasing.
An array nums is monotone increasing if for all i <= j, nums[i] <= nums[j]. An array nums is monotone decreasing if for all i <= j, nums[i] >= nums[j].
Given an integer array nums, return true if the given array is monotonic, or false o... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums = [1, 2, 2, 3]) == True\n assert candidate(nums = [1, 2, 4, 5]) == True\n assert candidate(nums = [-1, -2, -2, -3]) == True\n assert candidate(nums = [1, 1, 1, 1]) == True\n assert candidate(nums = [1, 1, 1]) == True\n ... | [
"[1,2,2,3]",
"[6,5,4,4]",
"[1,3,2]"
] | [] | {
"canonical_parameter_names": [
"nums"
],
"leetcode_dataset_entry_point": "Solution().isMonotonic",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:27",
"tests_total": 151,
"tests_dro... | typescript | {
"raw_signature": "function isMonotonic(nums: number[]): boolean {",
"container": null,
"callable": "isMonotonic",
"parameters": [
{
"name": "nums",
"type": "number[]"
}
],
"return_type": "boolean",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets"
... |
898 | bitwise-ors-of-subarrays | Medium | Given an integer array arr, return the number of distinct bitwise ORs of all the non-empty subarrays of arr.
The bitwise OR of a subarray is the bitwise OR of each integer in the subarray. The bitwise OR of a subarray of one integer is that integer.
A subarray is a contiguous non-empty sequence of elements within an ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(arr = [0, 1, 1, 3]) == 3\n assert candidate(arr = [2, 1, 0, 3, 2]) == 4\n assert candidate(arr = [5, 5, 5, 5, 5, 5]) == 1\n assert candidate(arr = [8, 16, 32]) == 6\n assert candidate(arr = [1, 1, 2]) == 3\n assert candida... | [
"[0]",
"[1,1,2]",
"[1,2,4]"
] | [
"Consider the the subarrays that end at index i. The number of unique bitwise OR for these subarrays is limited."
] | {
"canonical_parameter_names": [
"arr"
],
"leetcode_dataset_entry_point": "Solution().subarrayBitwiseORs",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:32",
"tests_total": 93,
"test... | typescript | {
"raw_signature": "function subarrayBitwiseORs(arr: number[]): number {",
"container": null,
"callable": "subarrayBitwiseORs",
"parameters": [
{
"name": "arr",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/code... |
899 | orderly-queue | Hard | You are given a string s and an integer k. You can choose one of the first k letters of s and append it at the end of the string.
Return the lexicographically smallest string you could have after applying the mentioned step any number of moves.
Example 1:
Input: s = "cba", k = 1
Output: "acb"
Explanation:
In the fir... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(s = \"aaab\",k = 1) == \"aaab\"\n assert candidate(s = \"aaa\",k = 3) == \"aaa\"\n assert candidate(s = \"zxy\",k = 3) == \"xyz\"\n assert candidate(s = \"zxy\",k = 1) == \"xyz\"\n assert candidate(s = \"ccccc\",k = 4) == \"c... | [
"\"cba\"\n1",
"\"baaca\"\n3"
] | [] | {
"canonical_parameter_names": [
"s",
"k"
],
"leetcode_dataset_entry_point": "Solution().orderlyQueue",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:34",
"tests_total": 118,
"te... | typescript | {
"raw_signature": "function orderlyQueue(s: string, k: number): string {",
"container": null,
"callable": "orderlyQueue",
"parameters": [
{
"name": "s",
"type": "string"
},
{
"name": "k",
"type": "number"
}
],
"return_type": "string",
"signature_source": "leetcode/... |
902 | numbers-at-most-n-given-digit-set | Hard | Given an array of digits which is sorted in non-decreasing order. You can write numbers using each digits[i] as many times as we want. For example, if digits = ['1','3','5'], we may write numbers such as '13', '551', and '1351315'.
Return the number of positive integers that can be generated that are less than or equa... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(digits = ['1', '4', '9'],n = 1000000000) == 29523\n assert candidate(digits = ['7'],n = 8) == 1\n assert candidate(digits = ['1', '2', '3'],n = 123) == 18\n assert candidate(digits = ['2', '3', '5'],n = 250) == 18\n assert ca... | [
"[\"1\",\"3\",\"5\",\"7\"]\n100",
"[\"1\",\"4\",\"9\"]\n1000000000",
"[\"7\"]\n8"
] | [] | {
"canonical_parameter_names": [
"digits",
"n"
],
"leetcode_dataset_entry_point": "Solution().atMostNGivenDigitSet",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:36",
"tests_total... | typescript | {
"raw_signature": "function atMostNGivenDigitSet(digits: string[], n: number): number {",
"container": null,
"callable": "atMostNGivenDigitSet",
"parameters": [
{
"name": "digits",
"type": "string[]"
},
{
"name": "n",
"type": "number"
}
],
"return_type": "number",
... |
903 | valid-permutations-for-di-sequence | Hard | You are given a string s of length n where s[i] is either:
- 'D' means decreasing, or
- 'I' means increasing.
A permutation perm of n + 1 integers of all the integers in the range [0, n] is called a valid permutation if for all valid i:
- If s[i] == 'D', then perm[i] > perm[i + 1], and
- If s[i] == 'I', then perm[i]... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(s = \"DDDDDDDDDDDD\") == 1\n assert candidate(s = \"DII\") == 3\n assert candidate(s = \"IIDII\") == 19\n assert candidate(s = \"DIDDDDDD\") == 35\n assert candidate(s = \"IIIIIIIIIIII\") == 1\n assert candidate(s = \"DDI\... | [
"\"DID\"",
"\"D\""
] | [] | {
"canonical_parameter_names": [
"s"
],
"leetcode_dataset_entry_point": "Solution().numPermsDISequence",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:38",
"tests_total": 247,
"tests... | typescript | {
"raw_signature": "function numPermsDISequence(s: string): number {",
"container": null,
"callable": "numPermsDISequence",
"parameters": [
{
"name": "s",
"type": "string"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets... |
904 | fruit-into-baskets | Medium | You are visiting a farm that has a single row of fruit trees arranged from left to right. The trees are represented by an integer array fruits where fruits[i] is the type of fruit the i^th tree produces.
You want to collect as much fruit as possible. However, the owner has some strict rules that you must follow:
- Yo... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(fruits = [0]) == 1\n assert candidate(fruits = [1, 2, 3, 2, 2]) == 4\n assert candidate(fruits = [1, 0, 1, 4, 1, 4, 1, 2, 3]) == 5\n assert candidate(fruits = [0, 0, 1, 1]) == 4\n assert candidate(fruits = [1, 2, 2, 3, 3, 3, ... | [
"[1,2,1]",
"[0,1,2,2]",
"[1,2,3,2,2]"
] | [] | {
"canonical_parameter_names": [
"fruits"
],
"leetcode_dataset_entry_point": "Solution().totalFruit",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:40",
"tests_total": 98,
"tests_dro... | typescript | {
"raw_signature": "function totalFruit(fruits: number[]): number {",
"container": null,
"callable": "totalFruit",
"parameters": [
{
"name": "fruits",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets"
... |
905 | sort-array-by-parity | Easy | Given an integer array nums, move all the even integers at the beginning of the array followed by all the odd integers.
Return any array that satisfies this condition.
Example 1:
Input: nums = [3,1,2,4]
Output: [2,4,3,1]
Explanation: The outputs [4,2,3,1], [2,4,1,3], and [4,2,1,3] would also be accepted.
Example 2:... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums = [1, 3, 5, 7, 9, 2, 4, 6, 8, 0]) == [0, 8, 6, 4, 2, 9, 7, 5, 3, 1]\n assert candidate(nums = [5, 3, 2, 8, 6, 7, 1, 4]) == [4, 6, 2, 8, 3, 7, 1, 5]\n assert candidate(nums = [2, 1]) == [2, 1]\n assert candidate(nums = [2, 4... | [
"[3,1,2,4]",
"[0]"
] | [] | {
"canonical_parameter_names": [
"nums"
],
"leetcode_dataset_entry_point": "Solution().sortArrayByParity",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:42",
"tests_total": 98,
"test... | typescript | {
"raw_signature": "function sortArrayByParity(nums: number[]): number[] {",
"container": null,
"callable": "sortArrayByParity",
"parameters": [
{
"name": "nums",
"type": "number[]"
}
],
"return_type": "number[]",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/... |
906 | super-palindromes | Hard | Let's say a positive integer is a super-palindrome if it is a palindrome, and it is also the square of a palindrome.
Given two positive integers left and right represented as strings, return the number of super-palindromes integers in the inclusive range [left, right].
Example 1:
Input: left = "4", right = "1000"
Ou... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(left = \"123\",right = \"456\") == 0\n assert candidate(left = \"50\",right = \"10000\") == 2\n assert candidate(left = \"4\",right = \"1000\") == 4\n assert candidate(left = \"1\",right = \"2\") == 1\n assert candidate(left ... | [
"\"4\"\n\"1000\"",
"\"1\"\n\"2\""
] | [] | {
"canonical_parameter_names": [
"left",
"right"
],
"leetcode_dataset_entry_point": "Solution().superpalindromesInRange",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:45",
"tests_... | typescript | {
"raw_signature": "function superpalindromesInRange(left: string, right: string): number {",
"container": null,
"callable": "superpalindromesInRange",
"parameters": [
{
"name": "left",
"type": "string"
},
{
"name": "right",
"type": "string"
}
],
"return_type": "numbe... |
907 | sum-of-subarray-minimums | Medium | Given an array of integers arr, find the sum of min(b), where b ranges over every (contiguous) subarray of arr. Since the answer may be large, return the answer modulo 10^9 + 7.
Example 1:
Input: arr = [3,1,2,4]
Output: 17
Explanation:
Subarrays are [3], [1], [2], [4], [3,1], [1,2], [2,4], [3,1,2], [1,2,4], [3,1,2,4]... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(arr = [5, 4, 3, 2, 1]) == 35\n assert candidate(arr = [1, 3, 2, 4, 5, 7, 6, 8, 9]) == 157\n assert candidate(arr = [9, 7, 5, 3, 1]) == 55\n assert candidate(arr = [10, 20, 30, 40, 50]) == 350\n assert candidate(arr = [1, 2, 2... | [
"[3,1,2,4]",
"[50]"
] | [] | {
"canonical_parameter_names": [
"arr"
],
"leetcode_dataset_entry_point": "Solution().sumSubarrayMins",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:47",
"tests_total": 93,
"tests_d... | typescript | {
"raw_signature": "function sumSubarrayMins(arr: number[]): number {",
"container": null,
"callable": "sumSubarrayMins",
"parameters": [
{
"name": "arr",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippe... |
908 | smallest-range-i | Easy | You are given an integer array nums and an integer k.
In one operation, you can choose any index i where 0 <= i < nums.length and change nums[i] to nums[i] + x where x is an integer from the range [-k, k]. You can apply this operation at most once for each index i.
The score of nums is the difference between the maxi... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums = [100, 200, 300, 400],k = 100) == 100\n assert candidate(nums = [100, 4, 200, 1, 3, 2],k = 3) == 193\n assert candidate(nums = [1, 10000],k = 10000) == 0\n assert candidate(nums = [5, 5, 5, 5],k = 1) == 0\n assert candi... | [
"[1]\n0",
"[0,10]\n2",
"[1,3,6]\n3"
] | [] | {
"canonical_parameter_names": [
"nums",
"k"
],
"leetcode_dataset_entry_point": "Solution().smallestRangeI",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:49",
"tests_total": 126,
... | typescript | {
"raw_signature": "function smallestRangeI(nums: number[], k: number): number {",
"container": null,
"callable": "smallestRangeI",
"parameters": [
{
"name": "nums",
"type": "number[]"
},
{
"name": "k",
"type": "number"
}
],
"return_type": "number",
"signature_sourc... |
909 | snakes-and-ladders | Medium | You are given an n x n integer matrix board where the cells are labeled from 1 to n^2 in a Boustrophedon style starting from the bottom left of the board (i.e. board[n - 1][0]) and alternating direction each row.
You start on square 1 of the board. In each move, starting from square curr, do the following:
- Choose a... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(board = [[-1, -1], [-1, 3]]) == 1\n assert candidate(board = [[-1, 2, 15, -1, -1, -1], [-1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1], [-1, 34, 3, -1, -1, -1], [-1, -1, -1, -1, -1, -1], [-1, 15, -1, -1, -1, -1]]) == 4\n assert ... | [
"[[-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1],[-1,35,-1,-1,13,-1],[-1,-1,-1,-1,-1,-1],[-1,15,-1,-1,-1,-1]]",
"[[-1,-1],[-1,3]]"
] | [] | {
"canonical_parameter_names": [
"board"
],
"leetcode_dataset_entry_point": "Solution().snakesAndLadders",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:51",
"tests_total": 72,
"test... | typescript | {
"raw_signature": "function snakesAndLadders(board: number[][]): number {",
"container": null,
"callable": "snakesAndLadders",
"parameters": [
{
"name": "board",
"type": "number[][]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/... |
910 | smallest-range-ii | Medium | You are given an integer array nums and an integer k.
For each index i where 0 <= i < nums.length, change nums[i] to be either nums[i] + k or nums[i] - k.
The score of nums is the difference between the maximum and minimum elements in nums.
Return the minimum score of nums after changing the values at each index.
E... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums = [0, 10],k = 2) == 6\n assert candidate(nums = [1, 5, 8],k = 2) == 3\n assert candidate(nums = [6, 3, 4, 7],k = 3) == 4\n assert candidate(nums = [6, 3, 2, 18, 9, 12, 3, 6, 5, 0],k = 6) == 9\n assert candidate(nums = [4... | [
"[1]\n0",
"[0,10]\n2",
"[1,3,6]\n3"
] | [] | {
"canonical_parameter_names": [
"nums",
"k"
],
"leetcode_dataset_entry_point": "Solution().smallestRangeII",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:54",
"tests_total": 107,... | typescript | {
"raw_signature": "function smallestRangeII(nums: number[], k: number): number {",
"container": null,
"callable": "smallestRangeII",
"parameters": [
{
"name": "nums",
"type": "number[]"
},
{
"name": "k",
"type": "number"
}
],
"return_type": "number",
"signature_sou... |
913 | cat-and-mouse | Hard | A game on an undirected graph is played by two players, Mouse and Cat, who alternate turns.
The graph is given as follows: graph[a] is a list of all nodes b such that ab is an edge of the graph.
The mouse starts at node 1 and goes first, the cat starts at node 2 and goes second, and there is a hole at node 0.
During... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(graph = [[3, 4], [3, 5], [3], [0, 1, 2], [0], [1]]) == 2\n assert candidate(graph = [[2, 3, 4], [3, 4], [0, 3, 4], [0, 1, 2], [0, 1, 2]]) == 2\n assert candidate(graph = [[6], [4], [9, 6], [5, 6, 7, 9], [1, 5], [3, 4], [0, 2, 3, 7]... | [
"[[2,5],[3],[0,4,5],[1,4,5],[2,3],[0,2,3]]",
"[[1,3],[0],[3],[0,2]]"
] | [] | {
"canonical_parameter_names": [
"graph"
],
"leetcode_dataset_entry_point": "Solution().catMouseGame",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:03:58",
"tests_total": 63,
"tests_dr... | typescript | {
"raw_signature": "function catMouseGame(graph: number[][]): number {",
"container": null,
"callable": "catMouseGame",
"parameters": [
{
"name": "graph",
"type": "number[][]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnip... |
914 | x-of-a-kind-in-a-deck-of-cards | Easy | You are given an integer array deck where deck[i] represents the number written on the i^th card.
Partition the cards into one or more groups such that:
- Each group has exactly x cards where x > 1, and
- All the cards in one group have the same integer written on them.
Return true if such partition is possible, or ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(deck = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == True\n assert candidate(deck = [1, 1, 1, 1, 2, 2, 2, 2, 2, 2]) == True\n assert candidate(deck = [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3]) == True\n assert candidate(deck = [1, 1, 2, 2... | [
"[1,2,3,4,4,3,2,1]",
"[1,1,1,2,2,2,3,3]"
] | [] | {
"canonical_parameter_names": [
"deck"
],
"leetcode_dataset_entry_point": "Solution().hasGroupsSizeX",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:00",
"tests_total": 113,
"tests_... | typescript | {
"raw_signature": "function hasGroupsSizeX(deck: number[]): boolean {",
"container": null,
"callable": "hasGroupsSizeX",
"parameters": [
{
"name": "deck",
"type": "number[]"
}
],
"return_type": "boolean",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnip... |
915 | partition-array-into-disjoint-intervals | Medium | Given an integer array nums, partition it into two (contiguous) subarrays left and right so that:
- Every element in left is less than or equal to every element in right.
- left and right are non-empty.
- left has the smallest possible size.
Return the length of left after such a partitioning.
Test cases are generat... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums = [1, 3, 2, 4, 5]) == 1\n assert candidate(nums = [1, 2, 3, 0, 4, 5, 6, 7, 8, 9]) == 4\n assert candidate(nums = [1, 2, 1, 2, 1, 2, 1, 2]) == 1\n assert candidate(nums = [1, 1, 1, 0, 6, 12]) == 4\n assert candidate(nums ... | [
"[5,0,3,8,6]",
"[1,1,1,0,6,12]"
] | [] | {
"canonical_parameter_names": [
"nums"
],
"leetcode_dataset_entry_point": "Solution().partitionDisjoint",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:02",
"tests_total": 95,
"test... | typescript | {
"raw_signature": "function partitionDisjoint(nums: number[]): number {",
"container": null,
"callable": "partitionDisjoint",
"parameters": [
{
"name": "nums",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/code... |
916 | word-subsets | Medium | You are given two string arrays words1 and words2.
A string b is a subset of string a if every letter in b occurs in a including multiplicity.
- For example, "wrr" is a subset of "warrior" but is not a subset of "world".
A string a from words1 is universal if for every string b in words2, b is a subset of a.
Return... | {
"language": "python",
"source": "def answers_match(result, expected):\n \"\"\"The answer may list its items in any order (only the top-level order is free).\"\"\"\n if isinstance(result, list) and isinstance(expected, list):\n return sorted(result, key=repr) == sorted(expected, key=repr)\n return ... | [
"[\"amazon\",\"apple\",\"facebook\",\"google\",\"leetcode\"]\n[\"e\",\"o\"]",
"[\"amazon\",\"apple\",\"facebook\",\"google\",\"leetcode\"]\n[\"lc\",\"eo\"]",
"[\"acaac\",\"cccbb\",\"aacbb\",\"caacc\",\"bcbbb\"]\n[\"c\",\"cc\",\"b\"]"
] | [] | {
"canonical_parameter_names": [
"words1",
"words2"
],
"leetcode_dataset_entry_point": "Solution().wordSubsets",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:04",
"tests_total": 6... | typescript | {
"raw_signature": "function wordSubsets(words1: string[], words2: string[]): string[] {",
"container": null,
"callable": "wordSubsets",
"parameters": [
{
"name": "words1",
"type": "string[]"
},
{
"name": "words2",
"type": "string[]"
}
],
"return_type": "string[]",
... |
917 | reverse-only-letters | Easy | Given a string s, reverse the string according to the following rules:
- All the characters that are not English letters remain in the same position.
- All the English letters (lowercase or uppercase) should be reversed.
Return s after reversing it.
Example 1:
Input: s = "ab-cd"
Output: "dc-ba"
Example 2:
Input: ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(s = \"s-123-p\") == \"p-123-s\"\n assert candidate(s = \"Test1ng-Leet=code-Q!\") == \"Qedo1ct-eeLg=ntse-T!\"\n assert candidate(s = \"-a-b-\") == \"-b-a-\"\n assert candidate(s = \"a-bC-dEf-ghIj\") == \"j-Ih-gfE-dCba\"\n asse... | [
"\"ab-cd\"",
"\"a-bC-dEf-ghIj\"",
"\"Test1ng-Leet=code-Q!\""
] | [
"This problem is exactly like reversing a normal string except that there are certain characters that we have to simply skip. That should be easy enough to do if you know how to reverse a string using the two-pointer approach."
] | {
"canonical_parameter_names": [
"s"
],
"leetcode_dataset_entry_point": "Solution().reverseOnlyLetters",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:07",
"tests_total": 98,
"tests_... | typescript | {
"raw_signature": "function reverseOnlyLetters(s: string): string {",
"container": null,
"callable": "reverseOnlyLetters",
"parameters": [
{
"name": "s",
"type": "string"
}
],
"return_type": "string",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets... |
918 | maximum-sum-circular-subarray | Medium | Given a circular integer array nums of length n, return the maximum possible sum of a non-empty subarray of nums.
A circular array means the end of the array connects to the beginning of the array. Formally, the next element of nums[i] is nums[(i + 1) % n] and the previous element of nums[i] is nums[(i - 1 + n) % n].
... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums = [1, -2, 3, -2]) == 3\n assert candidate(nums = [10, -2, 5, 1, -4, 3, -1]) == 16\n assert candidate(nums = [2, 3, -4, 5, 7]) == 17\n assert candidate(nums = [5, -3, 5]) == 10\n assert candidate(nums = [3, -1, 2, -1]) ==... | [
"[1,-2,3,-2]",
"[5,-3,5]",
"[-3,-2,-3]"
] | [
"For those of you who are familiar with the Kadane's algorithm, think in terms of that. For the newbies, Kadane's algorithm is used to finding the maximum sum subarray from a given array. This problem is a twist on that idea and it is advisable to read up on that algorithm first before starting this problem. Unless... | {
"canonical_parameter_names": [
"nums"
],
"leetcode_dataset_entry_point": "Solution().maxSubarraySumCircular",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:09",
"tests_total": 117,
... | typescript | {
"raw_signature": "function maxSubarraySumCircular(nums: number[]): number {",
"container": null,
"callable": "maxSubarraySumCircular",
"parameters": [
{
"name": "nums",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "lee... |
920 | number-of-music-playlists | Hard | Your music player contains n different songs. You want to listen to goal songs (not necessarily different) during your trip. To avoid boredom, you will create a playlist so that:
- Every song is played at least once.
- A song can only be played again only if k other songs have been played.
Given n, goal, and k, retur... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(n = 5,goal = 5,k = 2) == 120\n assert candidate(n = 3,goal = 4,k = 1) == 18\n assert candidate(n = 4,goal = 6,k = 2) == 168\n assert candidate(n = 3,goal = 3,k = 1) == 6\n assert candidate(n = 2,goal = 3,k = 1) == 2\n asse... | [
"3\n3\n1",
"2\n3\n0",
"2\n3\n1"
] | [] | {
"canonical_parameter_names": [
"n",
"goal",
"k"
],
"leetcode_dataset_entry_point": "Solution().numMusicPlaylists",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:11",
"tests_t... | typescript | {
"raw_signature": "function numMusicPlaylists(n: number, goal: number, k: number): number {",
"container": null,
"callable": "numMusicPlaylists",
"parameters": [
{
"name": "n",
"type": "number"
},
{
"name": "goal",
"type": "number"
},
{
"name": "k",
"type... |
921 | minimum-add-to-make-parentheses-valid | Medium | A parentheses string is valid if and only if:
- It is the empty string,
- It can be written as AB (A concatenated with B), where A and B are valid strings, or
- It can be written as (A), where A is a valid string.
You are given a parentheses string s. In one move, you can insert a parenthesis at any position of the s... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(s = \"(()))\") == 1\n assert candidate(s = \"())\") == 1\n assert candidate(s = \"()\") == 0\n assert candidate(s = \"((((((()))\") == 4\n assert candidate(s = \"())(()\") == 2\n assert candidate(s = \"((()))\") == 0\n ... | [
"\"())\"",
"\"(((\""
] | [] | {
"canonical_parameter_names": [
"s"
],
"leetcode_dataset_entry_point": "Solution().minAddToMakeValid",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:13",
"tests_total": 115,
"tests_... | typescript | {
"raw_signature": "function minAddToMakeValid(s: string): number {",
"container": null,
"callable": "minAddToMakeValid",
"parameters": [
{
"name": "s",
"type": "string"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets"
... |
922 | sort-array-by-parity-ii | Easy | Given an array of integers nums, half of the integers in nums are odd, and the other half are even.
Sort the array so that whenever nums[i] is odd, i is odd, and whenever nums[i] is even, i is even.
Return any answer array that satisfies this condition.
Example 1:
Input: nums = [4,2,5,7]
Output: [4,5,2,7]
Explanati... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums = [2, 3, 6, 7]) == [2, 3, 6, 7]\n assert candidate(nums = [2, 3]) == [2, 3]\n assert candidate(nums = [0, 1, 2, 3, 4, 5, 6, 7]) == [0, 1, 2, 3, 4, 5, 6, 7]\n assert candidate(nums = [8, 11, 6, 9, 5, 10, 7, 2]) == [8, 11, 6,... | [
"[4,2,5,7]",
"[2,3]"
] | [] | {
"canonical_parameter_names": [
"nums"
],
"leetcode_dataset_entry_point": "Solution().sortArrayByParityII",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:15",
"tests_total": 81,
"te... | typescript | {
"raw_signature": "function sortArrayByParityII(nums: number[]): number[] {",
"container": null,
"callable": "sortArrayByParityII",
"parameters": [
{
"name": "nums",
"type": "number[]"
}
],
"return_type": "number[]",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetc... |
923 | 3sum-with-multiplicity | Medium | Given an integer array arr, and an integer target, return the number of tuples i, j, k such that i < j < k and arr[i] + arr[j] + arr[k] == target.
As the answer can be very large, return it modulo 10^9 + 7.
Example 1:
Input: arr = [1,1,2,2,3,3,4,4,5,5], target = 8
Output: 20
Explanation:
Enumerating by the values (a... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],target = 18) == 11\n assert candidate(arr = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5],target = 10) == 74\n assert candidate(arr = [1, 2, 3, 4, 5, 6, 7, 8, 9],target = 15) == 8\n asser... | [
"[1,1,2,2,3,3,4,4,5,5]\n8",
"[1,1,2,2,2,2]\n5",
"[2,1,3]\n6"
] | [] | {
"canonical_parameter_names": [
"arr",
"target"
],
"leetcode_dataset_entry_point": "Solution().threeSumMulti",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:18",
"tests_total": 87... | typescript | {
"raw_signature": "function threeSumMulti(arr: number[], target: number): number {",
"container": null,
"callable": "threeSumMulti",
"parameters": [
{
"name": "arr",
"type": "number[]"
},
{
"name": "target",
"type": "number"
}
],
"return_type": "number",
"signature... |
924 | minimize-malware-spread | Hard | You are given a network of n nodes represented as an n x n adjacency matrix graph, where the i^th node is directly connected to the j^th node if graph[i][j] == 1.
Some nodes initial are initially infected by malware. Whenever two nodes are directly connected, and at least one of those two nodes is infected by malware,... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(graph = [[1, 1, 1, 1], [1, 1, 0, 0], [1, 0, 1, 1], [1, 0, 1, 1]],initial = [0, 1, 2, 3]) == 0\n assert candidate(graph = [[1, 1, 0, 0], [1, 1, 1, 0], [0, 1, 1, 1], [0, 0, 1, 1]],initial = [0, 1]) == 0\n assert candidate(graph = [[1... | [
"[[1,1,0],[1,1,0],[0,0,1]]\n[0,1]",
"[[1,0,0],[0,1,0],[0,0,1]]\n[0,2]",
"[[1,1,1],[1,1,1],[1,1,1]]\n[1,2]"
] | [] | {
"canonical_parameter_names": [
"graph",
"initial"
],
"leetcode_dataset_entry_point": "Solution().minMalwareSpread",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:20",
"tests_tota... | typescript | {
"raw_signature": "function minMalwareSpread(graph: number[][], initial: number[]): number {",
"container": null,
"callable": "minMalwareSpread",
"parameters": [
{
"name": "graph",
"type": "number[][]"
},
{
"name": "initial",
"type": "number[]"
}
],
"return_type": "n... |
925 | long-pressed-name | Easy | Your friend is typing his name into a keyboard. Sometimes, when typing a character c, the key might get long pressed, and the character will be typed 1 or more times.
You examine the typed characters of the keyboard. Return True if it is possible that it was your friends name, with some characters (possibly none) bein... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(name = \"zzzzzzzz\",typed = \"zzzzzzzz\") == True\n assert candidate(name = \"abcd\",typed = \"abcde\") == False\n assert candidate(name = \"test\",typed = \"ttest\") == True\n assert candidate(name = \"dfuyalc\",typed = \"fuuya... | [
"\"alex\"\n\"aaleex\"",
"\"saeed\"\n\"ssaaedd\""
] | [] | {
"canonical_parameter_names": [
"name",
"typed"
],
"leetcode_dataset_entry_point": "Solution().isLongPressedName",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:22",
"tests_total"... | typescript | {
"raw_signature": "function isLongPressedName(name: string, typed: string): boolean {",
"container": null,
"callable": "isLongPressedName",
"parameters": [
{
"name": "name",
"type": "string"
},
{
"name": "typed",
"type": "string"
}
],
"return_type": "boolean",
"sig... |
926 | flip-string-to-monotone-increasing | Medium | A binary string is monotone increasing if it consists of some number of 0's (possibly none), followed by some number of 1's (also possibly none).
You are given a binary string s. You can flip s[i] changing it from 0 to 1 or from 1 to 0.
Return the minimum number of flips to make s monotone increasing.
Example 1:
In... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(s = \"1100110\") == 3\n assert candidate(s = \"1111000011110000\") == 8\n assert candidate(s = \"101010101\") == 4\n assert candidate(s = \"111000111000\") == 6\n assert candidate(s = \"000100110\") == 2\n assert candidate... | [
"\"00110\"",
"\"010110\"",
"\"00011000\""
] | [] | {
"canonical_parameter_names": [
"s"
],
"leetcode_dataset_entry_point": "Solution().minFlipsMonoIncr",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:24",
"tests_total": 143,
"tests_d... | typescript | {
"raw_signature": "function minFlipsMonoIncr(s: string): number {",
"container": null,
"callable": "minFlipsMonoIncr",
"parameters": [
{
"name": "s",
"type": "string"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets"
} |
927 | three-equal-parts | Hard | You are given an array arr which consists of only zeros and ones, divide the array into three non-empty parts such that all of these parts represent the same binary value.
If it is possible, return any [i, j] with i + 1 < j, such that:
- arr[0], arr[1], ..., arr[i] is the first part,
- arr[i + 1], arr[i + 2], ..., ar... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(arr = [1, 0, 1, 0, 1]) == [0, 3]\n assert candidate(arr = [0, 0, 0]) == [0, 2]\n assert candidate(arr = [1, 1, 0, 1, 1]) == [-1, -1]\n assert candidate(arr = [1, 1, 1, 0, 0, 1, 1, 1]) == [-1, -1]\n assert candidate(arr = [1, ... | [
"[1,0,1,0,1]",
"[1,1,0,1,1]",
"[1,1,0,0,1]"
] | [] | {
"canonical_parameter_names": [
"arr"
],
"leetcode_dataset_entry_point": "Solution().threeEqualParts",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:26",
"tests_total": 99,
"tests_d... | typescript | {
"raw_signature": "function threeEqualParts(arr: number[]): number[] {",
"container": null,
"callable": "threeEqualParts",
"parameters": [
{
"name": "arr",
"type": "number[]"
}
],
"return_type": "number[]",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSn... |
928 | minimize-malware-spread-ii | Hard | You are given a network of n nodes represented as an n x n adjacency matrix graph, where the i^th node is directly connected to the j^th node if graph[i][j] == 1.
Some nodes initial are initially infected by malware. Whenever two nodes are directly connected, and at least one of those two nodes is infected by malware,... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(graph = [[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 1, 0], [0, 0, 1, 1, 1], [0, 0, 0, 1, 1]],initial = [3, 4]) == 3\n assert candidate(graph = [[1, 1, 0, 0], [1, 1, 1, 0], [0, 1, 1, 1], [0, 0, 1, 1]],initial = [0, 1]) == 1\n asser... | [
"[[1,1,0],[1,1,0],[0,0,1]]\n[0,1]",
"[[1,1,0],[1,1,1],[0,1,1]]\n[0,1]",
"[[1,1,0,0],[1,1,1,0],[0,1,1,1],[0,0,1,1]]\n[0,1]"
] | [] | {
"canonical_parameter_names": [
"graph",
"initial"
],
"leetcode_dataset_entry_point": "Solution().minMalwareSpread",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:29",
"tests_tota... | typescript | {
"raw_signature": "function minMalwareSpread(graph: number[][], initial: number[]): number {",
"container": null,
"callable": "minMalwareSpread",
"parameters": [
{
"name": "graph",
"type": "number[][]"
},
{
"name": "initial",
"type": "number[]"
}
],
"return_type": "n... |
929 | unique-email-addresses | Easy | Every valid email consists of a local name and a domain name, separated by the '@' sign. Besides lowercase letters, the email may contain one or more '.' or '+'.
- For example, in "alice@leetcode.com", "alice" is the local name, and "leetcode.com" is the domain name.
If you add periods '.' between some characters in ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(emails = ['user.name+foo@hostname.com', 'user.name+bar@hostname.com', 'user.name@hostname.com']) == 1\n assert candidate(emails = ['m.y+name@email.com', 'my.name@email.com', 'myname@email.com']) == 2\n assert candidate(emails = ['m... | [
"[\"test.email+alex@leetcode.com\",\"test.e.mail+bob.cathy@leetcode.com\",\"testemail+david@lee.tcode.com\"]",
"[\"a@leetcode.com\",\"b@leetcode.com\",\"c@leetcode.com\"]"
] | [] | {
"canonical_parameter_names": [
"emails"
],
"leetcode_dataset_entry_point": "Solution().numUniqueEmails",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:31",
"tests_total": 104,
"tes... | typescript | {
"raw_signature": "function numUniqueEmails(emails: string[]): number {",
"container": null,
"callable": "numUniqueEmails",
"parameters": [
{
"name": "emails",
"type": "string[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/code... |
930 | binary-subarrays-with-sum | Medium | Given a binary array nums and an integer goal, return the number of non-empty subarrays with a sum goal.
A subarray is a contiguous part of the array.
Example 1:
Input: nums = [1,0,1,0,1], goal = 2
Output: 4
Explanation: The 4 subarrays are bolded and underlined below:
[1,0,1,0,1]
[1,0,1,0,1]
[1,0,1,0,1]
[1,0,1,0,1]... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums = [1, 0, 1, 1, 0],goal = 1) == 6\n assert candidate(nums = [1, 0, 1, 0, 1, 0, 1],goal = 2) == 8\n assert candidate(nums = [0, 0, 0, 0, 0],goal = 0) == 15\n assert candidate(nums = [1, 0, 1, 0, 1],goal = 2) == 4\n assert ... | [
"[1,0,1,0,1]\n2",
"[0,0,0,0,0]\n0"
] | [
"Can you transform the problem into finding two prefix sums whose difference equals goal?",
"While iterating through the array, keep track of how many times each prefix sum has appeared so far.",
"If the current prefix sum is curr, how many previous prefix sums equal to curr - goal exist?"
] | {
"canonical_parameter_names": [
"nums",
"goal"
],
"leetcode_dataset_entry_point": "Solution().numSubarraysWithSum",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:33",
"tests_total... | typescript | {
"raw_signature": "function numSubarraysWithSum(nums: number[], goal: number): number {",
"container": null,
"callable": "numSubarraysWithSum",
"parameters": [
{
"name": "nums",
"type": "number[]"
},
{
"name": "goal",
"type": "number"
}
],
"return_type": "number",
... |
931 | minimum-falling-path-sum | Medium | Given an n x n array of integers matrix, return the minimum sum of any falling path through matrix.
A falling path starts at any element in the first row and chooses the element in the next row that is either directly below or diagonally left/right. Specifically, the next element from position (row, col) will be (row ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(matrix = [[100, -100, 100], [-100, 100, -100], [100, -100, 100]]) == -300\n assert candidate(matrix = [[-1, -2, -3], [-4, -5, -6], [-7, -8, -9]]) == -18\n assert candidate(matrix = [[-19, 57], [-40, -5]]) == -59\n assert candida... | [
"[[2,1,3],[6,5,4],[7,8,9]]",
"[[-19,57],[-40,-5]]"
] | [] | {
"canonical_parameter_names": [
"matrix"
],
"leetcode_dataset_entry_point": "Solution().minFallingPathSum",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:35",
"tests_total": 79,
"te... | typescript | {
"raw_signature": "function minFallingPathSum(matrix: number[][]): number {",
"container": null,
"callable": "minFallingPathSum",
"parameters": [
{
"name": "matrix",
"type": "number[][]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetc... |
932 | beautiful-array | Medium | An array nums of length n is beautiful if:
- nums is a permutation of the integers in the range [1, n].
- For every 0 <= i < j < n, there is no index k with i < k < j where 2 * nums[k] == nums[i] + nums[j].
Given the integer n, return any beautiful array nums of length n. There will be at least one valid answer for t... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(n = 11) == [1, 9, 5, 3, 11, 7, 2, 10, 6, 4, 8]\n assert candidate(n = 15) == [1, 9, 5, 13, 3, 11, 7, 15, 2, 10, 6, 14, 4, 12, 8]\n assert candidate(n = 4) == [1, 3, 2, 4]\n assert candidate(n = 64) == [1, 33, 17, 49, 9, 41, 25, ... | [
"4",
"5"
] | [] | {
"canonical_parameter_names": [
"n"
],
"leetcode_dataset_entry_point": "Solution().beautifulArray",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:37",
"tests_total": 58,
"tests_drop... | typescript | {
"raw_signature": "function beautifulArray(n: number): number[] {",
"container": null,
"callable": "beautifulArray",
"parameters": [
{
"name": "n",
"type": "number"
}
],
"return_type": "number[]",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets"
} |
934 | shortest-bridge | Medium | You are given an n x n binary matrix grid where 1 represents land and 0 represents water.
An island is a 4-directionally connected group of 1's not connected to any other 1's. There are exactly two islands in grid.
You may change 0's to 1's to connect the two islands to form one island.
Return the smallest number of... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(grid = [[0, 1], [1, 0]]) == 1\n assert candidate(grid = [[0, 1, 0], [0, 0, 0], [0, 0, 1]]) == 2\n assert candidate(grid = [[0, 0, 0, 1, 1], [0, 0, 0, 1, 0], [0, 0, 1, 0, 0], [0, 1, 0, 0, 0], [1, 0, 0, 0, 0]]) == 1\n assert candi... | [
"[[0,1],[1,0]]",
"[[0,1,0],[0,0,0],[0,0,1]]",
"[[1,1,1,1,1],[1,0,0,0,1],[1,0,1,0,1],[1,0,0,0,1],[1,1,1,1,1]]"
] | [] | {
"canonical_parameter_names": [
"grid"
],
"leetcode_dataset_entry_point": "Solution().shortestBridge",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:40",
"tests_total": 52,
"tests_d... | typescript | {
"raw_signature": "function shortestBridge(grid: number[][]): number {",
"container": null,
"callable": "shortestBridge",
"parameters": [
{
"name": "grid",
"type": "number[][]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSn... |
935 | knight-dialer | Medium | The chess knight has a unique movement, it may move two squares vertically and one square horizontally, or two squares horizontally and one square vertically (with both forming the shape of an L). The possible movements of chess knight are shown in this diagram:
A chess knight can move as indicated in the chess diagra... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(n = 3) == 46\n assert candidate(n = 100) == 540641702\n assert candidate(n = 50) == 267287516\n assert candidate(n = 2500) == 851996060\n assert candidate(n = 5000) == 406880451\n assert candidate(n = 2) == 20\n assert ... | [
"1",
"2",
"3131"
] | [] | {
"canonical_parameter_names": [
"n"
],
"leetcode_dataset_entry_point": "Solution().knightDialer",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:42",
"tests_total": 42,
"tests_droppe... | typescript | {
"raw_signature": "function knightDialer(n: number): number {",
"container": null,
"callable": "knightDialer",
"parameters": [
{
"name": "n",
"type": "number"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets"
} |
936 | stamping-the-sequence | Hard | You are given two strings stamp and target. Initially, there is a string s of length target.length with all s[i] == '?'.
In one turn, you can place stamp over s and replace every letter in the s with the corresponding letter from stamp.
- For example, if stamp = "abc" and target = "abcba", then s is "?????" initially... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(stamp = \"world\",target = \"worldworldworld\") == [9, 8, 7, 6, 4, 3, 2, 1, 10, 5, 0]\n assert candidate(stamp = \"abc\",target = \"abcababcbcababc\") == [11, 9, 8, 6, 4, 2, 1, 10, 7, 3, 12, 5, 0]\n assert candidate(stamp = \"abcde... | [
"\"abc\"\n\"ababc\"",
"\"abca\"\n\"aabcaca\""
] | [] | {
"canonical_parameter_names": [
"stamp",
"target"
],
"leetcode_dataset_entry_point": "Solution().movesToStamp",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:44",
"tests_total": 8... | typescript | {
"raw_signature": "function movesToStamp(stamp: string, target: string): number[] {",
"container": null,
"callable": "movesToStamp",
"parameters": [
{
"name": "stamp",
"type": "string"
},
{
"name": "target",
"type": "string"
}
],
"return_type": "number[]",
"signatu... |
937 | reorder-data-in-log-files | Medium | You are given an array of logs. Each log is a space-delimited string of words, where the first word is the identifier.
There are two types of logs:
- Letter-logs: All words (except the identifier) consist of lowercase English letters.
- Digit-logs: All words (except the identifier) consist of digits.
Reorder these l... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(logs = ['dig1 8 1 5 1', 'let1 art can', 'dig2 3 6', 'let2 own kit dig', 'let3 art zero']) == ['let1 art can', 'let3 art zero', 'let2 own kit dig', 'dig1 8 1 5 1', 'dig2 3 6']\n assert candidate(logs = ['a1 9 2 3 1', 'g1 act car', 'zo4... | [
"[\"0 pmz\", \"4 q j\", \"g 89\", \"t v p\", \"w ugr\"]",
"[\"2 08\", \"f 09\", \"v wc\", \"o z c\", \"u 14\"]"
] | [] | {
"canonical_parameter_names": [
"logs"
],
"leetcode_dataset_entry_point": "Solution().reorderLogFiles",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:46",
"tests_total": 53,
"tests_... | typescript | {
"raw_signature": "function reorderLogFiles(logs: string[]): string[] {",
"container": null,
"callable": "reorderLogFiles",
"parameters": [
{
"name": "logs",
"type": "string[]"
}
],
"return_type": "string[]",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/code... |
939 | minimum-area-rectangle | Medium | You are given an array of points in the X-Y plane points where points[i] = [x_i, y_i].
Return the minimum area of a rectangle formed from these points, with sides parallel to the X and Y axes. If there is not any such rectangle, return 0.
Example 1:
Input: points = [[1,1],[1,3],[3,1],[3,3],[2,2]]
Output: 4
Example ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(points = [[0, 0], [0, 1], [1, 0], [1, 1], [2, 2], [2, 3]]) == 1\n assert candidate(points = [[1, 1], [1, 3], [3, 1], [3, 3], [4, 1], [4, 3]]) == 2\n assert candidate(points = [[1, 1], [1, 3], [3, 1], [3, 3], [2, 2]]) == 4\n asse... | [
"[[1,1],[1,3],[3,1],[3,3],[2,2]]",
"[[1,1],[1,3],[3,1],[3,3],[4,1],[4,3]]"
] | [] | {
"canonical_parameter_names": [
"points"
],
"leetcode_dataset_entry_point": "Solution().minAreaRect",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:50",
"tests_total": 81,
"tests_dr... | typescript | {
"raw_signature": "function minAreaRect(points: number[][]): number {",
"container": null,
"callable": "minAreaRect",
"parameters": [
{
"name": "points",
"type": "number[][]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnip... |
940 | distinct-subsequences-ii | Hard | Given a string s, return the number of distinct non-empty subsequences of s. Since the answer may be very large, return it modulo 10^9 + 7.
A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(s = \"abcdefghijklmnopqrstuvwxyz\") == 67108863\n assert candidate(s = \"abac\") == 13\n assert candidate(s = \"abababababababababab\") == 28655\n assert candidate(s = \"a\") == 1\n assert candidate(s = \"abracadabra\") == 13... | [
"\"abc\"",
"\"aba\"",
"\"aaa\""
] | [] | {
"canonical_parameter_names": [
"s"
],
"leetcode_dataset_entry_point": "Solution().distinctSubseqII",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:53",
"tests_total": 53,
"tests_dr... | typescript | {
"raw_signature": "function distinctSubseqII(s: string): number {",
"container": null,
"callable": "distinctSubseqII",
"parameters": [
{
"name": "s",
"type": "string"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets"
} |
941 | valid-mountain-array | Easy | Given an array of integers arr, return true if and only if it is a valid mountain array.
Recall that arr is a mountain array if and only if:
- arr.length >= 3
- There exists some i with 0 < i < arr.length - 1 such that:
- arr[0] < arr[1] < ... < arr[i - 1] < arr[i]
- arr[i] > arr[i + 1] > ... > arr[arr.length - 1... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(arr = [5, 4, 3, 2, 1]) == False\n assert candidate(arr = [9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) == False\n assert candidate(arr = [3, 1, 2]) == False\n assert candidate(arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == True... | [
"[2,1]",
"[3,5,5]",
"[0,3,2,1]"
] | [
"It's very easy to keep track of a monotonically increasing or decreasing ordering of elements. You just need to be able to determine the start of the valley in the mountain and from that point onwards, it should be a valley i.e. no mini-hills after that. Use this information in regards to the values in the array a... | {
"canonical_parameter_names": [
"arr"
],
"leetcode_dataset_entry_point": "Solution().validMountainArray",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:55",
"tests_total": 141,
"tes... | typescript | {
"raw_signature": "function validMountainArray(arr: number[]): boolean {",
"container": null,
"callable": "validMountainArray",
"parameters": [
{
"name": "arr",
"type": "number[]"
}
],
"return_type": "boolean",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/co... |
942 | di-string-match | Easy | A permutation perm of n + 1 integers of all the integers in the range [0, n] can be represented as a string s of length n where:
- s[i] == 'I' if perm[i] < perm[i + 1], and
- s[i] == 'D' if perm[i] > perm[i + 1].
Given a string s, reconstruct the permutation perm and return it. If there are multiple valid permutation... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(s = \"DDI\") == [3, 2, 0, 1]\n assert candidate(s = \"DDIDDI\") == [6, 5, 0, 4, 3, 1, 2]\n assert candidate(s = \"IDDD\") == [0, 4, 3, 2, 1]\n assert candidate(s = \"DDDDDDDD\") == [8, 7, 6, 5, 4, 3, 2, 1, 0]\n assert candida... | [
"\"IDID\"",
"\"III\"",
"\"DDI\""
] | [] | {
"canonical_parameter_names": [
"s"
],
"leetcode_dataset_entry_point": "Solution().diStringMatch",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:57",
"tests_total": 157,
"tests_drop... | typescript | {
"raw_signature": "function diStringMatch(s: string): number[] {",
"container": null,
"callable": "diStringMatch",
"parameters": [
{
"name": "s",
"type": "string"
}
],
"return_type": "number[]",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippets"
} |
943 | find-the-shortest-superstring | Hard | Given an array of strings words, return the smallest string that contains each string in words as a substring. If there are multiple valid strings of the smallest length, return any of them.
You may assume that no string in words is a substring of another string in words.
Example 1:
Input: words = ["alex","loves","l... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(words = ['a', 'ab', 'abc']) == \"abc\"\n assert candidate(words = ['abcde', 'bcdef', 'cdefg']) == \"abcdefg\"\n assert candidate(words = ['a', 'b', 'c']) == \"abc\"\n assert candidate(words = ['shortest', 'superstring', 'string'... | [
"[\"alex\",\"loves\",\"leetcode\"]",
"[\"catg\",\"ctaagt\",\"gcta\",\"ttca\",\"atgcatc\"]"
] | [] | {
"canonical_parameter_names": [
"words"
],
"leetcode_dataset_entry_point": "Solution().shortestSuperstring",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:04:59",
"tests_total": 96,
"t... | typescript | {
"raw_signature": "function shortestSuperstring(words: string[]): string {",
"container": null,
"callable": "shortestSuperstring",
"parameters": [
{
"name": "words",
"type": "string[]"
}
],
"return_type": "string",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcod... |
944 | delete-columns-to-make-sorted | Easy | You are given an array of n strings strs, all of the same length.
The strings can be arranged such that there is one on each line, making a grid.
- For example, strs = ["abc", "bce", "cae"] can be arranged as follows:
abc
bce
cae
You want to delete the columns that are not sorted lexicographically. In the above exa... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(strs = ['zaz', 'zbz', 'zcz']) == 0\n assert candidate(strs = ['a', 'b']) == 0\n assert candidate(strs = ['zzz', 'zzz', 'zzz']) == 0\n assert candidate(strs = ['xyz', 'yza', 'zab']) == 2\n assert candidate(strs = ['abc', 'bcd'... | [
"[\"cba\",\"daf\",\"ghi\"]",
"[\"a\",\"b\"]",
"[\"zyx\",\"wvu\",\"tsr\"]"
] | [] | {
"canonical_parameter_names": [
"strs"
],
"leetcode_dataset_entry_point": "Solution().minDeletionSize",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:01",
"tests_total": 99,
"tests_... | typescript | {
"raw_signature": "function minDeletionSize(strs: string[]): number {",
"container": null,
"callable": "minDeletionSize",
"parameters": [
{
"name": "strs",
"type": "string[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnip... |
945 | minimum-increment-to-make-array-unique | Medium | You are given an integer array nums. In one move, you can pick an index i where 0 <= i < nums.length and increment nums[i] by 1.
Return the minimum number of moves to make every value in nums unique.
The test cases are generated so that the answer fits in a 32-bit integer.
Example 1:
Input: nums = [1,2,2]
Output: 1... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums = [1, 1, 2, 2, 3, 3, 4, 4]) == 16\n assert candidate(nums = [10, 10, 10, 10, 10, 10, 10, 10, 10, 10]) == 45\n assert candidate(nums = [5, 3, 5, 3, 5]) == 4\n assert candidate(nums = [1, 2, 2]) == 1\n assert candidate(num... | [
"[1,2,2]",
"[3,2,1,2,1,7]"
] | [] | {
"canonical_parameter_names": [
"nums"
],
"leetcode_dataset_entry_point": "Solution().minIncrementForUnique",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:04",
"tests_total": 104,
... | typescript | {
"raw_signature": "function minIncrementForUnique(nums: number[]): number {",
"container": null,
"callable": "minIncrementForUnique",
"parameters": [
{
"name": "nums",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetc... |
946 | validate-stack-sequences | Medium | Given two integer arrays pushed and popped each with distinct values, return true if this could have been the result of a sequence of push and pop operations on an initially empty stack, or false otherwise.
Example 1:
Input: pushed = [1,2,3,4,5], popped = [4,5,3,2,1]
Output: true
Explanation: We might do the followin... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(pushed = [1, 2, 3, 4, 5],popped = [4, 5, 3, 2, 1]) == True\n assert candidate(pushed = [2, 1, 0],popped = [0, 1, 2]) == True\n assert candidate(pushed = [1, 2, 3, 4, 5],popped = [1, 3, 2, 5, 4]) == True\n assert candidate(pushed... | [
"[1,2,3,4,5]\n[4,5,3,2,1]",
"[1,2,3,4,5]\n[4,3,5,1,2]"
] | [] | {
"canonical_parameter_names": [
"pushed",
"popped"
],
"leetcode_dataset_entry_point": "Solution().validateStackSequences",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:06",
"test... | typescript | {
"raw_signature": "function validateStackSequences(pushed: number[], popped: number[]): boolean {",
"container": null,
"callable": "validateStackSequences",
"parameters": [
{
"name": "pushed",
"type": "number[]"
},
{
"name": "popped",
"type": "number[]"
}
],
"return_... |
947 | most-stones-removed-with-same-row-or-column | Medium | On a 2D plane, we place n stones at some integer coordinate points. Each coordinate point may have at most one stone.
A stone can be removed if it shares either the same row or the same column as another stone that has not been removed.
Given an array stones of length n where stones[i] = [x_i, y_i] represents the loc... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(stones = [[4, 8], [4, 4], [4, 4], [9, 2], [3, 8], [8, 0], [7, 5], [0, 8], [5, 7], [6, 9], [3, 0], [4, 7], [8, 5], [5, 9], [7, 4], [6, 0], [6, 4], [4, 2], [6, 3]]) == 18\n assert candidate(stones = [[0, 0], [0, 2], [1, 1], [2, 0], [2, ... | [
"[[0,0],[0,1],[1,0],[1,2],[2,1],[2,2]]",
"[[0,0],[0,2],[1,1],[2,0],[2,2]]",
"[[0,0]]"
] | [] | {
"canonical_parameter_names": [
"stones"
],
"leetcode_dataset_entry_point": "Solution().removeStones",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:08",
"tests_total": 100,
"tests_... | typescript | {
"raw_signature": "function removeStones(stones: number[][]): number {",
"container": null,
"callable": "removeStones",
"parameters": [
{
"name": "stones",
"type": "number[][]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSn... |
948 | bag-of-tokens | Medium | You start with an initial power of power, an initial score of 0, and a bag of tokens given as an integer array tokens, where each tokens[i] denotes the value of token_i.
Your goal is to maximize the total score by strategically playing these tokens. In one move, you can play an unplayed token in one of the two ways (b... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(tokens = [100, 200, 300, 400],power = 200) == 2\n assert candidate(tokens = [100, 200, 300, 400],power = 100) == 1\n assert candidate(tokens = [71, 55, 82],power = 54) == 0\n assert candidate(tokens = [100, 200, 300, 400],power ... | [
"[100]\n50",
"[200,100]\n150",
"[100,200,300,400]\n200"
] | [] | {
"canonical_parameter_names": [
"tokens",
"power"
],
"leetcode_dataset_entry_point": "Solution().bagOfTokensScore",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:10",
"tests_total... | typescript | {
"raw_signature": "function bagOfTokensScore(tokens: number[], power: number): number {",
"container": null,
"callable": "bagOfTokensScore",
"parameters": [
{
"name": "tokens",
"type": "number[]"
},
{
"name": "power",
"type": "number"
}
],
"return_type": "number",
... |
949 | largest-time-for-given-digits | Medium | Given an array arr of 4 digits, find the latest 24-hour time that can be made using each digit exactly once.
24-hour times are formatted as "HH:MM", where HH is between 00 and 23, and MM is between 00 and 59. The earliest 24-hour time is 00:00, and the latest is 23:59.
Return the latest 24-hour time in "HH:MM" format... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(arr = [2, 9, 0, 3]) == \"23:09\"\n assert candidate(arr = [1, 9, 6, 0]) == \"19:06\"\n assert candidate(arr = [0, 2, 6, 6]) == \"06:26\"\n assert candidate(arr = [4, 2, 4, 4]) == \"\"\n assert candidate(arr = [2, 2, 9, 6]) ==... | [
"[1,2,3,4]",
"[5,5,5,5]"
] | [] | {
"canonical_parameter_names": [
"arr"
],
"leetcode_dataset_entry_point": "Solution().largestTimeFromDigits",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:13",
"tests_total": 123,
"... | typescript | {
"raw_signature": "function largestTimeFromDigits(arr: number[]): string {",
"container": null,
"callable": "largestTimeFromDigits",
"parameters": [
{
"name": "arr",
"type": "number[]"
}
],
"return_type": "string",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcod... |
950 | reveal-cards-in-increasing-order | Medium | You are given an integer array deck. There is a deck of cards where every card has a unique integer. The integer on the i^th card is deck[i].
You can order the deck in any order you want. Initially, all the cards start face down (unrevealed) in one deck.
You will do the following steps repeatedly until all cards are ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(deck = [10, 1, 6, 7, 8, 2, 3, 4, 5, 9]) == [1, 6, 2, 10, 3, 7, 4, 9, 5, 8]\n assert candidate(deck = [5, 2, 3, 1, 4]) == [1, 5, 2, 4, 3]\n assert candidate(deck = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == [1, 6, 2, 10, 3, 7, 4, 9, 5, 8]\... | [
"[17,13,11,2,3,5,7]",
"[1,1000]"
] | [] | {
"canonical_parameter_names": [
"deck"
],
"leetcode_dataset_entry_point": "Solution().deckRevealedIncreasing",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:15",
"tests_total": 78,
... | typescript | {
"raw_signature": "function deckRevealedIncreasing(deck: number[]): number[] {",
"container": null,
"callable": "deckRevealedIncreasing",
"parameters": [
{
"name": "deck",
"type": "number[]"
}
],
"return_type": "number[]",
"signature_source": "leetcode/codeSnippets",
"type_source": ... |
952 | largest-component-size-by-common-factor | Hard | You are given an integer array of unique positive integers nums. Consider the following graph:
- There are nums.length nodes, labeled nums[0] to nums[nums.length - 1],
- There is an undirected edge between nums[i] and nums[j] if nums[i] and nums[j] share a common factor greater than 1.
Return the size of the largest ... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums = [20, 50, 9, 63]) == 2\n assert candidate(nums = [2, 3, 6, 7, 4, 12, 21, 39]) == 8\n assert candidate(nums = [30, 60, 20, 5, 15]) == 5\n assert candidate(nums = [5, 7, 11, 13]) == 1\n assert candidate(nums = [30, 42, 70... | [
"[4,6,15,35]",
"[20,50,9,63]",
"[2,3,6,7,4,12,21,39]"
] | [] | {
"canonical_parameter_names": [
"nums"
],
"leetcode_dataset_entry_point": "Solution().largestComponentSize",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:19",
"tests_total": 98,
"t... | typescript | {
"raw_signature": "function largestComponentSize(nums: number[]): number {",
"container": null,
"callable": "largestComponentSize",
"parameters": [
{
"name": "nums",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcod... |
953 | verifying-an-alien-dictionary | Easy | In an alien language, surprisingly, they also use English lowercase letters, but possibly in a different order. The order of the alphabet is some permutation of lowercase letters.
Given a sequence of words written in the alien language, and the order of the alphabet, return true if and only if the given words are sort... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(words = ['a', 'b', 'c', 'd', 'e'],order = \"abcdefghijklmnopqrstuvwxyz\") == True\n assert candidate(words = ['kuvp', 'q'],order = \"ngxlkthsjuoqcpavbfdermiyzw\") == True\n assert candidate(words = ['zzz', 'zzzz'],order = \"zyxwvut... | [
"[\"hello\",\"leetcode\"]\n\"hlabcdefgijkmnopqrstuvwxyz\"",
"[\"word\",\"world\",\"row\"]\n\"worldabcefghijkmnpqstuvxyz\"",
"[\"apple\",\"app\"]\n\"abcdefghijklmnopqrstuvwxyz\""
] | [] | {
"canonical_parameter_names": [
"words",
"order"
],
"leetcode_dataset_entry_point": "Solution().isAlienSorted",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:22",
"tests_total": 1... | typescript | {
"raw_signature": "function isAlienSorted(words: string[], order: string): boolean {",
"container": null,
"callable": "isAlienSorted",
"parameters": [
{
"name": "words",
"type": "string[]"
},
{
"name": "order",
"type": "string"
}
],
"return_type": "boolean",
"signa... |
954 | array-of-doubled-pairs | Medium | Given an integer array of even length arr, return true if it is possible to reorder arr such that arr[2 * i + 1] = 2 * arr[2 * i] for every 0 <= i < len(arr) / 2, or false otherwise.
Example 1:
Input: arr = [3,1,3,6]
Output: false
Example 2:
Input: arr = [2,1,2,6]
Output: false
Example 3:
Input: arr = [4,-2,2,-4]... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(arr = [1, 4, 2, 2]) == True\n assert candidate(arr = [1, 2, 4, 16, 8, 4]) == False\n assert candidate(arr = [-5, -2, -10, -1, -1, -5]) == False\n assert candidate(arr = [5, -3, 3, -2, 2, -4]) == False\n assert candidate(arr =... | [
"[3,1,3,6]",
"[2,1,2,6]",
"[4,-2,2,-4]"
] | [] | {
"canonical_parameter_names": [
"arr"
],
"leetcode_dataset_entry_point": "Solution().canReorderDoubled",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:24",
"tests_total": 112,
"test... | typescript | {
"raw_signature": "function canReorderDoubled(arr: number[]): boolean {",
"container": null,
"callable": "canReorderDoubled",
"parameters": [
{
"name": "arr",
"type": "number[]"
}
],
"return_type": "boolean",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/code... |
955 | delete-columns-to-make-sorted-ii | Medium | You are given an array of n strings strs, all of the same length.
We may choose any deletion indices, and we delete all the characters in those indices for each string.
For example, if we have strs = ["abcdef","uvwxyz"] and deletion indices {0, 2, 3}, then the final array after deletions is ["bef", "vyz"].
Suppose w... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(strs = ['ppp', 'qqq', 'rrr']) == 0\n assert candidate(strs = ['az', 'za']) == 0\n assert candidate(strs = ['xc', 'yb', 'za']) == 0\n assert candidate(strs = ['dog', 'cat', 'bat']) == 2\n assert candidate(strs = ['abcdef', 'uv... | [
"[\"ca\",\"bb\",\"ac\"]",
"[\"xc\",\"yb\",\"za\"]",
"[\"zyx\",\"wvu\",\"tsr\"]"
] | [] | {
"canonical_parameter_names": [
"strs"
],
"leetcode_dataset_entry_point": "Solution().minDeletionSize",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:26",
"tests_total": 205,
"tests... | typescript | {
"raw_signature": "function minDeletionSize(strs: string[]): number {",
"container": null,
"callable": "minDeletionSize",
"parameters": [
{
"name": "strs",
"type": "string[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnip... |
956 | tallest-billboard | Hard | You are installing a billboard and want it to have the largest height. The billboard will have two steel supports, one on each side. Each steel support must be an equal height.
You are given a collection of rods that can be welded together. For example, if you have rods of lengths 1, 2, and 3, you can weld them togeth... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(rods = [10, 20, 30, 40]) == 50\n assert candidate(rods = [100, 200, 300]) == 300\n assert candidate(rods = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 10\n assert candidate(rods = [10, 20, 30, 40, 50]) == 70... | [
"[1,2,3,6]",
"[1,2,3,4,5,6]",
"[1,2]"
] | [] | {
"canonical_parameter_names": [
"rods"
],
"leetcode_dataset_entry_point": "Solution().tallestBillboard",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:28",
"tests_total": 98,
"tests... | typescript | {
"raw_signature": "function tallestBillboard(rods: number[]): number {",
"container": null,
"callable": "tallestBillboard",
"parameters": [
{
"name": "rods",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSn... |
957 | prison-cells-after-n-days | Medium | There are 8 prison cells in a row and each cell is either occupied or vacant.
Each day, whether the cell is occupied or vacant changes according to the following rules:
- If a cell has two adjacent neighbors that are both occupied or both vacant, then the cell becomes occupied.
- Otherwise, it becomes vacant.
Note t... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(cells = [0, 0, 0, 0, 0, 0, 0, 0],n = 5) == [0, 1, 0, 1, 1, 0, 1, 0]\n assert candidate(cells = [1, 1, 1, 1, 1, 1, 1, 1],n = 2) == [0, 0, 1, 1, 1, 1, 0, 0]\n assert candidate(cells = [1, 1, 1, 1, 1, 1, 1, 1],n = 15) == [0, 1, 1, 1, ... | [
"[0,1,0,1,1,0,0,1]\n7",
"[1,0,0,1,0,0,1,0]\n1000000000"
] | [] | {
"canonical_parameter_names": [
"cells",
"n"
],
"leetcode_dataset_entry_point": "Solution().prisonAfterNDays",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:30",
"tests_total": 10... | typescript | {
"raw_signature": "function prisonAfterNDays(cells: number[], n: number): number[] {",
"container": null,
"callable": "prisonAfterNDays",
"parameters": [
{
"name": "cells",
"type": "number[]"
},
{
"name": "n",
"type": "number"
}
],
"return_type": "number[]",
"signa... |
959 | regions-cut-by-slashes | Medium | An n x n grid is composed of 1 x 1 squares where each 1 x 1 square consists of a '/', '\', or blank space ' '. These characters divide the square into contiguous regions.
Given the grid grid represented as a string array, return the number of regions.
Note that backslash characters are escaped, so a '\' is represente... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(grid = ['///', '///', '///']) == 6\n assert candidate(grid = [' /', '/ ']) == 2\n assert candidate(grid = ['/\\\\', '\\\\/']) == 5\n assert candidate(grid = [' /', ' ']) == 1\n assert candidate(grid = [' ', ' ', ' ']) ... | [
"[\" /\",\"/ \"]",
"[\" /\",\" \"]",
"[\"/\\\\\",\"\\\\/\"]"
] | [] | {
"canonical_parameter_names": [
"grid"
],
"leetcode_dataset_entry_point": "Solution().regionsBySlashes",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:50",
"tests_total": 89,
"tests... | typescript | {
"raw_signature": "function regionsBySlashes(grid: string[]): number {",
"container": null,
"callable": "regionsBySlashes",
"parameters": [
{
"name": "grid",
"type": "string[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSn... |
960 | delete-columns-to-make-sorted-iii | Hard | You are given an array of n strings strs, all of the same length.
We may choose any deletion indices, and we delete all the characters in those indices for each string.
For example, if we have strs = ["abcdef","uvwxyz"] and deletion indices {0, 2, 3}, then the final array after deletions is ["bef", "vyz"].
Suppose w... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(strs = ['zyx', 'zyx', 'zyx']) == 2\n assert candidate(strs = ['rrjk', 'furt', 'guzm']) == 2\n assert candidate(strs = ['axx', 'ggs', 'zzz']) == 0\n assert candidate(strs = ['ghi', 'def', 'abc']) == 0\n assert candidate(strs =... | [
"[\"babca\",\"bbazb\"]",
"[\"edcba\"]",
"[\"ghi\",\"def\",\"abc\"]"
] | [] | {
"canonical_parameter_names": [
"strs"
],
"leetcode_dataset_entry_point": "Solution().minDeletionSize",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:52",
"tests_total": 100,
"tests... | typescript | {
"raw_signature": "function minDeletionSize(strs: string[]): number {",
"container": null,
"callable": "minDeletionSize",
"parameters": [
{
"name": "strs",
"type": "string[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnip... |
961 | n-repeated-element-in-size-2n-array | Easy | You are given an integer array nums with the following properties:
- nums.length == 2 * n.
- nums contains n + 1 unique values, n of which occur exactly once in the array.
- Exactly one element of nums is repeated n times.
Return the element that is repeated n times.
Example 1:
Input: nums = [1,2,3,3]
Output: 3
Ex... | {
"language": "python",
"source": "def check(candidate):\n assert candidate(nums = [10, 20, 30, 10, 40, 50]) == 10\n assert candidate(nums = [9, 8, 7, 6, 5, 4, 3, 2, 1, 9]) == 9\n assert candidate(nums = [21, 22, 23, 24, 21, 25, 26, 27]) == 21\n assert candidate(nums = [14, 15, 16, 17, 18, 19, 14, 20]) ... | [
"[1,2,3,3]",
"[2,1,2,5,3,2]",
"[5,1,5,2,5,3,5,4]"
] | [] | {
"canonical_parameter_names": [
"nums"
],
"leetcode_dataset_entry_point": "Solution().repeatedNTimes",
"problem_source": "newfacade/LeetCodeDataset",
"description_source": "leetcode.com",
"interface_source": "leetcode/codeSnippets",
"fetched_at": "2026-09-30T20:05:54",
"tests_total": 93,
"tests_d... | typescript | {
"raw_signature": "function repeatedNTimes(nums: number[]): number {",
"container": null,
"callable": "repeatedNTimes",
"parameters": [
{
"name": "nums",
"type": "number[]"
}
],
"return_type": "number",
"signature_source": "leetcode/codeSnippets",
"type_source": "leetcode/codeSnippe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.