questionFrontendId int64 1 3.51k | questionTitle stringlengths 3 79 | TitleSlug stringlengths 3 79 | content stringlengths 431 25.4k ⌀ | difficulty stringclasses 3
values | totalAccepted stringlengths 2 6 | totalSubmission stringlengths 2 6 | totalAcceptedRaw int64 124 16.8M | totalSubmissionRaw int64 285 30.3M | acRate stringlengths 4 5 | similarQuestions stringlengths 2 714 | mysqlSchemas stringclasses 295
values | category stringclasses 6
values | codeDefinition stringlengths 122 24.9k ⌀ | sampleTestCase stringlengths 1 4.33k | metaData stringlengths 37 3.13k | envInfo stringclasses 26
values | topicTags stringlengths 2 153 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,308 | Arrange Table by Gender | arrange-table-by-gender | null | Medium | 7.2K | 10.3K | 7,245 | 10,299 | 70.3% | [] | ["Create table If Not Exists Genders (user_id int, gender ENUM('female', 'other', 'male'))", 'Truncate table Genders', "insert into Genders (user_id, gender) values ('4', 'male')", "insert into Genders (user_id, gender) values ('7', 'female')", "insert into Genders (user_id, gender) values ('2', 'other')", "insert into... | Database | null | {"headers": {"Genders": ["user_id", "gender"]}, "rows": {"Genders": [[4, "male"], [7, "female"], [2, "other"], [5, "male"], [3, "female"], [8, "male"], [6, "other"], [1, "other"], [9, "female"]]}} | {"mysql": ["Create table If Not Exists Genders (user_id int, gender ENUM('female', 'other', 'male'))"], "mssql": ["Create table Genders (user_id int, gender VARCHAR(6) NOT NULL CHECK (gender IN ('female', 'other', 'male')))"], "oraclesql": ["Create table Genders (user_id int, gender VARCHAR(6) NOT NULL CHECK (gender IN... | {"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16<... | ['Database'] |
2,309 | Greatest English Letter in Upper and Lower Case | greatest-english-letter-in-upper-and-lower-case | <p>Given a string of English letters <code>s</code>, return <em>the <strong>greatest </strong>English letter which occurs as <strong>both</strong> a lowercase and uppercase letter in</em> <code>s</code>. The returned letter should be in <strong>uppercase</strong>. If no such letter exists, return <em>an empty string</e... | Easy | 63.2K | 89.2K | 63,199 | 89,193 | 70.9% | ['count-the-number-of-special-characters-ii', 'count-the-number-of-special-characters-i'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string greatestLetter(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String greatestLetter(String s) {\n \n }\n}"}, {"value": "python", "text": "Python", "default... | "lEeTcOdE" | {
"name": "greatestLetter",
"params": [
{
"name": "s",
"type": "string"
}
],
"return": {
"type": "string"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Hash Table', 'String', 'Enumeration'] |
2,310 | Sum of Numbers With Units Digit K | sum-of-numbers-with-units-digit-k | <p>Given two integers <code>num</code> and <code>k</code>, consider a set of positive integers with the following properties:</p>
<ul>
<li>The units digit of each integer is <code>k</code>.</li>
<li>The sum of the integers is <code>num</code>.</li>
</ul>
<p>Return <em>the <strong>minimum</strong> possible size of s... | Medium | 29K | 106.9K | 29,043 | 106,910 | 27.2% | ['digit-count-in-range', 'count-integers-with-even-digit-sum', 'sum-of-number-and-its-reverse'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minimumNumbers(int num, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minimumNumbers(int num, int k) {\n \n }\n}"}, {"value": "python", "text": "Python", "d... | 58
9 | {
"name": "minimumNumbers",
"params": [
{
"name": "num",
"type": "integer"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Math', 'Dynamic Programming', 'Greedy', 'Enumeration'] |
2,311 | Longest Binary Subsequence Less Than or Equal to K | longest-binary-subsequence-less-than-or-equal-to-k | <p>You are given a binary string <code>s</code> and a positive integer <code>k</code>.</p>
<p>Return <em>the length of the <strong>longest</strong> subsequence of </em><code>s</code><em> that makes up a <strong>binary</strong> number less than or equal to</em> <code>k</code>.</p>
<p>Note:</p>
<ul>
<li>The subsequen... | Medium | 24.1K | 63.2K | 24,085 | 63,237 | 38.1% | ['maximum-binary-string-after-change'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int longestSubsequence(string s, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int longestSubsequence(String s, int k) {\n \n }\n}"}, {"value": "python", "text": "P... | "1001010"
5 | {
"name": "longestSubsequence",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['String', 'Dynamic Programming', 'Greedy', 'Memoization'] |
2,312 | Selling Pieces of Wood | selling-pieces-of-wood | <p>You are given two integers <code>m</code> and <code>n</code> that represent the height and width of a rectangular piece of wood. You are also given a 2D integer array <code>prices</code>, where <code>prices[i] = [h<sub>i</sub>, w<sub>i</sub>, price<sub>i</sub>]</code> indicates you can sell a rectangular piece of wo... | Hard | 13.1K | 25.6K | 13,149 | 25,610 | 51.3% | ['tiling-a-rectangle-with-the-fewest-squares', 'number-of-ways-of-cutting-a-pizza'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long sellingWood(int m, int n, vector<vector<int>>& prices) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long sellingWood(int m, int n, int[][] prices) {\n \n }\n}"}... | 3
5
[[1,4,2],[2,2,7],[2,1,3]] | {
"name": "sellingWood",
"params": [
{
"name": "m",
"type": "integer"
},
{
"type": "integer",
"name": "n"
},
{
"type": "integer[][]",
"name": "prices"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Dynamic Programming', 'Memoization'] |
2,313 | Minimum Flips in Binary Tree to Get Result | minimum-flips-in-binary-tree-to-get-result | null | Hard | 4.4K | 7.7K | 4,393 | 7,746 | 56.7% | ['check-if-two-expression-trees-are-equivalent', 'design-an-expression-tree-with-evaluate-function', 'evaluate-boolean-binary-tree'] | [] | Algorithms | null | [3,5,4,2,null,1,1,1,0]
true | {
"name": "minimumFlips",
"params": [
{
"name": "root",
"type": "TreeNode"
},
{
"type": "boolean",
"name": "result"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Dynamic Programming', 'Tree', 'Depth-First Search', 'Binary Tree'] |
2,314 | The First Day of the Maximum Recorded Degree in Each City | the-first-day-of-the-maximum-recorded-degree-in-each-city | null | Medium | 7.1K | 9.7K | 7,055 | 9,651 | 73.1% | [] | ['Create table If Not Exists Weather (city_id int, day date, degree int)', 'Truncate table Weather', "insert into Weather (city_id, day, degree) values ('1', '2022-01-07', '-12')", "insert into Weather (city_id, day, degree) values ('1', '2022-03-07', '5')", "insert into Weather (city_id, day, degree) values ('1', '202... | Database | null | {"headers": {"Weather": ["city_id", "day", "degree"]}, "rows": {"Weather": [[1, "2022-01-07", -12], [1, "2022-03-07", 5], [1, "2022-07-07", 24], [2, "2022-08-07", 37], [2, "2022-08-17", 37], [3, "2022-02-07", -7], [3, "2022-12-07", -6]]}} | {"mysql": ["Create table If Not Exists Weather (city_id int, day date, degree int)"], "mssql": ["Create table Weather (city_id int, day date, degree int)"], "oraclesql": ["Create table Weather (city_id int, day date, degree int)", "ALTER SESSION SET nls_date_format='YYYY-MM-DD'"], "database": true, "name": "find_the_fi... | {"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16<... | ['Database'] |
2,315 | Count Asterisks | count-asterisks | <p>You are given a string <code>s</code>, where every <strong>two</strong> consecutive vertical bars <code>'|'</code> are grouped into a <strong>pair</strong>. In other words, the 1<sup>st</sup> and 2<sup>nd</sup> <code>'|'</code> make a pair, the 3<sup>rd</sup> and 4<sup>th</sup> <code>'|'</cod... | Easy | 84.4K | 102.2K | 84,438 | 102,197 | 82.6% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countAsterisks(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countAsterisks(String s) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCode":... | "l|*e*et|c**o|*de|" | {
"name": "countAsterisks",
"params": [
{
"name": "s",
"type": "string"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['String'] |
2,316 | Count Unreachable Pairs of Nodes in an Undirected Graph | count-unreachable-pairs-of-nodes-in-an-undirected-graph | <p>You are given an integer <code>n</code>. There is an <strong>undirected</strong> graph with <code>n</code> nodes, numbered from <code>0</code> to <code>n - 1</code>. You are given a 2D integer array <code>edges</code> where <code>edges[i] = [a<sub>i</sub>, b<sub>i</sub>]</code> denotes that there exists an <strong>u... | Medium | 103.4K | 210.2K | 103,404 | 210,192 | 49.2% | ['number-of-islands'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long countPairs(int n, vector<vector<int>>& edges) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long countPairs(int n, int[][] edges) {\n \n }\n}"}, {"value": "pytho... | 3
[[0,1],[0,2],[1,2]] | {
"name": "countPairs",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[][]",
"name": "edges"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Depth-First Search', 'Breadth-First Search', 'Union Find', 'Graph'] |
2,317 | Maximum XOR After Operations | maximum-xor-after-operations | <p>You are given a <strong>0-indexed</strong> integer array <code>nums</code>. In one operation, select <strong>any</strong> non-negative integer <code>x</code> and an index <code>i</code>, then <strong>update</strong> <code>nums[i]</code> to be equal to <code>nums[i] AND (nums[i] XOR x)</code>.</p>
<p>Note that <code... | Medium | 28.4K | 35.8K | 28,375 | 35,849 | 79.2% | ['maximum-xor-of-two-numbers-in-an-array', 'maximum-xor-product', 'minimize-or-of-remaining-elements-using-operations'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maximumXOR(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maximumXOR(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCod... | [3,2,4,6] | {
"name": "maximumXOR",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Math', 'Bit Manipulation'] |
2,318 | Number of Distinct Roll Sequences | number-of-distinct-roll-sequences | <p>You are given an integer <code>n</code>. You roll a fair 6-sided dice <code>n</code> times. Determine the total number of <strong>distinct</strong> sequences of rolls possible such that the following conditions are satisfied:</p>
<ol>
<li>The <strong>greatest common divisor</strong> of any <strong>adjacent</strong... | Hard | 12.4K | 21.8K | 12,412 | 21,752 | 57.1% | ['dice-roll-simulation', 'paint-house-iii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int distinctSequences(int n) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int distinctSequences(int n) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCode":... | 4 | {
"name": "distinctSequences",
"params": [
{
"name": "n",
"type": "integer"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Dynamic Programming', 'Memoization'] |
2,319 | Check if Matrix Is X-Matrix | check-if-matrix-is-x-matrix | <p>A square matrix is said to be an <strong>X-Matrix</strong> if <strong>both</strong> of the following conditions hold:</p>
<ol>
<li>All the elements in the diagonals of the matrix are <strong>non-zero</strong>.</li>
<li>All other elements are 0.</li>
</ol>
<p>Given a 2D integer array <code>grid</code> of size <co... | Easy | 61.6K | 94.3K | 61,621 | 94,295 | 65.3% | ['matrix-diagonal-sum'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool checkXMatrix(vector<vector<int>>& grid) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean checkXMatrix(int[][] grid) {\n \n }\n}"}, {"value": "python", "text": "P... | [[2,0,0,1],[0,3,1,0],[0,5,2,0],[4,0,0,2]] | {
"name": "checkXMatrix",
"params": [
{
"name": "grid",
"type": "integer[][]"
}
],
"return": {
"type": "boolean"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Matrix'] |
2,320 | Count Number of Ways to Place Houses | count-number-of-ways-to-place-houses | <p>There is a street with <code>n * 2</code> <strong>plots</strong>, where there are <code>n</code> plots on each side of the street. The plots on each side are numbered from <code>1</code> to <code>n</code>. On each plot, a house can be placed.</p>
<p>Return <em>the number of ways houses can be placed such that no tw... | Medium | 31K | 72.8K | 30,977 | 72,795 | 42.6% | ['climbing-stairs', 'house-robber'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countHousePlacements(int n) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countHousePlacements(int n) {\n \n }\n}"}, {"value": "python", "text": "Python", "default... | 1 | {
"name": "countHousePlacements",
"params": [
{
"name": "n",
"type": "integer"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Dynamic Programming'] |
2,321 | Maximum Score Of Spliced Array | maximum-score-of-spliced-array | <p>You are given two <strong>0-indexed</strong> integer arrays <code>nums1</code> and <code>nums2</code>, both of length <code>n</code>.</p>
<p>You can choose two integers <code>left</code> and <code>right</code> where <code>0 <= left <= right < n</code> and <strong>swap</strong> the subarray <code>nums1[left... | Hard | 21.4K | 37.3K | 21,371 | 37,285 | 57.3% | ['maximum-subarray'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maximumsSplicedArray(vector<int>& nums1, vector<int>& nums2) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maximumsSplicedArray(int[] nums1, int[] nums2) {\n \n }\... | [60,60,60]
[10,90,10] | {
"name": "maximumsSplicedArray",
"params": [
{
"name": "nums1",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "nums2"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Dynamic Programming'] |
2,322 | Minimum Score After Removals on a Tree | minimum-score-after-removals-on-a-tree | <p>There is an undirected connected tree with <code>n</code> nodes labeled from <code>0</code> to <code>n - 1</code> and <code>n - 1</code> edges.</p>
<p>You are given a <strong>0-indexed</strong> integer array <code>nums</code> of length <code>n</code> where <code>nums[i]</code> represents the value of the <code>i<su... | Hard | 8.2K | 15.8K | 8,199 | 15,775 | 52.0% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minimumScore(vector<int>& nums, vector<vector<int>>& edges) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minimumScore(int[] nums, int[][] edges) {\n \n }\n}"}, {"... | [1,5,5,4,11]
[[0,1],[1,2],[1,3],[3,4]] | {
"name": "minimumScore",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer[][]",
"name": "edges"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Bit Manipulation', 'Tree', 'Depth-First Search'] |
2,323 | Find Minimum Time to Finish All Jobs II | find-minimum-time-to-finish-all-jobs-ii | null | Medium | 11.5K | 17.6K | 11,539 | 17,596 | 65.6% | ['task-scheduler', 'find-minimum-time-to-finish-all-jobs', 'minimum-number-of-work-sessions-to-finish-the-tasks'] | [] | Algorithms | null | [5,2,4]
[1,7,5] | {
"name": "minimumTime",
"params": [
{
"name": "jobs",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "workers"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Greedy', 'Sorting'] |
2,324 | Product Sales Analysis IV | product-sales-analysis-iv | null | Medium | 9.3K | 12.4K | 9,344 | 12,411 | 75.3% | ['product-sales-analysis-i', 'product-sales-analysis-ii', 'product-sales-analysis-iii'] | ['Create table If Not Exists Sales (sale_id int, product_id int, user_id int, quantity int)', 'Create table If Not Exists Product (product_id int, price int)', 'Truncate table Sales', "insert into Sales (sale_id, product_id, user_id, quantity) values ('1', '1', '101', '10')", "insert into Sales (sale_id, product_id, us... | Database | null | {"headers": {"Sales": ["sale_id", "product_id", "user_id", "quantity"], "Product": ["product_id", "price"]}, "rows": {"Sales": [[1, 1, 101, 10], [2, 3, 101, 7], [3, 1, 102, 9], [4, 2, 102, 6], [5, 3, 102, 10], [6, 1, 102, 6]], "Product": [[1, 10], [2, 25], [3, 15]]}} | {"mysql": ["Create table If Not Exists Sales (sale_id int, product_id int, user_id int, quantity int)", "Create table If Not Exists Product (product_id int, price int)"], "mssql": ["Create table Sales (sale_id int, product_id int, user_id int, quantity int)", "Create table Product (product_id int, price int)"], "oracle... | {"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16<... | ['Database'] |
2,325 | Decode the Message | decode-the-message | <p>You are given the strings <code>key</code> and <code>message</code>, which represent a cipher key and a secret message, respectively. The steps to decode <code>message</code> are as follows:</p>
<ol>
<li>Use the <strong>first</strong> appearance of all 26 lowercase English letters in <code>key</code> as the <stron... | Easy | 129.8K | 152.3K | 129,847 | 152,271 | 85.3% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string decodeMessage(string key, string message) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String decodeMessage(String key, String message) {\n \n }\n}"}, {"value": "p... | "the quick brown fox jumps over the lazy dog"
"vkbs bs t suepuv" | {
"name": "decodeMessage",
"params": [
{
"name": "key",
"type": "string"
},
{
"type": "string",
"name": "message"
}
],
"return": {
"type": "string"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Hash Table', 'String'] |
2,326 | Spiral Matrix IV | spiral-matrix-iv | <p>You are given two integers <code>m</code> and <code>n</code>, which represent the dimensions of a matrix.</p>
<p>You are also given the <code>head</code> of a linked list of integers.</p>
<p>Generate an <code>m x n</code> matrix that contains the integers in the linked list presented in <strong>spiral</strong> ord... | Medium | 168.8K | 205.4K | 168,782 | 205,414 | 82.2% | ['spiral-matrix', 'spiral-matrix-ii', 'spiral-matrix-iii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "/**\n * Definition for singly-linked list.\n * struct ListNode {\n * int val;\n * ListNode *next;\n * ListNode() : val(0), next(nullptr) {}\n * ListNode(int x) : val(x), next(nullptr) {}\n * ListNode(int x, ListNode *next) : val(x), next(next) {}\n * ... | 3
5
[3,0,2,6,8,1,7,9,4,2,5,5,0] | {
"name": "spiralMatrix",
"params": [
{
"name": "m",
"type": "integer"
},
{
"type": "integer",
"name": "n"
},
{
"type": "ListNode",
"name": "head"
}
],
"return": {
"type": "integer[][]"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Linked List', 'Matrix', 'Simulation'] |
2,327 | Number of People Aware of a Secret | number-of-people-aware-of-a-secret | <p>On day <code>1</code>, one person discovers a secret.</p>
<p>You are given an integer <code>delay</code>, which means that each person will <strong>share</strong> the secret with a new person <strong>every day</strong>, starting from <code>delay</code> days after discovering the secret. You are also given an intege... | Medium | 27.6K | 59.8K | 27,597 | 59,847 | 46.1% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int peopleAwareOfSecret(int n, int delay, int forget) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int peopleAwareOfSecret(int n, int delay, int forget) {\n \n }\n}"}, {"... | 6
2
4 | {
"name": "peopleAwareOfSecret",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer",
"name": "delay"
},
{
"type": "integer",
"name": "forget"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Dynamic Programming', 'Queue', 'Simulation'] |
2,328 | Number of Increasing Paths in a Grid | number-of-increasing-paths-in-a-grid | <p>You are given an <code>m x n</code> integer matrix <code>grid</code>, where you can move from a cell to any adjacent cell in all <code>4</code> directions.</p>
<p>Return <em>the number of <strong>strictly</strong> <strong>increasing</strong> paths in the grid such that you can start from <strong>any</strong> cell a... | Hard | 74.6K | 129.3K | 74,617 | 129,290 | 57.7% | ['longest-increasing-path-in-a-matrix', 'all-paths-from-source-to-target', 'maximum-strictly-increasing-cells-in-a-matrix'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countPaths(vector<vector<int>>& grid) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countPaths(int[][] grid) {\n \n }\n}"}, {"value": "python", "text": "Python", "... | [[1,1],[3,4]] | {
"name": "countPaths",
"params": [
{
"name": "grid",
"type": "integer[][]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Dynamic Programming', 'Depth-First Search', 'Breadth-First Search', 'Graph', 'Topological Sort', 'Memoization', 'Matrix'] |
2,329 | Product Sales Analysis V | product-sales-analysis-v | null | Easy | 9K | 12.8K | 9,042 | 12,837 | 70.4% | ['product-sales-analysis-i', 'product-sales-analysis-ii', 'product-sales-analysis-iii'] | ['Create table If Not Exists Sales (sale_id int, product_id int, user_id int, quantity int)', 'Create table If Not Exists Product (product_id int, price int)', 'Truncate table Sales', "insert into Sales (sale_id, product_id, user_id, quantity) values ('1', '1', '101', '10')", "insert into Sales (sale_id, product_id, us... | Database | null | {"headers": {"Sales": ["sale_id", "product_id", "user_id", "quantity"], "Product": ["product_id", "price"]}, "rows": {"Sales": [[1, 1, 101, 10], [2, 2, 101, 1], [3, 3, 102, 3], [4, 3, 102, 2], [5, 2, 103, 3]], "Product": [[1, 10], [2, 25], [3, 15]]}} | {"mysql": ["Create table If Not Exists Sales (sale_id int, product_id int, user_id int, quantity int)", "Create table If Not Exists Product (product_id int, price int)"], "mssql": ["Create table Sales (sale_id int, product_id int, user_id int, quantity int)", "Create table Product (product_id int, price int)"], "oracle... | {"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16<... | ['Database'] |
2,330 | Valid Palindrome IV | valid-palindrome-iv | null | Medium | 18.1K | 23.9K | 18,106 | 23,900 | 75.8% | ['valid-palindrome', 'valid-palindrome-ii', 'valid-palindrome-iii'] | [] | Algorithms | null | "abcdba" | {
"name": "makePalindrome",
"params": [
{
"name": "s",
"type": "string"
}
],
"return": {
"type": "boolean"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Two Pointers', 'String'] |
2,331 | Evaluate Boolean Binary Tree | evaluate-boolean-binary-tree | <p>You are given the <code>root</code> of a <strong>full binary tree</strong> with the following properties:</p>
<ul>
<li><strong>Leaf nodes</strong> have either the value <code>0</code> or <code>1</code>, where <code>0</code> represents <code>False</code> and <code>1</code> represents <code>True</code>.</li>
<li><s... | Easy | 207.8K | 252.1K | 207,833 | 252,127 | 82.4% | ['check-if-two-expression-trees-are-equivalent', 'design-an-expression-tree-with-evaluate-function', 'minimum-flips-in-binary-tree-to-get-result'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *right;\n * TreeNode() : val(0), left(nullptr), right(nullptr) {}\n * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}\n * Tre... | [2,1,3,null,null,0,1] | {
"name": "evaluateTree",
"params": [
{
"name": "root",
"type": "TreeNode"
}
],
"return": {
"type": "boolean"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Tree', 'Depth-First Search', 'Binary Tree'] |
2,332 | The Latest Time to Catch a Bus | the-latest-time-to-catch-a-bus | <p>You are given a <strong>0-indexed</strong> integer array <code>buses</code> of length <code>n</code>, where <code>buses[i]</code> represents the departure time of the <code>i<sup>th</sup></code> bus. You are also given a <strong>0-indexed</strong> integer array <code>passengers</code> of length <code>m</code>, where... | Medium | 28.3K | 100.8K | 28,295 | 100,799 | 28.1% | ['minimum-speed-to-arrive-on-time', 'maximum-matching-of-players-with-trainers', 'time-taken-to-cross-the-door', 'time-to-cross-a-bridge', 'rearranging-fruits'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int latestTimeCatchTheBus(vector<int>& buses, vector<int>& passengers, int capacity) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int latestTimeCatchTheBus(int[] buses, int[] passe... | [10,20]
[2,17,18,19]
2 | {
"name": "latestTimeCatchTheBus",
"params": [
{
"name": "buses",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "passengers"
},
{
"type": "integer",
"name": "capacity"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Two Pointers', 'Binary Search', 'Sorting'] |
2,333 | Minimum Sum of Squared Difference | minimum-sum-of-squared-difference | <p>You are given two positive <strong>0-indexed</strong> integer arrays <code>nums1</code> and <code>nums2</code>, both of length <code>n</code>.</p>
<p>The <strong>sum of squared difference</strong> of arrays <code>nums1</code> and <code>nums2</code> is defined as the <strong>sum</strong> of <code>(nums1[i] - nums2[i... | Medium | 16.3K | 63.1K | 16,273 | 63,097 | 25.8% | ['minimum-absolute-sum-difference', 'partition-array-into-two-arrays-to-minimize-sum-difference'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long minSumSquareDiff(vector<int>& nums1, vector<int>& nums2, int k1, int k2) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long minSumSquareDiff(int[] nums1, int[] nums2, int ... | [1,2,3,4]
[2,10,20,19]
0
0 | {
"name": "minSumSquareDiff",
"params": [
{
"name": "nums1",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "nums2"
},
{
"type": "integer",
"name": "k1"
},
{
"type": "integer",
"name": "k2"
}
],
"return": {
"type": "long"... | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Binary Search', 'Greedy', 'Sorting', 'Heap (Priority Queue)'] |
2,334 | Subarray With Elements Greater Than Varying Threshold | subarray-with-elements-greater-than-varying-threshold | <p>You are given an integer array <code>nums</code> and an integer <code>threshold</code>.</p>
<p>Find any subarray of <code>nums</code> of length <code>k</code> such that <strong>every</strong> element in the subarray is <strong>greater</strong> than <code>threshold / k</code>.</p>
<p>Return<em> the <strong>size</st... | Hard | 15.6K | 35.2K | 15,592 | 35,202 | 44.3% | ['maximum-subarray-min-product', 'smallest-k-length-subsequence-with-occurrences-of-a-letter', 'k-divisible-elements-subarrays'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int validSubarraySize(vector<int>& nums, int threshold) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int validSubarraySize(int[] nums, int threshold) {\n \n }\n}"}, {"val... | [1,3,4,3,1]
6 | {
"name": "validSubarraySize",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer",
"name": "threshold"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Stack', 'Union Find', 'Monotonic Stack'] |
2,335 | Minimum Amount of Time to Fill Cups | minimum-amount-of-time-to-fill-cups | <p>You have a water dispenser that can dispense cold, warm, and hot water. Every second, you can either fill up <code>2</code> cups with <strong>different</strong> types of water, or <code>1</code> cup of any type of water.</p>
<p>You are given a <strong>0-indexed</strong> integer array <code>amount</code> of length <... | Easy | 56.9K | 97.1K | 56,886 | 97,092 | 58.6% | ['construct-target-array-with-multiple-sums', 'maximum-score-from-removing-stones', 'maximum-running-time-of-n-computers', 'minimum-cost-to-make-array-equal'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int fillCups(vector<int>& amount) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int fillCups(int[] amount) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCod... | [1,4,2] | {
"name": "fillCups",
"params": [
{
"name": "amount",
"type": "integer[]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Greedy', 'Sorting', 'Heap (Priority Queue)'] |
2,336 | Smallest Number in Infinite Set | smallest-number-in-infinite-set | <p>You have a set which contains all positive integers <code>[1, 2, 3, 4, 5, ...]</code>.</p>
<p>Implement the <code>SmallestInfiniteSet</code> class:</p>
<ul>
<li><code>SmallestInfiniteSet()</code> Initializes the <strong>SmallestInfiniteSet</strong> object to contain <strong>all</strong> positive integers.</li>
<... | Medium | 189.3K | 265.3K | 189,343 | 265,331 | 71.4% | ['first-missing-positive'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class SmallestInfiniteSet {\npublic:\n SmallestInfiniteSet() {\n \n }\n \n int popSmallest() {\n \n }\n \n void addBack(int num) {\n \n }\n};\n\n/**\n * Your SmallestInfiniteSet object will be instantiated and called as such:\... | ["SmallestInfiniteSet","addBack","popSmallest","popSmallest","popSmallest","addBack","popSmallest","popSmallest","popSmallest"]
[[],[2],[],[],[],[1],[],[],[]] | {
"classname": "SmallestInfiniteSet",
"constructor": {
"params": []
},
"methods": [
{
"params": [],
"name": "popSmallest",
"return": {
"type": "integer"
}
},
{
"params": [
{
"type": "integer",
"name": "num"
}
],
... | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Hash Table', 'Design', 'Heap (Priority Queue)', 'Ordered Set'] |
2,337 | Move Pieces to Obtain a String | move-pieces-to-obtain-a-string | <p>You are given two strings <code>start</code> and <code>target</code>, both of length <code>n</code>. Each string consists <strong>only</strong> of the characters <code>'L'</code>, <code>'R'</code>, and <code>'_'</code> where:</p>
<ul>
<li>The characters <code>'L'</code> and <code>&#... | Medium | 136.7K | 240.2K | 136,686 | 240,195 | 56.9% | ['valid-parentheses', 'swap-adjacent-in-lr-string'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool canChange(string start, string target) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean canChange(String start, String target) {\n \n }\n}"}, {"value": "python",... | "_L__R__R_"
"L______RR" | {
"name": "canChange",
"params": [
{
"name": "start",
"type": "string"
},
{
"type": "string",
"name": "target"
}
],
"return": {
"type": "boolean"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Two Pointers', 'String'] |
2,338 | Count the Number of Ideal Arrays | count-the-number-of-ideal-arrays | <p>You are given two integers <code>n</code> and <code>maxValue</code>, which are used to describe an <strong>ideal</strong> array.</p>
<p>A <strong>0-indexed</strong> integer array <code>arr</code> of length <code>n</code> is considered <strong>ideal</strong> if the following conditions hold:</p>
<ul>
<li>Every <co... | Hard | 7.1K | 25.9K | 7,103 | 25,882 | 27.4% | ['count-ways-to-make-array-with-product', 'count-the-number-of-beautiful-subarrays'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int idealArrays(int n, int maxValue) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int idealArrays(int n, int maxValue) {\n \n }\n}"}, {"value": "python", "text": "Python"... | 2
5 | {
"name": "idealArrays",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer",
"name": "maxValue"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Math', 'Dynamic Programming', 'Combinatorics', 'Number Theory'] |
2,339 | All the Matches of the League | all-the-matches-of-the-league | null | Easy | 9.7K | 11K | 9,723 | 11,001 | 88.4% | [] | ['Create table If Not Exists Teams (team_name varchar(50))', 'Truncate table Teams', "insert into Teams (team_name) values ('Leetcode FC')", "insert into Teams (team_name) values ('Ahly SC')", "insert into Teams (team_name) values ('Real Madrid')"] | Database | null | {"headers": {"Teams": ["team_name"]}, "rows": {"Teams": [["Leetcode FC"], ["Ahly SC"], ["Real Madrid"]]}} | {"mysql": ["Create table If Not Exists Teams (team_name varchar(50))"], "mssql": ["Create table Teams (team_name varchar(50))"], "oraclesql": ["Create table Teams (team_name varchar(50))"], "database": true, "name": "find_all_matches", "pythondata": ["Teams = pd.DataFrame([], columns=['team_name']).astype({'team_name':... | {"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16<... | ['Database'] |
2,340 | Minimum Adjacent Swaps to Make a Valid Array | minimum-adjacent-swaps-to-make-a-valid-array | null | Medium | 39K | 53.9K | 38,957 | 53,923 | 72.2% | ['minimum-adjacent-swaps-for-k-consecutive-ones'] | [] | Algorithms | null | [3,4,5,5,3,1] | {
"name": "minimumSwaps",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Greedy'] |
2,341 | Maximum Number of Pairs in Array | maximum-number-of-pairs-in-array | <p>You are given a <strong>0-indexed</strong> integer array <code>nums</code>. In one operation, you may do the following:</p>
<ul>
<li>Choose <strong>two</strong> integers in <code>nums</code> that are <strong>equal</strong>.</li>
<li>Remove both integers from <code>nums</code>, forming a <strong>pair</strong>.</li... | Easy | 80.4K | 106.6K | 80,387 | 106,588 | 75.4% | ['sort-characters-by-frequency', 'top-k-frequent-words', 'sort-array-by-increasing-frequency'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> numberOfPairs(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] numberOfPairs(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Pyth... | [1,3,2,1,3,2,2] | {
"name": "numberOfPairs",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "integer[]"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Counting'] |
2,342 | Max Sum of a Pair With Equal Sum of Digits | max-sum-of-a-pair-with-equal-sum-of-digits | <p>You are given a <strong>0-indexed</strong> array <code>nums</code> consisting of <strong>positive</strong> integers. You can choose two indices <code>i</code> and <code>j</code>, such that <code>i != j</code>, and the sum of digits of the number <code>nums[i]</code> is equal to that of <code>nums[j]</code>.</p>
<p>... | Medium | 232.5K | 352.3K | 232,486 | 352,291 | 66.0% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maximumSum(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maximumSum(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCod... | [18,43,36,13,7] | {
"name": "maximumSum",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Sorting', 'Heap (Priority Queue)'] |
2,343 | Query Kth Smallest Trimmed Number | query-kth-smallest-trimmed-number | <p>You are given a <strong>0-indexed</strong> array of strings <code>nums</code>, where each string is of <strong>equal length</strong> and consists of only digits.</p>
<p>You are also given a <strong>0-indexed</strong> 2D integer array <code>queries</code> where <code>queries[i] = [k<sub>i</sub>, trim<sub>i</sub>]</c... | Medium | 34.5K | 76.4K | 34,519 | 76,375 | 45.2% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> smallestTrimmedNumbers(vector<string>& nums, vector<vector<int>>& queries) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] smallestTrimmedNumbers(String[] nums, int[... | ["102","473","251","814"]
[[1,1],[2,3],[4,2],[1,2]] | {
"name": "smallestTrimmedNumbers",
"params": [
{
"name": "nums",
"type": "string[]"
},
{
"type": "integer[][]",
"name": "queries"
}
],
"return": {
"type": "integer[]"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'String', 'Divide and Conquer', 'Sorting', 'Heap (Priority Queue)', 'Radix Sort', 'Quickselect'] |
2,344 | Minimum Deletions to Make Array Divisible | minimum-deletions-to-make-array-divisible | <p>You are given two positive integer arrays <code>nums</code> and <code>numsDivide</code>. You can delete any number of elements from <code>nums</code>.</p>
<p>Return <em>the <strong>minimum</strong> number of deletions such that the <strong>smallest</strong> element in </em><code>nums</code><em> <strong>divides</str... | Hard | 35K | 61.3K | 34,995 | 61,279 | 57.1% | ['check-if-array-pairs-are-divisible-by-k'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minOperations(vector<int>& nums, vector<int>& numsDivide) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minOperations(int[] nums, int[] numsDivide) {\n \n }\n}"}, ... | [2,3,2,4,3]
[9,6,9,3,15] | {
"name": "minOperations",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "numsDivide"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Math', 'Sorting', 'Heap (Priority Queue)', 'Number Theory'] |
2,345 | Finding the Number of Visible Mountains | finding-the-number-of-visible-mountains | null | Medium | 10.8K | 29.4K | 10,777 | 29,412 | 36.6% | ['buildings-with-an-ocean-view'] | [] | Algorithms | null | [[2,2],[6,3],[5,4]] | {
"name": "visibleMountains",
"params": [
{
"name": "peaks",
"type": "integer[][]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Stack', 'Sorting', 'Monotonic Stack'] |
2,346 | Compute the Rank as a Percentage | compute-the-rank-as-a-percentage | null | Medium | 6.2K | 18.2K | 6,170 | 18,250 | 33.8% | [] | ['Create table If Not Exists Students (student_id int, department_id int, mark int)', 'Truncate table Students', "insert into Students (student_id, department_id, mark) values ('2', '2', '650')", "insert into Students (student_id, department_id, mark) values ('8', '2', '650')", "insert into Students (student_id, depart... | Database | null | {"headers": {"Students": ["student_id", "department_id", "mark"]}, "rows": {"Students": [[2, 2, 650], [8, 2, 650], [7, 1, 920], [1, 1, 610], [3, 1, 530]]}} | {"mssql": ["Create table Students (student_id int, department_id int, mark int)"], "oraclesql": ["Create table Students (student_id int, department_id int, mark int)"], "database": true, "mysql": ["Create table If Not Exists Students (student_id int, department_id int, mark int)"], "name": "compute_rating", "pythondata... | {"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16<... | ['Database'] |
2,347 | Best Poker Hand | best-poker-hand | <p>You are given an integer array <code>ranks</code> and a character array <code>suits</code>. You have <code>5</code> cards where the <code>i<sup>th</sup></code> card has a rank of <code>ranks[i]</code> and a suit of <code>suits[i]</code>.</p>
<p>The following are the types of <strong>poker hands</strong> you can mak... | Easy | 47.5K | 77.8K | 47,513 | 77,811 | 61.1% | ['categorize-box-according-to-criteria'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string bestHand(vector<int>& ranks, vector<char>& suits) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String bestHand(int[] ranks, char[] suits) {\n \n }\n}"}, {"value": ... | [13,2,3,1,9]
["a","a","a","a","a"] | {
"name": "bestHand",
"params": [
{
"name": "ranks",
"type": "integer[]"
},
{
"type": "character[]",
"name": "suits"
}
],
"return": {
"type": "string"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Counting'] |
2,348 | Number of Zero-Filled Subarrays | number-of-zero-filled-subarrays | <p>Given an integer array <code>nums</code>, return <em>the number of <strong>subarrays</strong> filled with </em><code>0</code>.</p>
<p>A <strong>subarray</strong> is a contiguous non-empty sequence of elements within an array.</p>
<p> </p>
<p><strong class="example">Example 1:</strong></p>
<pre>
<strong>Input... | Medium | 141.2K | 211.8K | 141,249 | 211,846 | 66.7% | ['arithmetic-slices', 'number-of-smooth-descent-periods-of-a-stock', 'length-of-the-longest-alphabetical-continuous-substring', 'find-consecutive-integers-from-a-data-stream'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long zeroFilledSubarray(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long zeroFilledSubarray(int[] nums) {\n \n }\n}"}, {"value": "python", "text"... | [1,3,0,0,2,0,0,4] | {
"name": "zeroFilledSubarray",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Math'] |
2,349 | Design a Number Container System | design-a-number-container-system | <p>Design a number container system that can do the following:</p>
<ul>
<li><strong>Insert </strong>or <strong>Replace</strong> a number at the given index in the system.</li>
<li><strong>Return </strong>the smallest index for the given number in the system.</li>
</ul>
<p>Implement the <code>NumberContainers</code>... | Medium | 142.8K | 245.8K | 142,836 | 245,811 | 58.1% | ['seat-reservation-manager', 'design-a-food-rating-system'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class NumberContainers {\npublic:\n NumberContainers() {\n \n }\n \n void change(int index, int number) {\n \n }\n \n int find(int number) {\n \n }\n};\n\n/**\n * Your NumberContainers object will be instantiated and called as... | ["NumberContainers","find","change","change","change","change","find","change","find"]
[[],[10],[2,10],[1,10],[3,10],[5,10],[10],[1,20],[10]] | {
"classname": "NumberContainers",
"constructor": {
"params": []
},
"methods": [
{
"params": [
{
"type": "integer",
"name": "index"
},
{
"type": "integer",
"name": "number"
}
],
"name": "change",
"return": {
... | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Hash Table', 'Design', 'Heap (Priority Queue)', 'Ordered Set'] |
2,350 | Shortest Impossible Sequence of Rolls | shortest-impossible-sequence-of-rolls | <p>You are given an integer array <code>rolls</code> of length <code>n</code> and an integer <code>k</code>. You roll a <code>k</code> sided dice numbered from <code>1</code> to <code>k</code>, <code>n</code> times, where the result of the <code>i<sup>th</sup></code> roll is <code>rolls[i]</code>.</p>
<p>Return<em> th... | Hard | 17.2K | 25.1K | 17,225 | 25,136 | 68.5% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int shortestSequence(vector<int>& rolls, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int shortestSequence(int[] rolls, int k) {\n \n }\n}"}, {"value": "python", "... | [4,2,1,2,3,3,2,4,1]
4 | {
"name": "shortestSequence",
"params": [
{
"name": "rolls",
"type": "integer[]"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Greedy'] |
2,351 | First Letter to Appear Twice | first-letter-to-appear-twice | <p>Given a string <code>s</code> consisting of lowercase English letters, return <em>the first letter to appear <strong>twice</strong></em>.</p>
<p><strong>Note</strong>:</p>
<ul>
<li>A letter <code>a</code> appears twice before another letter <code>b</code> if the <strong>second</strong> occurrence of <code>a</code... | Easy | 154.3K | 208.4K | 154,265 | 208,393 | 74.0% | ['two-sum', 'first-unique-character-in-a-string'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n char repeatedCharacter(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public char repeatedCharacter(String s) {\n \n }\n}"}, {"value": "python", "text": "Python", "defau... | "abccbaacz" | {
"name": "repeatedCharacter",
"params": [
{
"name": "s",
"type": "string"
}
],
"return": {
"type": "character"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Hash Table', 'String', 'Bit Manipulation', 'Counting'] |
2,352 | Equal Row and Column Pairs | equal-row-and-column-pairs | <p>Given a <strong>0-indexed</strong> <code>n x n</code> integer matrix <code>grid</code>, <em>return the number of pairs </em><code>(r<sub>i</sub>, c<sub>j</sub>)</code><em> such that row </em><code>r<sub>i</sub></code><em> and column </em><code>c<sub>j</sub></code><em> are equal</em>.</p>
<p>A row and column pair is... | Medium | 320.6K | 455.4K | 320,574 | 455,420 | 70.4% | ['delete-greatest-value-in-each-row'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int equalPairs(vector<vector<int>>& grid) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int equalPairs(int[][] grid) {\n \n }\n}"}, {"value": "python", "text": "Python", "... | [[3,2,1],[1,7,6],[2,7,7]] | {
"name": "equalPairs",
"params": [
{
"name": "grid",
"type": "integer[][]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Matrix', 'Simulation'] |
2,353 | Design a Food Rating System | design-a-food-rating-system | <p>Design a food rating system that can do the following:</p>
<ul>
<li><strong>Modify</strong> the rating of a food item listed in the system.</li>
<li>Return the highest-rated food item for a type of cuisine in the system.</li>
</ul>
<p>Implement the <code>FoodRatings</code> class:</p>
<ul>
<li><code>FoodRatings... | Medium | 89.1K | 196.9K | 89,103 | 196,907 | 45.3% | ['design-a-number-container-system', 'most-popular-video-creator'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class FoodRatings {\npublic:\n FoodRatings(vector<string>& foods, vector<string>& cuisines, vector<int>& ratings) {\n \n }\n \n void changeRating(string food, int newRating) {\n \n }\n \n string highestRated(string cuisine) {\n \... | ["FoodRatings","highestRated","highestRated","changeRating","highestRated","changeRating","highestRated"]
[[["kimchi","miso","sushi","moussaka","ramen","bulgogi"],["korean","japanese","japanese","greek","japanese","korean"],[9,12,8,15,14,7]],["korean"],["japanese"],["sushi",16],["japanese"],["ramen",16],["japanese"]] | {
"classname": "FoodRatings",
"constructor": {
"params": [
{
"type": "string[]",
"name": "foods"
},
{
"name": "cuisines",
"type": "string[]"
},
{
"name": "ratings",
"type": "integer[]"
}
]
},
"methods": [
{
"pa... | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'String', 'Design', 'Heap (Priority Queue)', 'Ordered Set'] |
2,354 | Number of Excellent Pairs | number-of-excellent-pairs | <p>You are given a <strong>0-indexed</strong> positive integer array <code>nums</code> and a positive integer <code>k</code>.</p>
<p>A pair of numbers <code>(num1, num2)</code> is called <strong>excellent</strong> if the following conditions are satisfied:</p>
<ul>
<li><strong>Both</strong> the numbers <code>num1</c... | Hard | 16.6K | 34.7K | 16,581 | 34,676 | 47.8% | ['two-sum'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long countExcellentPairs(vector<int>& nums, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long countExcellentPairs(int[] nums, int k) {\n \n }\n}"}, {"value": ... | [1,2,3,1]
3 | {
"name": "countExcellentPairs",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Binary Search', 'Bit Manipulation'] |
2,355 | Maximum Number of Books You Can Take | maximum-number-of-books-you-can-take | null | Hard | 12.7K | 32.5K | 12,747 | 32,477 | 39.2% | ['longest-increasing-subsequence', 'maximum-ascending-subarray-sum', 'beautiful-towers-ii', 'beautiful-towers-i'] | [] | Algorithms | null | [8,5,2,7,9] | {
"name": "maximumBooks",
"params": [
{
"name": "books",
"type": "integer[]"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Dynamic Programming', 'Stack', 'Monotonic Stack'] |
2,356 | Number of Unique Subjects Taught by Each Teacher | number-of-unique-subjects-taught-by-each-teacher | <p>Table: <code>Teacher</code></p>
<pre>
+-------------+------+
| Column Name | Type |
+-------------+------+
| teacher_id | int |
| subject_id | int |
| dept_id | int |
+-------------+------+
(subject_id, dept_id) is the primary key (combinations of columns with unique values) of this table.
Each row in this... | Easy | 341.7K | 382.6K | 341,710 | 382,573 | 89.3% | [] | ['Create table If Not Exists Teacher (teacher_id int, subject_id int, dept_id int)', 'Truncate table Teacher', "insert into Teacher (teacher_id, subject_id, dept_id) values ('1', '2', '3')", "insert into Teacher (teacher_id, subject_id, dept_id) values ('1', '2', '4')", "insert into Teacher (teacher_id, subject_id, dep... | Database | [{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"v... | {"headers":{"Teacher":["teacher_id","subject_id","dept_id"]},"rows":{"Teacher":[[1,2,3],[1,2,4],[1,3,3],[2,1,1],[2,2,1],[2,3,1],[2,4,1]]}} | {"mysql": ["Create table If Not Exists Teacher (teacher_id int, subject_id int, dept_id int)"], "mssql": ["Create table Teacher (teacher_id int, subject_id int, dept_id int)"], "oraclesql": ["Create table Teacher (teacher_id int, subject_id int, dept_id int)"], "database": true, "name": "count_unique_subjects", "python... | {"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16<... | ['Database'] |
2,357 | Make Array Zero by Subtracting Equal Amounts | make-array-zero-by-subtracting-equal-amounts | <p>You are given a non-negative integer array <code>nums</code>. In one operation, you must:</p>
<ul>
<li>Choose a positive integer <code>x</code> such that <code>x</code> is less than or equal to the <strong>smallest non-zero</strong> element in <code>nums</code>.</li>
<li>Subtract <code>x</code> from every <strong... | Easy | 147.3K | 201.3K | 147,330 | 201,340 | 73.2% | ['contains-duplicate'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minimumOperations(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minimumOperations(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python... | [1,5,0,3,5] | {
"name": "minimumOperations",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Greedy', 'Sorting', 'Heap (Priority Queue)', 'Simulation'] |
2,358 | Maximum Number of Groups Entering a Competition | maximum-number-of-groups-entering-a-competition | <p>You are given a positive integer array <code>grades</code> which represents the grades of students in a university. You would like to enter <strong>all</strong> these students into a competition in <strong>ordered</strong> non-empty groups, such that the ordering meets the following conditions:</p>
<ul>
<li>The su... | Medium | 41.3K | 60.7K | 41,303 | 60,719 | 68.0% | ['maximum-height-by-stacking-cuboids'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maximumGroups(vector<int>& grades) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maximumGroups(int[] grades) {\n \n }\n}"}, {"value": "python", "text": "Python", "... | [10,6,12,7,3,5] | {
"name": "maximumGroups",
"params": [
{
"name": "grades",
"type": "integer[]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Math', 'Binary Search', 'Greedy'] |
2,359 | Find Closest Node to Given Two Nodes | find-closest-node-to-given-two-nodes | <p>You are given a <strong>directed</strong> graph of <code>n</code> nodes numbered from <code>0</code> to <code>n - 1</code>, where each node has <strong>at most one</strong> outgoing edge.</p>
<p>The graph is represented with a given <strong>0-indexed</strong> array <code>edges</code> of size <code>n</code>, indicat... | Medium | 85K | 186.1K | 85,042 | 186,087 | 45.7% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int closestMeetingNode(vector<int>& edges, int node1, int node2) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int closestMeetingNode(int[] edges, int node1, int node2) {\n \... | [2,2,3,-1]
0
1 | {
"name": "closestMeetingNode",
"params": [
{
"name": "edges",
"type": "integer[]"
},
{
"type": "integer",
"name": "node1"
},
{
"type": "integer",
"name": "node2"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Depth-First Search', 'Graph'] |
2,360 | Longest Cycle in a Graph | longest-cycle-in-a-graph | <p>You are given a <strong>directed</strong> graph of <code>n</code> nodes numbered from <code>0</code> to <code>n - 1</code>, where each node has <strong>at most one</strong> outgoing edge.</p>
<p>The graph is represented with a given <strong>0-indexed</strong> array <code>edges</code> of size <code>n</code>, indicat... | Hard | 87.2K | 175.3K | 87,235 | 175,251 | 49.8% | ['strange-printer-ii', 'minimum-number-of-operations-to-sort-a-binary-tree-by-level', 'shortest-cycle-in-a-graph'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int longestCycle(vector<int>& edges) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int longestCycle(int[] edges) {\n \n }\n}"}, {"value": "python", "text": "Python", "defa... | [3,3,4,2,3] | {
"name": "longestCycle",
"params": [
{
"name": "edges",
"type": "integer[]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Depth-First Search', 'Breadth-First Search', 'Graph', 'Topological Sort'] |
2,361 | Minimum Costs Using the Train Line | minimum-costs-using-the-train-line | null | Hard | 13.2K | 17.1K | 13,237 | 17,074 | 77.5% | ['bus-routes', 'distance-between-bus-stops'] | [] | Algorithms | null | [1,6,9,5]
[5,2,3,10]
8 | {
"name": "minimumCosts",
"params": [
{
"name": "regular",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "express"
},
{
"type": "integer",
"name": "expressCost"
}
],
"return": {
"type": "long[]"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Dynamic Programming'] |
2,362 | Generate the Invoice | generate-the-invoice | null | Hard | 4.6K | 6K | 4,596 | 6,034 | 76.2% | [] | ['Create table If Not Exists Products (product_id int, price int)', 'Create table If Not Exists Purchases (invoice_id int, product_id int, quantity int)', 'Truncate table Products', "insert into Products (product_id, price) values ('1', '100')", "insert into Products (product_id, price) values ('2', '200')", 'Truncate ... | Database | null | {"headers":{"Products":["product_id","price"],"Purchases":["invoice_id","product_id","quantity"]},"rows":{"Products":[[1,100],[2,200]],"Purchases":[[1,1,2],[3,2,1],[2,2,3],[2,1,4],[4,1,10]]}} | {"mysql": ["Create table If Not Exists Products (product_id int, price int)", "Create table If Not Exists Purchases (invoice_id int, product_id int, quantity int)"], "mssql": ["Create table Products (product_id int, price int)", "Create table Purchases (invoice_id int, product_id int, quantity int)"], "oraclesql": ["Cr... | {"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16<... | ['Database'] |
2,363 | Merge Similar Items | merge-similar-items | <p>You are given two 2D integer arrays, <code>items1</code> and <code>items2</code>, representing two sets of items. Each array <code>items</code> has the following properties:</p>
<ul>
<li><code>items[i] = [value<sub>i</sub>, weight<sub>i</sub>]</code> where <code>value<sub>i</sub></code> represents the <strong>valu... | Easy | 69.3K | 90.5K | 69,298 | 90,482 | 76.6% | ['merge-two-2d-arrays-by-summing-values'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<vector<int>> mergeSimilarItems(vector<vector<int>>& items1, vector<vector<int>>& items2) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public List<List<Integer>> mergeSimilarItems(i... | [[1,1],[4,5],[3,8]]
[[3,1],[1,5]] | {
"name": "mergeSimilarItems",
"params": [
{
"type": "integer[][]",
"name": "items1"
},
{
"type": "integer[][]",
"name": "items2"
}
],
"return": {
"type": "list<list<integer>>"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Sorting', 'Ordered Set'] |
2,364 | Count Number of Bad Pairs | count-number-of-bad-pairs | <p>You are given a <strong>0-indexed</strong> integer array <code>nums</code>. A pair of indices <code>(i, j)</code> is a <strong>bad pair</strong> if <code>i < j</code> and <code>j - i != nums[j] - nums[i]</code>.</p>
<p>Return<em> the total number of <strong>bad pairs</strong> in </em><code>nums</code>.</p>
<p>&... | Medium | 172.9K | 317.3K | 172,869 | 317,345 | 54.5% | ['k-diff-pairs-in-an-array', 'subarray-sums-divisible-by-k', 'count-nice-pairs-in-an-array', 'count-number-of-pairs-with-absolute-difference-k', 'count-equal-and-divisible-pairs-in-an-array', 'number-of-pairs-satisfying-inequality'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long countBadPairs(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long countBadPairs(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python"... | [4,1,3,3] | {
"name": "countBadPairs",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Math', 'Counting'] |
2,365 | Task Scheduler II | task-scheduler-ii | <p>You are given a <strong>0-indexed</strong> array of positive integers <code>tasks</code>, representing tasks that need to be completed <strong>in order</strong>, where <code>tasks[i]</code> represents the <strong>type</strong> of the <code>i<sup>th</sup></code> task.</p>
<p>You are also given a positive integer <co... | Medium | 46.7K | 86.9K | 46,732 | 86,855 | 53.8% | ['task-scheduler', 'maximize-distance-to-closest-person', 'check-if-all-1s-are-at-least-length-k-places-away'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long taskSchedulerII(vector<int>& tasks, int space) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long taskSchedulerII(int[] tasks, int space) {\n \n }\n}"}, {"value"... | [1,2,1,2,3,1]
3 | {
"name": "taskSchedulerII",
"params": [
{
"name": "tasks",
"type": "integer[]"
},
{
"type": "integer",
"name": "space"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Simulation'] |
2,366 | Minimum Replacements to Sort the Array | minimum-replacements-to-sort-the-array | <p>You are given a <strong>0-indexed</strong> integer array <code>nums</code>. In one operation you can replace any element of the array with <strong>any two</strong> elements that <strong>sum</strong> to it.</p>
<ul>
<li>For example, consider <code>nums = [5,6,7]</code>. In one operation, we can replace <code>nums[1... | Hard | 70.1K | 131.6K | 70,087 | 131,582 | 53.3% | ['minimum-operations-to-make-the-array-increasing'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long minimumReplacement(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long minimumReplacement(int[] nums) {\n \n }\n}"}, {"value": "python", "text"... | [3,9,3] | {
"name": "minimumReplacement",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Math', 'Greedy'] |
2,367 | Number of Arithmetic Triplets | number-of-arithmetic-triplets | <p>You are given a <strong>0-indexed</strong>, <strong>strictly increasing</strong> integer array <code>nums</code> and a positive integer <code>diff</code>. A triplet <code>(i, j, k)</code> is an <strong>arithmetic triplet</strong> if the following conditions are met:</p>
<ul>
<li><code>i < j < k</code>,</li>
... | Easy | 154.8K | 182.5K | 154,752 | 182,460 | 84.8% | ['two-sum', '3sum', 'number-of-unequal-triplets-in-array', 'maximum-value-of-an-ordered-triplet-i', 'minimum-sum-of-mountain-triplets-i'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int arithmeticTriplets(vector<int>& nums, int diff) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int arithmeticTriplets(int[] nums, int diff) {\n \n }\n}"}, {"value": "py... | [0,1,4,6,7,10]
3 | {
"name": "arithmeticTriplets",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer",
"name": "diff"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Two Pointers', 'Enumeration'] |
2,368 | Reachable Nodes With Restrictions | reachable-nodes-with-restrictions | <p>There is an undirected tree with <code>n</code> nodes labeled from <code>0</code> to <code>n - 1</code> and <code>n - 1</code> edges.</p>
<p>You are given a 2D integer array <code>edges</code> of length <code>n - 1</code> where <code>edges[i] = [a<sub>i</sub>, b<sub>i</sub>]</code> indicates that there is an edge b... | Medium | 69.9K | 118K | 69,927 | 117,973 | 59.3% | ['open-the-lock', 'minimum-jumps-to-reach-home'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int reachableNodes(int n, vector<vector<int>>& edges, vector<int>& restricted) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int reachableNodes(int n, int[][] edges, int[] restricte... | 7
[[0,1],[1,2],[3,1],[4,0],[0,5],[5,6]]
[4,5] | {
"name": "reachableNodes",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[][]",
"name": "edges"
},
{
"type": "integer[]",
"name": "restricted"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Tree', 'Depth-First Search', 'Breadth-First Search', 'Union Find', 'Graph'] |
2,369 | Check if There is a Valid Partition For The Array | check-if-there-is-a-valid-partition-for-the-array | <p>You are given a <strong>0-indexed</strong> integer array <code>nums</code>. You have to partition the array into one or more <strong>contiguous</strong> subarrays.</p>
<p>We call a partition of the array <strong>valid</strong> if each of the obtained subarrays satisfies <strong>one</strong> of the following conditi... | Medium | 94.4K | 181.9K | 94,356 | 181,918 | 51.9% | ['count-the-number-of-good-partitions'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool validPartition(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean validPartition(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python"... | [4,4,4,5,6] | {
"name": "validPartition",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "boolean"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Dynamic Programming'] |
2,370 | Longest Ideal Subsequence | longest-ideal-subsequence | <p>You are given a string <code>s</code> consisting of lowercase letters and an integer <code>k</code>. We call a string <code>t</code> <strong>ideal</strong> if the following conditions are satisfied:</p>
<ul>
<li><code>t</code> is a <strong>subsequence</strong> of the string <code>s</code>.</li>
<li>The absolute d... | Medium | 119.1K | 254K | 119,069 | 254,017 | 46.9% | ['longest-increasing-subsequence'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int longestIdealString(string s, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int longestIdealString(String s, int k) {\n \n }\n}"}, {"value": "python", "text": "P... | "acfgbd"
2 | {
"name": "longestIdealString",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Hash Table', 'String', 'Dynamic Programming'] |
2,371 | Minimize Maximum Value in a Grid | minimize-maximum-value-in-a-grid | null | Hard | 6.8K | 9.6K | 6,773 | 9,587 | 70.6% | ['candy'] | [] | Algorithms | null | [[3,1],[2,5]] | {
"name": "minScore",
"params": [
{
"name": "grid",
"type": "integer[][]"
}
],
"return": {
"type": "integer[][]"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Union Find', 'Graph', 'Topological Sort', 'Sorting', 'Matrix'] |
2,372 | Calculate the Influence of Each Salesperson | calculate-the-influence-of-each-salesperson | null | Medium | 6.7K | 8.1K | 6,729 | 8,051 | 83.6% | [] | ['Create table If Not Exists Salesperson (salesperson_id int, name varchar(30))', 'Create table If Not Exists Customer (customer_id int, salesperson_id int)', 'Create table If Not Exists Sales (sale_id int, customer_id int, price int)', 'Truncate table Salesperson', "insert into Salesperson (salesperson_id, name) value... | Database | null | {"headers":{"Salesperson":["salesperson_id","name"],"Customer":["customer_id","salesperson_id"],"Sales":["sale_id","customer_id","price"]},"rows":{"Salesperson":[[1,"Alice"],[2,"Bob"],[3,"Jerry"]],"Customer":[[1,1],[2,1],[3,2]],"Sales":[[1,2,892],[2,1,354],[3,3,988],[4,3,856]]}} | {"mysql": ["Create table If Not Exists Salesperson (salesperson_id int, name varchar(30))", "Create table If Not Exists Customer (customer_id int, salesperson_id int)", "Create table If Not Exists Sales (sale_id int, customer_id int, price int)"], "mssql": ["Create table Salesperson (salesperson_id int, name varchar(30... | {"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16<... | ['Database'] |
2,373 | Largest Local Values in a Matrix | largest-local-values-in-a-matrix | <p>You are given an <code>n x n</code> integer matrix <code>grid</code>.</p>
<p>Generate an integer matrix <code>maxLocal</code> of size <code>(n - 2) x (n - 2)</code> such that:</p>
<ul>
<li><code>maxLocal[i][j]</code> is equal to the <strong>largest</strong> value of the <code>3 x 3</code> matrix in <code>grid</co... | Easy | 179.7K | 204.8K | 179,720 | 204,765 | 87.8% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<vector<int>> largestLocal(vector<vector<int>>& grid) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[][] largestLocal(int[][] grid) {\n \n }\n}"}, {"value": "pyth... | [[9,9,8,1],[5,6,2,6],[8,2,6,4],[6,2,2,2]] | {
"name": "largestLocal",
"params": [
{
"name": "grid",
"type": "integer[][]"
}
],
"return": {
"type": "integer[][]"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Matrix'] |
2,374 | Node With Highest Edge Score | node-with-highest-edge-score | <p>You are given a directed graph with <code>n</code> nodes labeled from <code>0</code> to <code>n - 1</code>, where each node has <strong>exactly one</strong> outgoing edge.</p>
<p>The graph is represented by a given <strong>0-indexed</strong> integer array <code>edges</code> of length <code>n</code>, where <code>edg... | Medium | 39K | 80.8K | 38,992 | 80,831 | 48.2% | ['two-sum', 'sort-characters-by-frequency', 'sort-array-by-increasing-frequency'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int edgeScore(vector<int>& edges) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int edgeScore(int[] edges) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCod... | [1,0,0,0,0,7,7,5] | {
"name": "edgeScore",
"params": [
{
"name": "edges",
"type": "integer[]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Hash Table', 'Graph'] |
2,375 | Construct Smallest Number From DI String | construct-smallest-number-from-di-string | <p>You are given a <strong>0-indexed</strong> string <code>pattern</code> of length <code>n</code> consisting of the characters <code>'I'</code> meaning <strong>increasing</strong> and <code>'D'</code> meaning <strong>decreasing</strong>.</p>
<p>A <strong>0-indexed</strong> string <code>num</code> of l... | Medium | 154.5K | 180K | 154,522 | 180,023 | 85.8% | ['di-string-match'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string smallestNumber(string pattern) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String smallestNumber(String pattern) {\n \n }\n}"}, {"value": "python", "text": "Pytho... | "IIIDIDDD" | {
"name": "smallestNumber",
"params": [
{
"name": "pattern",
"type": "string"
}
],
"return": {
"type": "string"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['String', 'Backtracking', 'Stack', 'Greedy'] |
2,376 | Count Special Integers | count-special-integers | <p>We call a positive integer <strong>special</strong> if all of its digits are <strong>distinct</strong>.</p>
<p>Given a <strong>positive</strong> integer <code>n</code>, return <em>the number of special integers that belong to the interval </em><code>[1, n]</code>.</p>
<p> </p>
<p><strong class="example">Examp... | Hard | 14K | 35.6K | 14,044 | 35,596 | 39.5% | ['count-numbers-with-unique-digits', 'k-th-smallest-in-lexicographical-order'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countSpecialNumbers(int n) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countSpecialNumbers(int n) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCo... | 20 | {
"name": "countSpecialNumbers",
"params": [
{
"name": "n",
"type": "integer"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Math', 'Dynamic Programming'] |
2,377 | Sort the Olympic Table | sort-the-olympic-table | null | Easy | 7.6K | 9.5K | 7,563 | 9,520 | 79.4% | [] | ['Create table If Not Exists Olympic (country varchar(50), gold_medals int, silver_medals int, bronze_medals int)', 'Truncate table Olympic', "insert into Olympic (country, gold_medals, silver_medals, bronze_medals) values ('China', '10', '10', '20')", "insert into Olympic (country, gold_medals, silver_medals, bronze_m... | Database | null | {"headers":{"Olympic":["country","gold_medals","silver_medals","bronze_medals"]},"rows":{"Olympic":[["China",10,10,20],["South Sudan",0,0,1],["USA",10,10,20],["Israel",2,2,3],["Egypt",2,2,2]]}} | {"mysql": ["Create table If Not Exists Olympic (country varchar(50), gold_medals int, silver_medals int, bronze_medals int)"], "mssql": ["Create table Olympic (country varchar(50), gold_medals int, silver_medals int, bronze_medals int)"], "oraclesql": ["Create table Olympic (country varchar(50), gold_medals int, silver... | {"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16<... | ['Database'] |
2,378 | Choose Edges to Maximize Score in a Tree | choose-edges-to-maximize-score-in-a-tree | null | Medium | 1.8K | 3.2K | 1,807 | 3,219 | 56.1% | ['binary-tree-cameras', 'longest-path-with-different-adjacent-characters'] | [] | Algorithms | null | [[-1,-1],[0,5],[0,10],[2,6],[2,4]] | {
"name": "maxScore",
"params": [
{
"name": "edges",
"type": "integer[][]"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Dynamic Programming', 'Tree', 'Depth-First Search'] |
2,379 | Minimum Recolors to Get K Consecutive Black Blocks | minimum-recolors-to-get-k-consecutive-black-blocks | <p>You are given a <strong>0-indexed</strong> string <code>blocks</code> of length <code>n</code>, where <code>blocks[i]</code> is either <code>'W'</code> or <code>'B'</code>, representing the color of the <code>i<sup>th</sup></code> block. The characters <code>'W'</code> and <code>'B'</... | Easy | 203.5K | 297.2K | 203,484 | 297,170 | 68.5% | ['max-consecutive-ones-iii', 'maximum-points-you-can-obtain-from-cards', 'maximum-number-of-vowels-in-a-substring-of-given-length'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minimumRecolors(string blocks, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minimumRecolors(String blocks, int k) {\n \n }\n}"}, {"value": "python", "text"... | "WBBWWBBWBW"
7 | {
"name": "minimumRecolors",
"params": [
{
"name": "blocks",
"type": "string"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['String', 'Sliding Window'] |
2,380 | Time Needed to Rearrange a Binary String | time-needed-to-rearrange-a-binary-string | <p>You are given a binary string <code>s</code>. In one second, <strong>all</strong> occurrences of <code>"01"</code> are <strong>simultaneously</strong> replaced with <code>"10"</code>. This process <strong>repeats</strong> until no occurrences of <code>"01"</code> exist.</p>
<p>Return<e... | Medium | 37.6K | 73.2K | 37,596 | 73,160 | 51.4% | ['minimum-swaps-to-group-all-1s-together', 'minimum-swaps-to-group-all-1s-together-ii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int secondsToRemoveOccurrences(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int secondsToRemoveOccurrences(String s) {\n \n }\n}"}, {"value": "python", "text": ... | "0110101" | {
"name": "secondsToRemoveOccurrences",
"params": [
{
"name": "s",
"type": "string"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['String', 'Dynamic Programming', 'Simulation'] |
2,381 | Shifting Letters II | shifting-letters-ii | <p>You are given a string <code>s</code> of lowercase English letters and a 2D integer array <code>shifts</code> where <code>shifts[i] = [start<sub>i</sub>, end<sub>i</sub>, direction<sub>i</sub>]</code>. For every <code>i</code>, <strong>shift</strong> the characters in <code>s</code> from the index <code>start<sub>i<... | Medium | 148.2K | 278.3K | 148,169 | 278,273 | 53.2% | ['the-skyline-problem', 'range-sum-query-mutable', 'range-addition', 'shifting-letters', 'maximum-population-year', 'describe-the-painting', 'shift-distance-between-two-strings'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string shiftingLetters(string s, vector<vector<int>>& shifts) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String shiftingLetters(String s, int[][] shifts) {\n \n }\n}"},... | "abc"
[[0,1,0],[1,2,1],[0,2,1]] | {
"name": "shiftingLetters",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer[][]",
"name": "shifts"
}
],
"return": {
"type": "string"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'String', 'Prefix Sum'] |
2,382 | Maximum Segment Sum After Removals | maximum-segment-sum-after-removals | <p>You are given two <strong>0-indexed</strong> integer arrays <code>nums</code> and <code>removeQueries</code>, both of length <code>n</code>. For the <code>i<sup>th</sup></code> query, the element in <code>nums</code> at the index <code>removeQueries[i]</code> is removed, splitting <code>nums</code> into different se... | Hard | 10.6K | 22K | 10,591 | 22,011 | 48.1% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<long long> maximumSegmentSum(vector<int>& nums, vector<int>& removeQueries) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long[] maximumSegmentSum(int[] nums, int[] removeQue... | [1,2,5,6,1]
[0,3,2,4,1] | {
"name": "maximumSegmentSum",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "removeQueries"
}
],
"return": {
"type": "long[]"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Union Find', 'Prefix Sum', 'Ordered Set'] |
2,383 | Minimum Hours of Training to Win a Competition | minimum-hours-of-training-to-win-a-competition | <p>You are entering a competition, and are given two <strong>positive</strong> integers <code>initialEnergy</code> and <code>initialExperience</code> denoting your initial energy and initial experience respectively.</p>
<p>You are also given two <strong>0-indexed</strong> integer arrays <code>energy</code> and <code>e... | Easy | 36.1K | 86.6K | 36,127 | 86,606 | 41.7% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minNumberOfHours(int initialEnergy, int initialExperience, vector<int>& energy, vector<int>& experience) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minNumberOfHours(int i... | 5
3
[1,4,3,2]
[2,6,3,1] | {
"name": "minNumberOfHours",
"params": [
{
"name": "initialEnergy",
"type": "integer"
},
{
"type": "integer",
"name": "initialExperience"
},
{
"type": "integer[]",
"name": "energy"
},
{
"type": "integer[]",
"name": "experience"
}
],
... | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Greedy'] |
2,384 | Largest Palindromic Number | largest-palindromic-number | <p>You are given a string <code>num</code> consisting of digits only.</p>
<p>Return <em>the <strong>largest palindromic</strong> integer (in the form of a string) that can be formed using digits taken from </em><code>num</code>. It should not contain <strong>leading zeroes</strong>.</p>
<p><strong>Notes:</strong></p>... | Medium | 46.9K | 129.3K | 46,918 | 129,299 | 36.3% | ['longest-palindrome'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string largestPalindromic(string num) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String largestPalindromic(String num) {\n \n }\n}"}, {"value": "python", "text": "Pytho... | "444947137" | {
"name": "largestPalindromic",
"params": [
{
"name": "num",
"type": "string"
}
],
"return": {
"type": "string"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Hash Table', 'String', 'Greedy', 'Counting'] |
2,385 | Amount of Time for Binary Tree to Be Infected | amount-of-time-for-binary-tree-to-be-infected | <p>You are given the <code>root</code> of a binary tree with <strong>unique</strong> values, and an integer <code>start</code>. At minute <code>0</code>, an <strong>infection</strong> starts from the node with value <code>start</code>.</p>
<p>Each minute, a node becomes infected if:</p>
<ul>
<li>The node is currentl... | Medium | 161K | 254.4K | 160,991 | 254,403 | 63.3% | ['maximum-depth-of-binary-tree', 'shortest-path-to-get-food', 'all-nodes-distance-k-in-binary-tree', 'count-the-number-of-infection-sequences'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "/**\n * Definition for a binary tree node.\n * struct TreeNode {\n * int val;\n * TreeNode *left;\n * TreeNode *right;\n * TreeNode() : val(0), left(nullptr), right(nullptr) {}\n * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}\n * Tre... | [1,5,3,null,4,10,6,9,2]
3 | {
"name": "amountOfTime",
"params": [
{
"name": "root",
"type": "TreeNode"
},
{
"type": "integer",
"name": "start"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Hash Table', 'Tree', 'Depth-First Search', 'Breadth-First Search', 'Binary Tree'] |
2,386 | Find the K-Sum of an Array | find-the-k-sum-of-an-array | <p>You are given an integer array <code>nums</code> and a <strong>positive</strong> integer <code>k</code>. You can choose any <strong>subsequence</strong> of the array and sum all of its elements together.</p>
<p>We define the <strong>K-Sum</strong> of the array as the <code>k<sup>th</sup></code> <strong>largest</str... | Hard | 10.9K | 27.6K | 10,883 | 27,610 | 39.4% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long kSum(vector<int>& nums, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long kSum(int[] nums, int k) {\n \n }\n}"}, {"value": "python", "text": "Python", "d... | [2,4,-2]
5 | {
"name": "kSum",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Sorting', 'Heap (Priority Queue)'] |
2,387 | Median of a Row Wise Sorted Matrix | median-of-a-row-wise-sorted-matrix | null | Medium | 4.6K | 6.7K | 4,627 | 6,669 | 69.4% | ['median-of-two-sorted-arrays'] | [] | Algorithms | null | [[1,1,2],[2,3,3],[1,3,4]] | {
"name": "matrixMedian",
"params": [
{
"name": "grid",
"type": "integer[][]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Binary Search', 'Matrix'] |
2,388 | Change Null Values in a Table to the Previous Value | change-null-values-in-a-table-to-the-previous-value | null | Medium | 5.6K | 10.8K | 5,559 | 10,818 | 51.4% | [] | ['Create table If Not Exists CoffeeShop (id int, drink varchar(20))', 'Truncate table CoffeeShop', "insert into CoffeeShop (id, drink) values ('9', 'Rum and Coke')", "insert into CoffeeShop (id, drink) values ('6', NULL)", "insert into CoffeeShop (id, drink) values ('7', NULL)", "insert into CoffeeShop (id, drink) valu... | Database | null | {"headers": {"CoffeeShop": ["id", "drink"]}, "rows": {"CoffeeShop": [[9, "Rum and Coke"], [6, null], [7, null], [3, "St Germain Spritz"], [1, "Orange Margarita"], [2, null]]}} | {"mysql": ["Create table If Not Exists CoffeeShop (id int, drink varchar(20))"], "mssql": ["Create table CoffeeShop (id int, drink varchar(20))"], "oraclesql": ["Create table CoffeeShop (id int, drink varchar(20))"], "database": true, "name": "change_null_values", "pythondata": ["CoffeeShop = pd.DataFrame([], columns=[... | {"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16<... | ['Database'] |
2,389 | Longest Subsequence With Limited Sum | longest-subsequence-with-limited-sum | <p>You are given an integer array <code>nums</code> of length <code>n</code>, and an integer array <code>queries</code> of length <code>m</code>.</p>
<p>Return <em>an array </em><code>answer</code><em> of length </em><code>m</code><em> where </em><code>answer[i]</code><em> is the <strong>maximum</strong> size of a <st... | Easy | 135.1K | 186K | 135,110 | 186,007 | 72.6% | ['how-many-numbers-are-smaller-than-the-current-number', 'successful-pairs-of-spells-and-potions'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> answerQueries(vector<int>& nums, vector<int>& queries) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] answerQueries(int[] nums, int[] queries) {\n \n }\n}... | [4,5,2,1]
[3,10,21] | {
"name": "answerQueries",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "queries"
}
],
"return": {
"type": "integer[]"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Binary Search', 'Greedy', 'Sorting', 'Prefix Sum'] |
2,390 | Removing Stars From a String | removing-stars-from-a-string | <p>You are given a string <code>s</code>, which contains stars <code>*</code>.</p>
<p>In one operation, you can:</p>
<ul>
<li>Choose a star in <code>s</code>.</li>
<li>Remove the closest <strong>non-star</strong> character to its <strong>left</strong>, as well as remove the star itself.</li>
</ul>
<p>Return <em>th... | Medium | 481K | 619.6K | 480,970 | 619,599 | 77.6% | ['backspace-string-compare', 'remove-all-adjacent-duplicates-in-string'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string removeStars(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String removeStars(String s) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCode":... | "leet**cod*e" | {
"name": "removeStars",
"params": [
{
"name": "s",
"type": "string"
}
],
"return": {
"type": "string"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['String', 'Stack', 'Simulation'] |
2,391 | Minimum Amount of Time to Collect Garbage | minimum-amount-of-time-to-collect-garbage | <p>You are given a <strong>0-indexed</strong> array of strings <code>garbage</code> where <code>garbage[i]</code> represents the assortment of garbage at the <code>i<sup>th</sup></code> house. <code>garbage[i]</code> consists only of the characters <code>'M'</code>, <code>'P'</code> and <code>'G'... | Medium | 143.3K | 168.4K | 143,273 | 168,364 | 85.1% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int garbageCollection(vector<string>& garbage, vector<int>& travel) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int garbageCollection(String[] garbage, int[] travel) {\n \n... | ["G","P","GP","GG"]
[2,4,3] | {
"name": "garbageCollection",
"params": [
{
"name": "garbage",
"type": "string[]"
},
{
"type": "integer[]",
"name": "travel"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'String', 'Prefix Sum'] |
2,392 | Build a Matrix With Conditions | build-a-matrix-with-conditions | <p>You are given a <strong>positive</strong> integer <code>k</code>. You are also given:</p>
<ul>
<li>a 2D integer array <code>rowConditions</code> of size <code>n</code> where <code>rowConditions[i] = [above<sub>i</sub>, below<sub>i</sub>]</code>, and</li>
<li>a 2D integer array <code>colConditions</code> of size <... | Hard | 96.9K | 122.3K | 96,911 | 122,307 | 79.2% | ['course-schedule', 'course-schedule-ii', 'find-eventual-safe-states', 'loud-and-rich'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<vector<int>> buildMatrix(int k, vector<vector<int>>& rowConditions, vector<vector<int>>& colConditions) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[][] buildMatrix(int ... | 3
[[1,2],[3,2]]
[[2,1],[3,2]] | {
"name": "buildMatrix",
"params": [
{
"name": "k",
"type": "integer"
},
{
"type": "integer[][]",
"name": "rowConditions"
},
{
"type": "integer[][]",
"name": "colConditions"
}
],
"return": {
"type": "integer[][]"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Graph', 'Topological Sort', 'Matrix'] |
2,393 | Count Strictly Increasing Subarrays | count-strictly-increasing-subarrays | null | Medium | 7.4K | 10.4K | 7,432 | 10,441 | 71.2% | ['maximum-ascending-subarray-sum'] | [] | Algorithms | null | [1,3,5,4,4,6] | {
"name": "countSubarrays",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Math', 'Dynamic Programming'] |
2,394 | Employees With Deductions | employees-with-deductions | null | Medium | 5.8K | 13.9K | 5,843 | 13,950 | 41.9% | [] | ['Create table If Not Exists Employees (employee_id int, needed_hours int)', 'Create table If Not Exists Logs (employee_id int, in_time datetime, out_time datetime)', 'Truncate table Employees', "insert into Employees (employee_id, needed_hours) values ('1', '20')", "insert into Employees (employee_id, needed_hours) va... | Database | null | {"headers": {"Employees": ["employee_id", "needed_hours"], "Logs": ["employee_id", "in_time", "out_time"]}, "rows": {"Employees": [[1, 20], [2, 12], [3, 2]], "Logs": [[1, "2022-10-01 09:00:00", "2022-10-01 17:00:00"],[1, "2022-10-06 09:05:04", "2022-10-06 17:09:03"], [1, "2022-10-12 23:00:00", "2022-10-13 03:00:01"], [... | {"mysql": ["Create table If Not Exists Employees (employee_id int, needed_hours int)", "Create table If Not Exists Logs (employee_id int, in_time datetime, out_time datetime)"], "mssql": ["Create table Employees (employee_id int, needed_hours int)", "Create table Logs (employee_id int, in_time datetime, out_time dateti... | {"mysql": ["MySQL", "<p><code>MySQL 8.0</code>.</p>"], "mssql": ["MS SQL Server", "<p><code>mssql server 2019</code>.</p>"], "oraclesql": ["Oracle", "<p><code>Oracle Sql 11.2</code>.</p>"], "pythondata": ["Pandas", "<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4</p>"], "postgresql": ["PostgreSQL", "<p>PostgreSQL 16<... | ['Database'] |
2,395 | Find Subarrays With Equal Sum | find-subarrays-with-equal-sum | <p>Given a <strong>0-indexed</strong> integer array <code>nums</code>, determine whether there exist <strong>two</strong> subarrays of length <code>2</code> with <strong>equal</strong> sum. Note that the two subarrays must begin at <strong>different</strong> indices.</p>
<p>Return <code>true</code><em> if these subarr... | Easy | 61.1K | 92.5K | 61,069 | 92,467 | 66.0% | ['two-sum', 'partition-equal-subset-sum', 'find-two-non-overlapping-sub-arrays-each-with-target-sum'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool findSubarrays(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean findSubarrays(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python", ... | [4,2,4] | {
"name": "findSubarrays",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "boolean"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table'] |
2,396 | Strictly Palindromic Number | strictly-palindromic-number | <p>An integer <code>n</code> is <strong>strictly palindromic</strong> if, for <strong>every</strong> base <code>b</code> between <code>2</code> and <code>n - 2</code> (<strong>inclusive</strong>), the string representation of the integer <code>n</code> in base <code>b</code> is <strong>palindromic</strong>.</p>
<p>Giv... | Medium | 111.1K | 126.2K | 111,114 | 126,219 | 88.0% | ['palindrome-number', 'stone-game'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool isStrictlyPalindromic(int n) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean isStrictlyPalindromic(int n) {\n \n }\n}"}, {"value": "python", "text": "Python", "... | 9 | {
"name": "isStrictlyPalindromic",
"params": [
{
"name": "n",
"type": "integer"
}
],
"return": {
"type": "boolean"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Math', 'Two Pointers', 'Brainteaser'] |
2,397 | Maximum Rows Covered by Columns | maximum-rows-covered-by-columns | <p>You are given an <code>m x n</code> binary matrix <code>matrix</code> and an integer <code>numSelect</code>.</p>
<p>Your goal is to select exactly <code>numSelect</code> <strong>distinct </strong>columns from <code>matrix</code> such that you cover as many rows as possible.</p>
<p>A row is considered <strong>cover... | Medium | 17.5K | 31.1K | 17,480 | 31,110 | 56.2% | ['matchsticks-to-square', 'partition-to-k-equal-sum-subsets', 'find-the-shortest-superstring', 'smallest-sufficient-team', 'fair-distribution-of-cookies'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maximumRows(vector<vector<int>>& matrix, int numSelect) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maximumRows(int[][] matrix, int numSelect) {\n \n }\n}"}, {"v... | [[0,0,0],[1,0,1],[0,1,1],[0,0,1]]
2 | {
"name": "maximumRows",
"params": [
{
"name": "matrix",
"type": "integer[][]"
},
{
"type": "integer",
"name": "numSelect"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Backtracking', 'Bit Manipulation', 'Matrix', 'Enumeration'] |
2,398 | Maximum Number of Robots Within Budget | maximum-number-of-robots-within-budget | <p>You have <code>n</code> robots. You are given two <strong>0-indexed</strong> integer arrays, <code>chargeTimes</code> and <code>runningCosts</code>, both of length <code>n</code>. The <code>i<sup>th</sup></code> robot costs <code>chargeTimes[i]</code> units to charge and costs <code>runningCosts[i]</code> units to r... | Hard | 27K | 74.4K | 26,999 | 74,370 | 36.3% | ['sliding-window-maximum', 'kth-smallest-product-of-two-sorted-arrays', 'maximum-number-of-tasks-you-can-assign', 'minimized-maximum-of-products-distributed-to-any-store', 'minimum-time-to-complete-trips'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maximumRobots(vector<int>& chargeTimes, vector<int>& runningCosts, long long budget) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maximumRobots(int[] chargeTimes, int[] run... | [3,6,1,3,4]
[2,1,3,4,5]
25 | {
"name": "maximumRobots",
"params": [
{
"name": "chargeTimes",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "runningCosts"
},
{
"type": "long",
"name": "budget"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Binary Search', 'Queue', 'Sliding Window', 'Heap (Priority Queue)', 'Prefix Sum', 'Monotonic Queue'] |
2,399 | Check Distances Between Same Letters | check-distances-between-same-letters | <p>You are given a <strong>0-indexed</strong> string <code>s</code> consisting of only lowercase English letters, where each letter in <code>s</code> appears <strong>exactly</strong> <strong>twice</strong>. You are also given a <strong>0-indexed</strong> integer array <code>distance</code> of length <code>26</code>.</p... | Easy | 56.2K | 79.6K | 56,249 | 79,581 | 70.7% | ['two-sum', 'shortest-distance-to-a-character'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool checkDistances(string s, vector<int>& distance) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean checkDistances(String s, int[] distance) {\n \n }\n}"}, {"value"... | "abaccb"
[1,3,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] | {
"name": "checkDistances",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer[]",
"name": "distance"
}
],
"return": {
"type": "boolean"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'String'] |
2,400 | Number of Ways to Reach a Position After Exactly k Steps | number-of-ways-to-reach-a-position-after-exactly-k-steps | <p>You are given two <strong>positive</strong> integers <code>startPos</code> and <code>endPos</code>. Initially, you are standing at position <code>startPos</code> on an <strong>infinite</strong> number line. With one step, you can move either one position to the left, or one position to the right.</p>
<p>Given a pos... | Medium | 35K | 97.3K | 34,959 | 97,291 | 35.9% | ['unique-paths', 'climbing-stairs', 'reach-a-number', 'reaching-points', 'number-of-ways-to-stay-in-the-same-place-after-some-steps'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int numberOfWays(int startPos, int endPos, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int numberOfWays(int startPos, int endPos, int k) {\n \n }\n}"}, {"value": ... | 1
2
3 | {
"name": "numberOfWays",
"params": [
{
"name": "startPos",
"type": "integer"
},
{
"type": "integer",
"name": "endPos"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Math', 'Dynamic Programming', 'Combinatorics'] |
2,401 | Longest Nice Subarray | longest-nice-subarray | <p>You are given an array <code>nums</code> consisting of <strong>positive</strong> integers.</p>
<p>We call a subarray of <code>nums</code> <strong>nice</strong> if the bitwise <strong>AND</strong> of every pair of elements that are in <strong>different</strong> positions in the subarray is equal to <code>0</code>.</... | Medium | 160.9K | 248.4K | 160,876 | 248,406 | 64.8% | ['longest-substring-without-repeating-characters', 'bitwise-and-of-numbers-range', 'bitwise-ors-of-subarrays', 'fruit-into-baskets', 'max-consecutive-ones-iii', 'get-equal-substrings-within-budget', 'frequency-of-the-most-frequent-element', 'longest-substring-of-all-vowels-in-order', 'maximize-the-confusion-of-an-exam'... | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int longestNiceSubarray(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int longestNiceSubarray(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Py... | [1,3,8,48,10] | {
"name": "longestNiceSubarray",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Bit Manipulation', 'Sliding Window'] |
2,402 | Meeting Rooms III | meeting-rooms-iii | <p>You are given an integer <code>n</code>. There are <code>n</code> rooms numbered from <code>0</code> to <code>n - 1</code>.</p>
<p>You are given a 2D integer array <code>meetings</code> where <code>meetings[i] = [start<sub>i</sub>, end<sub>i</sub>]</code> means that a meeting will be held during the <strong>half-cl... | Hard | 137.2K | 312.5K | 137,177 | 312,499 | 43.9% | ['meeting-rooms', 'meeting-rooms-ii', 'maximum-number-of-events-that-can-be-attended', 'find-servers-that-handled-most-number-of-requests', 'maximum-number-of-events-that-can-be-attended-ii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int mostBooked(int n, vector<vector<int>>& meetings) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int mostBooked(int n, int[][] meetings) {\n \n }\n}"}, {"value": "python... | 2
[[0,10],[1,5],[2,7],[3,4]] | {
"name": "mostBooked",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[][]",
"name": "meetings"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Sorting', 'Heap (Priority Queue)', 'Simulation'] |
2,403 | Minimum Time to Kill All Monsters | minimum-time-to-kill-all-monsters | null | Hard | 1.6K | 2.9K | 1,627 | 2,918 | 55.8% | ['closest-room', 'eliminate-maximum-number-of-monsters', 'number-of-ways-to-build-sturdy-brick-wall'] | [] | Algorithms | null | [3,1,4] | {
"name": "minimumTime",
"params": [
{
"name": "power",
"type": "integer[]"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Dynamic Programming', 'Bit Manipulation', 'Bitmask'] |
2,404 | Most Frequent Even Element | most-frequent-even-element | <p>Given an integer array <code>nums</code>, return <em>the most frequent even element</em>.</p>
<p>If there is a tie, return the <strong>smallest</strong> one. If there is no such element, return <code>-1</code>.</p>
<p> </p>
<p><strong class="example">Example 1:</strong></p>
<pre>
<strong>Input:</strong> nums... | Easy | 104.8K | 203.3K | 104,777 | 203,330 | 51.5% | ['majority-element', 'majority-element-ii', 'top-k-frequent-elements', 'sort-characters-by-frequency'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int mostFrequentEven(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int mostFrequentEven(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python",... | [0,1,2,2,4,4,1] | {
"name": "mostFrequentEven",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Counting'] |
2,405 | Optimal Partition of String | optimal-partition-of-string | <p>Given a string <code>s</code>, partition the string into one or more <strong>substrings</strong> such that the characters in each substring are <strong>unique</strong>. That is, no letter appears in a single substring more than <strong>once</strong>.</p>
<p>Return <em>the <strong>minimum</strong> number of substrin... | Medium | 253.4K | 324.2K | 253,379 | 324,176 | 78.2% | ['longest-substring-without-repeating-characters', 'longest-substring-with-at-least-k-repeating-characters', 'partition-labels', 'partition-array-into-disjoint-intervals', 'maximum-sum-of-distinct-subarrays-with-length-k'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int partitionString(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int partitionString(String s) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCode... | "abacaba" | {
"name": "partitionString",
"params": [
{
"name": "s",
"type": "string"
}
],
"return": {
"type": "integer"
},
"manual": false
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Hash Table', 'String', 'Greedy'] |
2,406 | Divide Intervals Into Minimum Number of Groups | divide-intervals-into-minimum-number-of-groups | <p>You are given a 2D integer array <code>intervals</code> where <code>intervals[i] = [left<sub>i</sub>, right<sub>i</sub>]</code> represents the <strong>inclusive</strong> interval <code>[left<sub>i</sub>, right<sub>i</sub>]</code>.</p>
<p>You have to divide the intervals into one or more <strong>groups</strong> such... | Medium | 134.6K | 211.3K | 134,582 | 211,341 | 63.7% | ['merge-intervals', 'minimum-number-of-frogs-croaking', 'average-height-of-buildings-in-each-segment'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minGroups(vector<vector<int>>& intervals) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minGroups(int[][] intervals) {\n \n }\n}"}, {"value": "python", "text": "Py... | [[5,10],[6,8],[1,5],[2,3],[1,10]] | {
"name": "minGroups",
"params": [
{
"name": "intervals",
"type": "integer[][]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Two Pointers', 'Greedy', 'Sorting', 'Heap (Priority Queue)', 'Prefix Sum'] |
2,407 | Longest Increasing Subsequence II | longest-increasing-subsequence-ii | <p>You are given an integer array <code>nums</code> and an integer <code>k</code>.</p>
<p>Find the longest subsequence of <code>nums</code> that meets the following requirements:</p>
<ul>
<li>The subsequence is <strong>strictly increasing</strong> and</li>
<li>The difference between adjacent elements in the subsequ... | Hard | 19.7K | 77.7K | 19,691 | 77,706 | 25.3% | ['longest-increasing-subsequence', 'number-of-longest-increasing-subsequence', 'longest-continuous-increasing-subsequence', 'longest-substring-of-one-repeating-character', 'booking-concert-tickets-in-groups', 'longest-subsequence-with-decreasing-adjacent-difference'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int lengthOfLIS(vector<int>& nums, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int lengthOfLIS(int[] nums, int k) {\n \n }\n}"}, {"value": "python", "text": "Pyth... | [4,2,1,4,3,4,5,8,15]
3 | {
"name": "lengthOfLIS",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Divide and Conquer', 'Dynamic Programming', 'Binary Indexed Tree', 'Segment Tree', 'Queue', 'Monotonic Queue'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.