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,003 | Smallest Missing Genetic Value in Each Subtree | smallest-missing-genetic-value-in-each-subtree | <p>There is a <strong>family tree</strong> rooted at <code>0</code> consisting of <code>n</code> nodes numbered <code>0</code> to <code>n - 1</code>. You are given a <strong>0-indexed</strong> integer array <code>parents</code>, where <code>parents[i]</code> is the parent for node <code>i</code>. Since node <code>0</co... | Hard | 9.5K | 20.5K | 9,515 | 20,533 | 46.3% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> smallestMissingValueSubtree(vector<int>& parents, vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] smallestMissingValueSubtree(int[] parents, int[]... | [-1,0,0,2]
[1,2,3,4] | {
"name": "smallestMissingValueSubtree",
"params": [
{
"name": "parents",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "nums"
}
],
"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', 'Union Find'] |
2,004 | The Number of Seniors and Juniors to Join the Company | the-number-of-seniors-and-juniors-to-join-the-company | null | Hard | 9.7K | 21.7K | 9,726 | 21,682 | 44.9% | ['last-person-to-fit-in-the-bus', 'the-number-of-seniors-and-juniors-to-join-the-company-ii'] | ["Create table If Not Exists Candidates (employee_id int, experience ENUM('Senior', 'Junior'), salary int)", 'Truncate table Candidates', "insert into Candidates (employee_id, experience, salary) values ('1', 'Junior', '10000')", "insert into Candidates (employee_id, experience, salary) values ('9', 'Junior', '10000')"... | Database | null | {"headers":{"Candidates":["employee_id","experience","salary"]},"rows":{"Candidates":[[1,"Junior",10000],[9,"Junior",10000],[2,"Senior",20000],[11,"Senior",20000],[13,"Senior",50000],[4,"Junior",40000]]}} | {"mysql": ["Create table If Not Exists Candidates (employee_id int, experience ENUM('Senior', 'Junior'), salary int)"], "mssql": ["Create table Candidates (employee_id int, experience VARCHAR(6) NOT NULL CHECK (experience IN ('Senior', 'Junior')), salary int)"], "oraclesql": ["Create table Candidates (employee_id int, ... | {"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,005 | Subtree Removal Game with Fibonacci Tree | subtree-removal-game-with-fibonacci-tree | null | Hard | 756 | 1.3K | 756 | 1,325 | 57.1% | ['game-of-nim'] | [] | Algorithms | null | 3 | {
"name": "findGameWinner",
"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', 'Dynamic Programming', 'Tree', 'Binary Tree', 'Game Theory'] |
2,006 | Count Number of Pairs With Absolute Difference K | count-number-of-pairs-with-absolute-difference-k | <p>Given an integer array <code>nums</code> and an integer <code>k</code>, return <em>the number of pairs</em> <code>(i, j)</code> <em>where</em> <code>i < j</code> <em>such that</em> <code>|nums[i] - nums[j]| == k</code>.</p>
<p>The value of <code>|x|</code> is defined as:</p>
<ul>
<li><code>x</code> if <code>x ... | Easy | 191.4K | 226.2K | 191,423 | 226,247 | 84.6% | ['two-sum', 'k-diff-pairs-in-an-array', 'finding-pairs-with-a-certain-sum', 'count-equal-and-divisible-pairs-in-an-array', 'count-number-of-bad-pairs', 'count-the-number-of-fair-pairs'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countKDifference(vector<int>& nums, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countKDifference(int[] nums, int k) {\n \n }\n}"}, {"value": "python", "te... | [1,2,2,1]
1 | {
"name": "countKDifference",
"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', 'Hash Table', 'Counting'] |
2,007 | Find Original Array From Doubled Array | find-original-array-from-doubled-array | <p>An integer array <code>original</code> is transformed into a <strong>doubled</strong> array <code>changed</code> by appending <strong>twice the value</strong> of every element in <code>original</code>, and then randomly <strong>shuffling</strong> the resulting array.</p>
<p>Given an array <code>changed</code>, retu... | Medium | 143.5K | 354.9K | 143,510 | 354,864 | 40.4% | ['array-of-doubled-pairs', 'recover-the-original-array'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> findOriginalArray(vector<int>& changed) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] findOriginalArray(int[] changed) {\n \n }\n}"}, {"value": "python",... | [1,3,4,2,6,8] | {
"name": "findOriginalArray",
"params": [
{
"name": "changed",
"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'] |
2,008 | Maximum Earnings From Taxi | maximum-earnings-from-taxi | <p>There are <code>n</code> points on a road you are driving your taxi on. The <code>n</code> points on the road are labeled from <code>1</code> to <code>n</code> in the direction you are going, and you want to drive from point <code>1</code> to point <code>n</code> to make money by picking up passengers. You cannot ch... | Medium | 37.3K | 83.6K | 37,293 | 83,589 | 44.6% | ['maximum-profit-in-job-scheduling', 'maximum-number-of-events-that-can-be-attended', 'maximum-number-of-events-that-can-be-attended-ii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long maxTaxiEarnings(int n, vector<vector<int>>& rides) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long maxTaxiEarnings(int n, int[][] rides) {\n \n }\n}"}, {"valu... | 5
[[2,5,4],[1,5,1]] | {
"name": "maxTaxiEarnings",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[][]",
"name": "rides"
}
],
"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', 'Dynamic Programming', 'Sorting'] |
2,009 | Minimum Number of Operations to Make Array Continuous | minimum-number-of-operations-to-make-array-continuous | <p>You are given an integer array <code>nums</code>. In one operation, you can replace <strong>any</strong> element in <code>nums</code> with <strong>any</strong> integer.</p>
<p><code>nums</code> is considered <strong>continuous</strong> if both of the following conditions are fulfilled:</p>
<ul>
<li>All elements i... | Hard | 80.7K | 154.5K | 80,711 | 154,542 | 52.2% | ['longest-repeating-character-replacement', 'continuous-subarray-sum', 'moving-stones-until-consecutive-ii', 'minimum-one-bit-operations-to-make-integers-zero', 'minimum-adjacent-swaps-for-k-consecutive-ones'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minOperations(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minOperations(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python", "defa... | [4,2,5,3] | {
"name": "minOperations",
"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', 'Binary Search', 'Sliding Window'] |
2,010 | The Number of Seniors and Juniors to Join the Company II | the-number-of-seniors-and-juniors-to-join-the-company-ii | null | Hard | 6.5K | 10.2K | 6,529 | 10,163 | 64.2% | ['last-person-to-fit-in-the-bus', 'the-number-of-seniors-and-juniors-to-join-the-company'] | ["Create table If Not Exists Candidates (employee_id int, experience ENUM('Senior', 'Junior'), salary int)", 'Truncate table Candidates', "insert into Candidates (employee_id, experience, salary) values ('1', 'Junior', '10000')", "insert into Candidates (employee_id, experience, salary) values ('9', 'Junior', '15000')"... | Database | null | {"headers":{"Candidates":["employee_id","experience","salary"]},"rows":{"Candidates":[[1,"Junior",10000],[9,"Junior",15000],[2,"Senior",20000],[11,"Senior",16000],[13,"Senior",50000],[4,"Junior",40000]]}} | {"mysql": ["Create table If Not Exists Candidates (employee_id int, experience ENUM('Senior', 'Junior'), salary int)"], "mssql": ["Create table Candidates (employee_id int, experience VARCHAR(6) NOT NULL CHECK (experience IN ('Senior', 'Junior')), salary int)"], "oraclesql": ["Create table Candidates (employee_id int, ... | {"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,011 | Final Value of Variable After Performing Operations | final-value-of-variable-after-performing-operations | <p>There is a programming language with only <strong>four</strong> operations and <strong>one</strong> variable <code>X</code>:</p>
<ul>
<li><code>++X</code> and <code>X++</code> <strong>increments</strong> the value of the variable <code>X</code> by <code>1</code>.</li>
<li><code>--X</code> and <code>X--</code> <st... | Easy | 467.3K | 522.1K | 467,341 | 522,087 | 89.5% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int finalValueAfterOperations(vector<string>& operations) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int finalValueAfterOperations(String[] operations) {\n \n }\n}"}, {... | ["--X","X++","X++"] | {
"name": "finalValueAfterOperations",
"params": [
{
"name": "operations",
"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... | ['Array', 'String', 'Simulation'] |
2,012 | Sum of Beauty in the Array | sum-of-beauty-in-the-array | <p>You are given a <strong>0-indexed</strong> integer array <code>nums</code>. For each index <code>i</code> (<code>1 <= i <= nums.length - 2</code>) the <strong>beauty</strong> of <code>nums[i]</code> equals:</p>
<ul>
<li><code>2</code>, if <code>nums[j] < nums[i] < nums[k]</code>, for <strong>all</stron... | Medium | 28.5K | 57.2K | 28,502 | 57,174 | 49.9% | ['best-time-to-buy-and-sell-stock', 'partition-array-into-disjoint-intervals', 'maximum-value-of-an-ordered-triplet-ii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int sumOfBeauties(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int sumOfBeauties(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python", "defa... | [1,2,3] | {
"name": "sumOfBeauties",
"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'] |
2,013 | Detect Squares | detect-squares | <p>You are given a stream of points on the X-Y plane. Design an algorithm that:</p>
<ul>
<li><strong>Adds</strong> new points from the stream into a data structure. <strong>Duplicate</strong> points are allowed and should be treated as different points.</li>
<li>Given a query point, <strong>counts</strong> the numbe... | Medium | 87.3K | 168K | 87,349 | 168,019 | 52.0% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class DetectSquares {\npublic:\n DetectSquares() {\n \n }\n \n void add(vector<int> point) {\n \n }\n \n int count(vector<int> point) {\n \n }\n};\n\n/**\n * Your DetectSquares object will be instantiated and called as such:\n... | ["DetectSquares","add","add","add","count","count","add","count"]
[[],[[3,10]],[[11,2]],[[3,2]],[[11,10]],[[14,8]],[[11,2]],[[11,10]]] | {
"classname": "DetectSquares",
"constructor": {
"params": []
},
"methods": [
{
"params": [
{
"type": "integer[]",
"name": "point"
}
],
"name": "add",
"return": {
"type": "void"
}
},
{
"params": [
{
... | {"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', 'Design', 'Counting'] |
2,014 | Longest Subsequence Repeated k Times | longest-subsequence-repeated-k-times | <p>You are given a string <code>s</code> of length <code>n</code>, and an integer <code>k</code>. You are tasked to find the <strong>longest subsequence repeated</strong> <code>k</code> times in string <code>s</code>.</p>
<p>A <strong>subsequence</strong> is a string that can be derived from another string by deleting... | Hard | 9.8K | 18.1K | 9,776 | 18,122 | 53.9% | ['longest-substring-with-at-least-k-repeating-characters'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string longestSubsequenceRepeatedK(string s, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String longestSubsequenceRepeatedK(String s, int k) {\n \n }\n}"}, {"valu... | "letsleetcode"
2 | {
"name": "longestSubsequenceRepeatedK",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer",
"name": "k"
}
],
"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', 'Greedy', 'Counting', 'Enumeration'] |
2,015 | Average Height of Buildings in Each Segment | average-height-of-buildings-in-each-segment | null | Medium | 2.4K | 4.2K | 2,428 | 4,240 | 57.3% | ['average-waiting-time', 'describe-the-painting', 'amount-of-new-area-painted-each-day', 'divide-intervals-into-minimum-number-of-groups'] | [] | Algorithms | null | [[1,4,2],[3,9,4]] | {
"name": "averageHeightOfBuildings",
"params": [
{
"name": "buildings",
"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,016 | Maximum Difference Between Increasing Elements | maximum-difference-between-increasing-elements | <p>Given a <strong>0-indexed</strong> integer array <code>nums</code> of size <code>n</code>, find the <strong>maximum difference</strong> between <code>nums[i]</code> and <code>nums[j]</code> (i.e., <code>nums[j] - nums[i]</code>), such that <code>0 <= i < j < n</code> and <code>nums[i] < nums[j]</code>.</... | Easy | 112.7K | 191.3K | 112,679 | 191,303 | 58.9% | ['best-time-to-buy-and-sell-stock', 'two-furthest-houses-with-different-colors'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maximumDifference(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maximumDifference(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python... | [7,1,5,4] | {
"name": "maximumDifference",
"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'] |
2,017 | Grid Game | grid-game | <p>You are given a <strong>0-indexed</strong> 2D array <code>grid</code> of size <code>2 x n</code>, where <code>grid[r][c]</code> represents the number of points at position <code>(r, c)</code> on the matrix. Two robots are playing a game on this matrix.</p>
<p>Both robots initially start at <code>(0, 0)</code> and w... | Medium | 133.3K | 218.5K | 133,283 | 218,480 | 61.0% | ['minimum-penalty-for-a-shop'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long gridGame(vector<vector<int>>& grid) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long gridGame(int[][] grid) {\n \n }\n}"}, {"value": "python", "text": "Python"... | [[2,5,4],[1,5,1]] | {
"name": "gridGame",
"params": [
{
"name": "grid",
"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', 'Matrix', 'Prefix Sum'] |
2,018 | Check if Word Can Be Placed In Crossword | check-if-word-can-be-placed-in-crossword | <p>You are given an <code>m x n</code> matrix <code>board</code>, representing the<strong> current </strong>state of a crossword puzzle. The crossword contains lowercase English letters (from solved words), <code>' '</code> to represent any <strong>empty </strong>cells, and <code>'#'</code> to represent... | Medium | 25.7K | 51.5K | 25,692 | 51,487 | 49.9% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool placeWordInCrossword(vector<vector<char>>& board, string word) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean placeWordInCrossword(char[][] board, String word) {\n ... | [["#"," ","#"],[" "," ","#"],["#","c"," "]]
"abc" | {
"name": "placeWordInCrossword",
"params": [
{
"name": "board",
"type": "character[][]"
},
{
"type": "string",
"name": "word"
}
],
"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', 'Enumeration'] |
2,019 | The Score of Students Solving Math Expression | the-score-of-students-solving-math-expression | <p>You are given a string <code>s</code> that contains digits <code>0-9</code>, addition symbols <code>'+'</code>, and multiplication symbols <code>'*'</code> <strong>only</strong>, representing a <strong>valid</strong> math expression of <strong>single digit numbers</strong> (e.g., <code>3+5*2</code>).... | Hard | 8.1K | 24.7K | 8,147 | 24,704 | 33.0% | ['basic-calculator', 'different-ways-to-add-parentheses'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int scoreOfStudents(string s, vector<int>& answers) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int scoreOfStudents(String s, int[] answers) {\n \n }\n}"}, {"value": "py... | "7+3*1*2"
[20,13,42] | {
"name": "scoreOfStudents",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer[]",
"name": "answers"
}
],
"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', 'String', 'Dynamic Programming', 'Stack', 'Memoization'] |
2,020 | Number of Accounts That Did Not Stream | number-of-accounts-that-did-not-stream | null | Medium | 12.2K | 16.9K | 12,227 | 16,913 | 72.3% | [] | ['Create table If Not Exists Subscriptions (account_id int, start_date date, end_date date)', 'Create table If Not Exists Streams (session_id int, account_id int, stream_date date)', 'Truncate table Subscriptions', "insert into Subscriptions (account_id, start_date, end_date) values ('9', '2020-02-18', '2021-10-30')", ... | Database | null | {"headers":{"Subscriptions":["account_id","start_date","end_date"],"Streams":["session_id","account_id","stream_date"]},"rows":{"Subscriptions":[[9,"2020-02-18","2021-10-30"],[3,"2021-09-21","2021-11-13"],[11,"2020-02-28","2020-08-18"],[13,"2021-04-20","2021-09-22"],[4,"2020-10-26","2021-05-08"],[5,"2020-09-11","2021-0... | {"mysql": ["Create table If Not Exists Subscriptions (account_id int, start_date date, end_date date)", "Create table If Not Exists Streams (session_id int, account_id int, stream_date date)"], "mssql": ["Create table Subscriptions (account_id int, start_date date, end_date date)", "Create table Streams (session_id int... | {"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,021 | Brightest Position on Street | brightest-position-on-street | null | Medium | 7.9K | 13K | 7,914 | 12,991 | 60.9% | ['minimum-number-of-food-buckets-to-feed-the-hamsters', 'count-positions-on-street-with-required-brightness'] | [] | Algorithms | null | [[-3,2],[1,2],[3,3]] | {
"name": "brightestPosition",
"params": [
{
"name": "lights",
"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', 'Sorting', 'Prefix Sum', 'Ordered Set'] |
2,022 | Convert 1D Array Into 2D Array | convert-1d-array-into-2d-array | <p>You are given a <strong>0-indexed</strong> 1-dimensional (1D) integer array <code>original</code>, and two integers, <code>m</code> and <code>n</code>. You are tasked with creating a 2-dimensional (2D) array with <code> m</code> rows and <code>n</code> columns using <strong>all</strong> the elements from <code>origi... | Easy | 265.1K | 369.7K | 265,126 | 369,687 | 71.7% | ['reshape-the-matrix'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<vector<int>> construct2DArray(vector<int>& original, int m, int n) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[][] construct2DArray(int[] original, int m, int n) {\n ... | [1,2,3,4]
2
2 | {
"name": "construct2DArray",
"params": [
{
"name": "original",
"type": "integer[]"
},
{
"type": "integer",
"name": "m"
},
{
"type": "integer",
"name": "n"
}
],
"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', 'Simulation'] |
2,023 | Number of Pairs of Strings With Concatenation Equal to Target | number-of-pairs-of-strings-with-concatenation-equal-to-target | <p>Given an array of <strong>digit</strong> strings <code>nums</code> and a <strong>digit</strong> string <code>target</code>, return <em>the number of pairs of indices </em><code>(i, j)</code><em> (where </em><code>i != j</code><em>) such that the <strong>concatenation</strong> of </em><code>nums[i] + nums[j]</code><e... | Medium | 55.1K | 73.7K | 55,083 | 73,685 | 74.8% | ['two-sum'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int numOfPairs(vector<string>& nums, string target) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int numOfPairs(String[] nums, String target) {\n \n }\n}"}, {"value": "py... | ["777","7","77","77"]
"7777" | {
"name": "numOfPairs",
"params": [
{
"name": "nums",
"type": "string[]"
},
{
"type": "string",
"name": "target"
}
],
"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', 'String', 'Counting'] |
2,024 | Maximize the Confusion of an Exam | maximize-the-confusion-of-an-exam | <p>A teacher is writing a test with <code>n</code> true/false questions, with <code>'T'</code> denoting true and <code>'F'</code> denoting false. He wants to confuse the students by <strong>maximizing</strong> the number of <strong>consecutive</strong> questions with the <strong>same</strong> answer (mu... | Medium | 122.4K | 179.2K | 122,377 | 179,248 | 68.3% | ['longest-substring-with-at-most-k-distinct-characters', 'longest-repeating-character-replacement', 'max-consecutive-ones-iii', 'minimum-number-of-days-to-make-m-bouquets', 'longest-nice-subarray'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxConsecutiveAnswers(string answerKey, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxConsecutiveAnswers(String answerKey, int k) {\n \n }\n}"}, {"value"... | "TTFF"
2 | {
"name": "maxConsecutiveAnswers",
"params": [
{
"name": "answerKey",
"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', 'Binary Search', 'Sliding Window', 'Prefix Sum'] |
2,025 | Maximum Number of Ways to Partition an Array | maximum-number-of-ways-to-partition-an-array | <p>You are given a <strong>0-indexed</strong> integer array <code>nums</code> of length <code>n</code>. The number of ways to <strong>partition</strong> <code>nums</code> is the number of <code>pivot</code> indices that satisfy both conditions:</p>
<ul>
<li><code>1 <= pivot < n</code></li>
<li><code>nums[0] + ... | Hard | 12.2K | 35.4K | 12,225 | 35,411 | 34.5% | ['partition-equal-subset-sum', 'partition-to-k-equal-sum-subsets'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int waysToPartition(vector<int>& nums, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int waysToPartition(int[] nums, int k) {\n \n }\n}"}, {"value": "python", "text... | [2,-1,2]
3 | {
"name": "waysToPartition",
"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', 'Hash Table', 'Counting', 'Enumeration', 'Prefix Sum'] |
2,026 | Low-Quality Problems | low-quality-problems | null | Easy | 13.9K | 16.5K | 13,921 | 16,459 | 84.6% | [] | ['Create table If Not Exists Problems (problem_id int, likes int, dislikes int)', 'Truncate table Problems', "insert into Problems (problem_id, likes, dislikes) values ('6', '1290', '425')", "insert into Problems (problem_id, likes, dislikes) values ('11', '2677', '8659')", "insert into Problems (problem_id, likes, dis... | Database | null | {"headers":{"Problems":["problem_id","likes","dislikes"]},"rows":{"Problems":[[6,1290,425],[11,2677,8659],[1,4446,2760],[7,8569,6086],[13,2050,4164],[10,9002,7446]]}} | {"mysql": ["Create table If Not Exists Problems (problem_id int, likes int, dislikes int)"], "mssql": ["Create table Problems (problem_id int, likes int, dislikes int)"], "oraclesql": ["Create table Problems (problem_id int, likes int, dislikes int)"], "database": true, "name": "low_quality_problems", "pythondata": ["P... | {"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,027 | Minimum Moves to Convert String | minimum-moves-to-convert-string | <p>You are given a string <code>s</code> consisting of <code>n</code> characters which are either <code>'X'</code> or <code>'O'</code>.</p>
<p>A <strong>move</strong> is defined as selecting <strong>three</strong> <strong>consecutive characters</strong> of <code>s</code> and converting them to <code>&#... | Easy | 49K | 87.1K | 48,973 | 87,092 | 56.2% | ['minimum-cost-to-convert-string-i', 'minimum-cost-to-convert-string-ii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minimumMoves(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minimumMoves(String s) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCode": "cl... | "XXX" | {
"name": "minimumMoves",
"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', 'Greedy'] |
2,028 | Find Missing Observations | find-missing-observations | <p>You have observations of <code>n + m</code> <strong>6-sided</strong> dice rolls with each face numbered from <code>1</code> to <code>6</code>. <code>n</code> of the observations went missing, and you only have the observations of <code>m</code> rolls. Fortunately, you have also calculated the <strong>average value</... | Medium | 170.7K | 297.5K | 170,724 | 297,455 | 57.4% | ['number-of-dice-rolls-with-target-sum', 'dice-roll-simulation'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> missingRolls(vector<int>& rolls, int mean, int n) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] missingRolls(int[] rolls, int mean, int n) {\n \n }\n}"},... | [3,2,4,3]
4
2 | {
"name": "missingRolls",
"params": [
{
"name": "rolls",
"type": "integer[]"
},
{
"type": "integer",
"name": "mean"
},
{
"type": "integer",
"name": "n"
}
],
"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', 'Simulation'] |
2,029 | Stone Game IX | stone-game-ix | <p>Alice and Bob continue their games with stones. There is a row of n stones, and each stone has an associated value. You are given an integer array <code>stones</code>, where <code>stones[i]</code> is the <strong>value</strong> of the <code>i<sup>th</sup></code> stone.</p>
<p>Alice and Bob take turns, with <strong>A... | Medium | 9.8K | 34.3K | 9,837 | 34,332 | 28.7% | ['stone-game', 'stone-game-ii', 'stone-game-iii', 'stone-game-iv', 'stone-game-v', 'stone-game-vi', 'stone-game-vii', 'stone-game-viii', 'stone-game-ix'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool stoneGameIX(vector<int>& stones) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean stoneGameIX(int[] stones) {\n \n }\n}"}, {"value": "python", "text": "Python", ... | [2,1] | {
"name": "stoneGameIX",
"params": [
{
"name": "stones",
"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', 'Math', 'Greedy', 'Counting', 'Game Theory'] |
2,030 | Smallest K-Length Subsequence With Occurrences of a Letter | smallest-k-length-subsequence-with-occurrences-of-a-letter | <p>You are given a string <code>s</code>, an integer <code>k</code>, a letter <code>letter</code>, and an integer <code>repetition</code>.</p>
<p>Return <em>the <strong>lexicographically smallest</strong> subsequence of</em> <code>s</code><em> of length</em> <code>k</code> <em>that has the letter</em> <code>letter</co... | Hard | 9.9K | 25.6K | 9,896 | 25,555 | 38.7% | ['remove-duplicate-letters', 'subarray-with-elements-greater-than-varying-threshold', 'find-the-lexicographically-smallest-valid-sequence'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string smallestSubsequence(string s, int k, char letter, int repetition) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String smallestSubsequence(String s, int k, char letter, int r... | "leet"
3
"e"
1 | {
"name": "smallestSubsequence",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer",
"name": "k"
},
{
"type": "character",
"name": "letter"
},
{
"type": "integer",
"name": "repetition"
}
],
"return": {
"type": "s... | {"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', 'Greedy', 'Monotonic Stack'] |
2,031 | Count Subarrays With More Ones Than Zeros | count-subarrays-with-more-ones-than-zeros | null | Medium | 4.7K | 9.2K | 4,704 | 9,188 | 51.2% | ['ones-and-zeroes', 'longer-contiguous-segments-of-ones-than-zeros', 'all-divisions-with-the-highest-score-of-a-binary-array'] | [] | Algorithms | null | [0,1,1,0,1] | {
"name": "subarraysWithMoreZerosThanOnes",
"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', 'Binary Search', 'Divide and Conquer', 'Binary Indexed Tree', 'Segment Tree', 'Merge Sort', 'Ordered Set'] |
2,032 | Two Out of Three | two-out-of-three | Given three integer arrays <code>nums1</code>, <code>nums2</code>, and <code>nums3</code>, return <em>a <strong>distinct</strong> array containing all the values that are present in <strong>at least two</strong> out of the three arrays. You may return the values in <strong>any</strong> order</em>.
<p> </p>
<p><str... | Easy | 86.6K | 113.6K | 86,616 | 113,596 | 76.2% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> twoOutOfThree(vector<int>& nums1, vector<int>& nums2, vector<int>& nums3) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public List<Integer> twoOutOfThree(int[] nums1, int[] nu... | [1,1,3,2]
[2,3]
[3] | {
"name": "twoOutOfThree",
"params": [
{
"name": "nums1",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "nums2"
},
{
"type": "integer[]",
"name": "nums3"
}
],
"return": {
"type": "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', 'Bit Manipulation'] |
2,033 | Minimum Operations to Make a Uni-Value Grid | minimum-operations-to-make-a-uni-value-grid | <p>You are given a 2D integer <code>grid</code> of size <code>m x n</code> and an integer <code>x</code>. In one operation, you can <strong>add</strong> <code>x</code> to or <strong>subtract</strong> <code>x</code> from any element in the <code>grid</code>.</p>
<p>A <strong>uni-value grid</strong> is a grid where all ... | Medium | 136K | 201.7K | 136,011 | 201,672 | 67.4% | ['minimum-moves-to-equal-array-elements-ii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minOperations(vector<vector<int>>& grid, int x) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minOperations(int[][] grid, int x) {\n \n }\n}"}, {"value": "python",... | [[2,4],[6,8]]
2 | {
"name": "minOperations",
"params": [
{
"name": "grid",
"type": "integer[][]"
},
{
"type": "integer",
"name": "x"
}
],
"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', 'Matrix'] |
2,034 | Stock Price Fluctuation | stock-price-fluctuation | <p>You are given a stream of <strong>records</strong> about a particular stock. Each record contains a <strong>timestamp</strong> and the corresponding <strong>price</strong> of the stock at that timestamp.</p>
<p>Unfortunately due to the volatile nature of the stock market, the records do not come in order. Even wors... | Medium | 80.4K | 164.7K | 80,425 | 164,698 | 48.8% | ['time-based-key-value-store'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class StockPrice {\npublic:\n StockPrice() {\n \n }\n \n void update(int timestamp, int price) {\n \n }\n \n int current() {\n \n }\n \n int maximum() {\n \n }\n \n int minimum() {\n \n }\n};\n\... | ["StockPrice","update","update","current","maximum","update","maximum","update","minimum"]
[[],[1,10],[2,5],[],[],[1,3],[],[4,2],[]] | {
"classname": "StockPrice",
"constructor": {
"params": []
},
"methods": [
{
"params": [
{
"type": "integer",
"name": "timestamp"
},
{
"type": "integer",
"name": "price"
}
],
"name": "update",
"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)', 'Data Stream', 'Ordered Set'] |
2,035 | Partition Array Into Two Arrays to Minimize Sum Difference | partition-array-into-two-arrays-to-minimize-sum-difference | <p>You are given an integer array <code>nums</code> of <code>2 * n</code> integers. You need to partition <code>nums</code> into <strong>two</strong> arrays of length <code>n</code> to <strong>minimize the absolute difference</strong> of the <strong>sums</strong> of the arrays. To partition <code>nums</code>, put each ... | Hard | 38.8K | 181.2K | 38,797 | 181,226 | 21.4% | ['partition-equal-subset-sum', 'split-array-with-same-average', 'tallest-billboard', 'last-stone-weight-ii', 'fair-distribution-of-cookies', 'closest-subsequence-sum', 'number-of-ways-to-split-array', 'minimum-sum-of-squared-difference', 'split-with-minimum-sum'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minimumDifference(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minimumDifference(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python... | [3,9,7,3] | {
"name": "minimumDifference",
"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', 'Two Pointers', 'Binary Search', 'Dynamic Programming', 'Bit Manipulation', 'Ordered Set', 'Bitmask'] |
2,036 | Maximum Alternating Subarray Sum | maximum-alternating-subarray-sum | null | Medium | 3.7K | 9.3K | 3,689 | 9,317 | 39.6% | ['maximum-alternating-subsequence-sum'] | [] | Algorithms | null | [3,-1,1,2] | {
"name": "maximumAlternatingSubarraySum",
"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', 'Dynamic Programming'] |
2,037 | Minimum Number of Moves to Seat Everyone | minimum-number-of-moves-to-seat-everyone | <p>There are <code>n</code> <strong>availabe </strong>seats and <code>n</code> students <strong>standing</strong> in a room. You are given an array <code>seats</code> of length <code>n</code>, where <code>seats[i]</code> is the position of the <code>i<sup>th</sup></code> seat. You are also given the array <code>student... | Easy | 257.5K | 295.1K | 257,525 | 295,079 | 87.3% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minMovesToSeat(vector<int>& seats, vector<int>& students) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minMovesToSeat(int[] seats, int[] students) {\n \n }\n}"}, ... | [3,1,5]
[2,7,4] | {
"name": "minMovesToSeat",
"params": [
{
"name": "seats",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "students"
}
],
"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', 'Counting Sort'] |
2,038 | Remove Colored Pieces if Both Neighbors are the Same Color | remove-colored-pieces-if-both-neighbors-are-the-same-color | <p>There are <code>n</code> pieces arranged in a line, and each piece is colored either by <code>'A'</code> or by <code>'B'</code>. You are given a string <code>colors</code> of length <code>n</code> where <code>colors[i]</code> is the color of the <code>i<sup>th</sup></code> piece.</p>
<p>Alice and Bo... | Medium | 151.8K | 241.8K | 151,791 | 241,835 | 62.8% | ['longest-subarray-with-maximum-bitwise-and'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool winnerOfGame(string colors) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean winnerOfGame(String colors) {\n \n }\n}"}, {"value": "python", "text": "Python", "de... | "AAABABB" | {
"name": "winnerOfGame",
"params": [
{
"name": "colors",
"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... | ['Math', 'String', 'Greedy', 'Game Theory'] |
2,039 | The Time When the Network Becomes Idle | the-time-when-the-network-becomes-idle | <p>There is a network of <code>n</code> servers, labeled from <code>0</code> to <code>n - 1</code>. You are given a 2D integer array <code>edges</code>, where <code>edges[i] = [u<sub>i</sub>, v<sub>i</sub>]</code> indicates there is a message channel between servers <code>u<sub>i</sub></code> and <code>v<sub>i</sub></c... | Medium | 18.5K | 34.8K | 18,519 | 34,756 | 53.3% | ['network-delay-time', 'n-ary-tree-level-order-traversal', 'maximum-depth-of-n-ary-tree'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int networkBecomesIdle(vector<vector<int>>& edges, vector<int>& patience) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int networkBecomesIdle(int[][] edges, int[] patience) {\n ... | [[0,1],[1,2]]
[0,2,1] | {
"name": "networkBecomesIdle",
"params": [
{
"name": "edges",
"type": "integer[][]"
},
{
"type": "integer[]",
"name": "patience"
}
],
"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', 'Breadth-First Search', 'Graph'] |
2,040 | Kth Smallest Product of Two Sorted Arrays | kth-smallest-product-of-two-sorted-arrays | Given two <strong>sorted 0-indexed</strong> integer arrays <code>nums1</code> and <code>nums2</code> as well as an integer <code>k</code>, return <em>the </em><code>k<sup>th</sup></code><em> (<strong>1-based</strong>) smallest product of </em><code>nums1[i] * nums2[j]</code><em> where </em><code>0 <= i < nums1.le... | Hard | 14.5K | 47.9K | 14,533 | 47,880 | 30.4% | ['find-k-pairs-with-smallest-sums', 'k-diff-pairs-in-an-array', 'maximum-number-of-robots-within-budget'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long kthSmallestProduct(vector<int>& nums1, vector<int>& nums2, long long k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long kthSmallestProduct(int[] nums1, int[] nums2, lon... | [2,5]
[3,4]
2 | {
"name": "kthSmallestProduct",
"params": [
{
"name": "nums1",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "nums2"
},
{
"type": "long",
"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', 'Binary Search'] |
2,041 | Accepted Candidates From the Interviews | accepted-candidates-from-the-interviews | null | Medium | 13.4K | 17K | 13,354 | 16,974 | 78.7% | [] | ['Create table If Not Exists Candidates (candidate_id int, name varchar(30), years_of_exp int, interview_id int)', 'Create table If Not Exists Rounds (interview_id int, round_id int, score int)', 'Truncate table Candidates', "insert into Candidates (candidate_id, name, years_of_exp, interview_id) values ('11', 'Atticus... | Database | null | {"headers":{"Candidates":["candidate_id","name","years_of_exp","interview_id"],"Rounds":["interview_id","round_id","score"]},"rows":{"Candidates":[[11,"Atticus",1,101],[9,"Ruben",6,104],[6,"Aliza",10,109],[8,"Alfredo",0,107]],"Rounds":[[109,3,4],[101,2,8],[109,4,1],[107,1,3],[104,3,6],[109,1,4],[104,4,7],[104,1,2],[109... | {"mysql": ["Create table If Not Exists Candidates (candidate_id int, name varchar(30), years_of_exp int, interview_id int)", "Create table If Not Exists Rounds (interview_id int, round_id int, score int)"], "mssql": ["Create table Candidates (candidate_id int, name varchar(30), years_of_exp int, interview_id int)", "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,042 | Check if Numbers Are Ascending in a Sentence | check-if-numbers-are-ascending-in-a-sentence | <p>A sentence is a list of <strong>tokens</strong> separated by a <strong>single</strong> space with no leading or trailing spaces. Every token is either a <strong>positive number</strong> consisting of digits <code>0-9</code> with no leading zeros, or a <strong>word</strong> consisting of lowercase English letters.</p... | Easy | 72.6K | 101.7K | 72,596 | 101,682 | 71.4% | ['string-to-integer-atoi', 'sorting-the-sentence', 'check-if-all-as-appears-before-all-bs'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool areNumbersAscending(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean areNumbersAscending(String s) {\n \n }\n}"}, {"value": "python", "text": "Python",... | "1 box has 3 blue 4 red 6 green and 12 yellow marbles" | {
"name": "areNumbersAscending",
"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... | ['String'] |
2,043 | Simple Bank System | simple-bank-system | <p>You have been tasked with writing a program for a popular bank that will automate all its incoming transactions (transfer, deposit, and withdraw). The bank has <code>n</code> accounts numbered from <code>1</code> to <code>n</code>. The initial balance of each account is stored in a <strong>0-indexed</strong> integer... | Medium | 46.5K | 73.5K | 46,548 | 73,462 | 63.4% | ['design-an-atm-machine'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Bank {\npublic:\n Bank(vector<long long>& balance) {\n \n }\n \n bool transfer(int account1, int account2, long long money) {\n \n }\n \n bool deposit(int account, long long money) {\n \n }\n \n bool withdraw(int a... | ["Bank","withdraw","transfer","deposit","transfer","withdraw"]
[[[10,100,20,50,30]],[3,10],[5,1,20],[5,20],[3,4,15],[10,50]] | {
"classname": "Bank",
"constructor": {
"params": [
{
"type": "long[]",
"name": "balance"
}
]
},
"methods": [
{
"params": [
{
"type": "integer",
"name": "account1"
},
{
"type": "integer",
"name": "accou... | {"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', 'Design', 'Simulation'] |
2,044 | Count Number of Maximum Bitwise-OR Subsets | count-number-of-maximum-bitwise-or-subsets | <p>Given an integer array <code>nums</code>, find the <strong>maximum</strong> possible <strong>bitwise OR</strong> of a subset of <code>nums</code> and return <em>the <strong>number of different non-empty subsets</strong> with the maximum bitwise OR</em>.</p>
<p>An array <code>a</code> is a <strong>subset</strong> of... | Medium | 142K | 161.4K | 141,965 | 161,421 | 87.9% | ['subsets', 'largest-combination-with-bitwise-and-greater-than-zero', 'longest-subarray-with-maximum-bitwise-and'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countMaxOrSubsets(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countMaxOrSubsets(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python... | [3,1] | {
"name": "countMaxOrSubsets",
"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', 'Backtracking', 'Bit Manipulation', 'Enumeration'] |
2,045 | Second Minimum Time to Reach Destination | second-minimum-time-to-reach-destination | <p>A city is represented as a <strong>bi-directional connected</strong> graph with <code>n</code> vertices where each vertex is labeled from <code>1</code> to <code>n</code> (<strong>inclusive</strong>). The edges in the graph are represented as a 2D integer array <code>edges</code>, where each <code>edges[i] = [u<sub>... | Hard | 86.3K | 137.7K | 86,262 | 137,721 | 62.6% | ['network-delay-time', 'find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance', 'number-of-ways-to-arrive-at-destination'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int secondMinimum(int n, vector<vector<int>>& edges, int time, int change) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int secondMinimum(int n, int[][] edges, int time, int change... | 5
[[1,2],[1,3],[1,4],[3,4],[4,5]]
3
5 | {
"name": "secondMinimum",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[][]",
"name": "edges"
},
{
"type": "integer",
"name": "time"
},
{
"type": "integer",
"name": "change"
}
],
"return": {
"type": "intege... | {"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... | ['Breadth-First Search', 'Graph', 'Shortest Path'] |
2,046 | Sort Linked List Already Sorted Using Absolute Values | sort-linked-list-already-sorted-using-absolute-values | null | Medium | 10K | 15K | 10,015 | 14,976 | 66.9% | ['sort-list'] | [] | Algorithms | null | [0,2,-5,5,10,-10] | {
"name": "sortLinkedList",
"params": [
{
"name": "head",
"type": "ListNode"
}
],
"return": {
"type": "ListNode"
}
} | {"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... | ['Linked List', 'Two Pointers', 'Sorting'] |
2,047 | Number of Valid Words in a Sentence | number-of-valid-words-in-a-sentence | <p>A sentence consists of lowercase letters (<code>'a'</code> to <code>'z'</code>), digits (<code>'0'</code> to <code>'9'</code>), hyphens (<code>'-'</code>), punctuation marks (<code>'!'</code>, <code>'.'</code>, and <code>','</code>), and spaces (<code>&... | Easy | 36.1K | 121.5K | 36,143 | 121,463 | 29.8% | ['maximum-number-of-words-found-in-sentences'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countValidWords(string sentence) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countValidWords(String sentence) {\n \n }\n}"}, {"value": "python", "text": "Python"... | "cat and dog" | {
"name": "countValidWords",
"params": [
{
"name": "sentence",
"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,048 | Next Greater Numerically Balanced Number | next-greater-numerically-balanced-number | <p>An integer <code>x</code> is <strong>numerically balanced</strong> if for every digit <code>d</code> in the number <code>x</code>, there are <strong>exactly</strong> <code>d</code> occurrences of that digit in <code>x</code>.</p>
<p>Given an integer <code>n</code>, return <em>the <strong>smallest numerically balanc... | Medium | 15.6K | 31.8K | 15,574 | 31,825 | 48.9% | ['find-the-width-of-columns-of-a-grid'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int nextBeautifulNumber(int n) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int nextBeautifulNumber(int n) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCo... | 1 | {
"name": "nextBeautifulNumber",
"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... | ['Hash Table', 'Math', 'Backtracking', 'Counting', 'Enumeration'] |
2,049 | Count Nodes With the Highest Score | count-nodes-with-the-highest-score | <p>There is a <strong>binary</strong> tree rooted at <code>0</code> consisting of <code>n</code> nodes. The nodes are labeled from <code>0</code> to <code>n - 1</code>. You are given a <strong>0-indexed</strong> integer array <code>parents</code> representing the tree, where <code>parents[i]</code> is the parent of nod... | Medium | 34K | 66.8K | 33,970 | 66,797 | 50.9% | ['sum-of-distances-in-tree', 'delete-nodes-and-return-forest', 'maximum-product-of-splitted-binary-tree'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countHighestScoreNodes(vector<int>& parents) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countHighestScoreNodes(int[] parents) {\n \n }\n}"}, {"value": "python",... | [-1,2,0,2,0] | {
"name": "countHighestScoreNodes",
"params": [
{
"name": "parents",
"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', 'Tree', 'Depth-First Search', 'Binary Tree'] |
2,050 | Parallel Courses III | parallel-courses-iii | <p>You are given an integer <code>n</code>, which indicates that there are <code>n</code> courses labeled from <code>1</code> to <code>n</code>. You are also given a 2D integer array <code>relations</code> where <code>relations[j] = [prevCourse<sub>j</sub>, nextCourse<sub>j</sub>]</code> denotes that course <code>prevC... | Hard | 92.7K | 138.8K | 92,665 | 138,804 | 66.8% | ['course-schedule-iii', 'parallel-courses', 'single-threaded-cpu', 'process-tasks-using-servers', 'maximum-employees-to-be-invited-to-a-meeting'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minimumTime(int n, vector<vector<int>>& relations, vector<int>& time) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minimumTime(int n, int[][] relations, int[] time) {\n ... | 3
[[1,3],[2,3]]
[3,2,5] | {
"name": "minimumTime",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[][]",
"name": "relations"
},
{
"type": "integer[]",
"name": "time"
}
],
"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', 'Graph', 'Topological Sort'] |
2,051 | The Category of Each Member in the Store | the-category-of-each-member-in-the-store | null | Medium | 9.4K | 13.3K | 9,398 | 13,310 | 70.6% | [] | ['Create table If Not Exists Members (member_id int, name varchar(30))', 'Create table If Not Exists Visits (visit_id int, member_id int, visit_date date)', 'Create table If Not Exists Purchases (visit_id int, charged_amount int)', 'Truncate table Members', "insert into Members (member_id, name) values ('9', 'Alice')",... | Database | null | {"headers":{"Members":["member_id","name"],"Visits":["visit_id","member_id","visit_date"],"Purchases":["visit_id","charged_amount"]},"rows":{"Members":[[9,"Alice"],[11,"Bob"],[3,"Winston"],[8,"Hercy"],[1,"Narihan"]],"Visits":[[22,11,"2021-10-28"],[16,11,"2021-01-12"],[18,9,"2021-12-10"],[19,3,"2021-10-19"],[12,11,"2021... | {"mysql": ["Create table If Not Exists Members (member_id int, name varchar(30))", "Create table If Not Exists Visits (visit_id int, member_id int, visit_date date)", "Create table If Not Exists Purchases (visit_id int, charged_amount int)"], "mssql": ["Create table Members (member_id int, name varchar(30))", "Create t... | {"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,052 | Minimum Cost to Separate Sentence Into Rows | minimum-cost-to-separate-sentence-into-rows | null | Medium | 2.2K | 4.4K | 2,201 | 4,379 | 50.3% | ['sentence-screen-fitting'] | [] | Algorithms | null | "i love leetcode"
12 | {
"name": "minimumCost",
"params": [
{
"name": "sentence",
"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... | ['Array', 'Dynamic Programming'] |
2,053 | Kth Distinct String in an Array | kth-distinct-string-in-an-array | <p>A <strong>distinct string</strong> is a string that is present only <strong>once</strong> in an array.</p>
<p>Given an array of strings <code>arr</code>, and an integer <code>k</code>, return <em>the </em><code>k<sup>th</sup></code><em> <strong>distinct string</strong> present in </em><code>arr</code>. If there are... | Easy | 249.4K | 304.2K | 249,397 | 304,189 | 82.0% | ['count-common-words-with-one-occurrence'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string kthDistinct(vector<string>& arr, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String kthDistinct(String[] arr, int k) {\n \n }\n}"}, {"value": "python", "te... | ["d","b","c","b","c","a"]
2 | {
"name": "kthDistinct",
"params": [
{
"name": "arr",
"type": "string[]"
},
{
"type": "integer",
"name": "k"
}
],
"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', 'String', 'Counting'] |
2,054 | Two Best Non-Overlapping Events | two-best-non-overlapping-events | <p>You are given a <strong>0-indexed</strong> 2D integer array of <code>events</code> where <code>events[i] = [startTime<sub>i</sub>, endTime<sub>i</sub>, value<sub>i</sub>]</code>. The <code>i<sup>th</sup></code> event starts at <code>startTime<sub>i</sub></code><sub> </sub>and ends at <code>endTime<sub>i</sub></code>... | Medium | 104.4K | 171K | 104,417 | 170,966 | 61.1% | ['maximum-profit-in-job-scheduling', 'maximum-number-of-events-that-can-be-attended-ii', 'maximize-win-from-two-segments', 'maximum-score-of-non-overlapping-intervals'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxTwoEvents(vector<vector<int>>& events) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxTwoEvents(int[][] events) {\n \n }\n}"}, {"value": "python", "text": "Py... | [[1,3,2],[4,5,2],[2,4,3]] | {
"name": "maxTwoEvents",
"params": [
{
"name": "events",
"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', 'Dynamic Programming', 'Sorting', 'Heap (Priority Queue)'] |
2,055 | Plates Between Candles | plates-between-candles | <p>There is a long table with a line of plates and candles arranged on top of it. You are given a <strong>0-indexed</strong> string <code>s</code> consisting of characters <code>'*'</code> and <code>'|'</code> only, where a <code>'*'</code> represents a <strong>plate</strong> and a <code>'|&... | Medium | 67.8K | 146K | 67,781 | 146,003 | 46.4% | ['find-first-and-last-position-of-element-in-sorted-array', 'can-make-palindrome-from-substring'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> platesBetweenCandles(string s, vector<vector<int>>& queries) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] platesBetweenCandles(String s, int[][] queries) {\n ... | "**|**|***|"
[[2,5],[5,9]] | {
"name": "platesBetweenCandles",
"params": [
{
"name": "s",
"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', 'Binary Search', 'Prefix Sum'] |
2,056 | Number of Valid Move Combinations On Chessboard | number-of-valid-move-combinations-on-chessboard | <p>There is an <code>8 x 8</code> chessboard containing <code>n</code> pieces (rooks, queens, or bishops). You are given a string array <code>pieces</code> of length <code>n</code>, where <code>pieces[i]</code> describes the type (rook, queen, or bishop) of the <code>i<sup>th</sup></code> piece. In addition, you are gi... | Hard | 4.9K | 10.3K | 4,911 | 10,342 | 47.5% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countCombinations(vector<string>& pieces, vector<vector<int>>& positions) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countCombinations(String[] pieces, int[][] positions)... | ["rook"]
[[1,1]] | {
"name": "countCombinations",
"params": [
{
"name": "pieces",
"type": "string[]"
},
{
"type": "integer[][]",
"name": "positions"
}
],
"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', 'Backtracking', 'Simulation'] |
2,057 | Smallest Index With Equal Value | smallest-index-with-equal-value | <p>Given a <strong>0-indexed</strong> integer array <code>nums</code>, return <em>the <strong>smallest</strong> index </em><code>i</code><em> of </em><code>nums</code><em> such that </em><code>i mod 10 == nums[i]</code><em>, or </em><code>-1</code><em> if such index does not exist</em>.</p>
<p><code>x mod y</code> den... | Easy | 75K | 103.6K | 75,001 | 103,583 | 72.4% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int smallestEqual(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int smallestEqual(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python", "defa... | [0,1,2] | {
"name": "smallestEqual",
"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'] |
2,058 | Find the Minimum and Maximum Number of Nodes Between Critical Points | find-the-minimum-and-maximum-number-of-nodes-between-critical-points | <p>A <strong>critical point</strong> in a linked list is defined as <strong>either</strong> a <strong>local maxima</strong> or a <strong>local minima</strong>.</p>
<p>A node is a <strong>local maxima</strong> if the current node has a value <strong>strictly greater</strong> than the previous node and the next node.</p... | Medium | 186.9K | 269.2K | 186,929 | 269,220 | 69.4% | [] | [] | 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,1] | {
"name": "nodesBetweenCriticalPoints",
"params": [
{
"name": "head",
"type": "ListNode"
}
],
"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... | ['Linked List'] |
2,059 | Minimum Operations to Convert Number | minimum-operations-to-convert-number | <p>You are given a <strong>0-indexed</strong> integer array <code>nums</code> containing <strong>distinct</strong> numbers, an integer <code>start</code>, and an integer <code>goal</code>. There is an integer <code>x</code> that is initially set to <code>start</code>, and you want to perform operations on <code>x</code... | Medium | 19.1K | 37.9K | 19,054 | 37,880 | 50.3% | ['minimum-operations-to-reduce-x-to-zero'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minimumOperations(vector<int>& nums, int start, int goal) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minimumOperations(int[] nums, int start, int goal) {\n \n }... | [2,4,12]
2
12 | {
"name": "minimumOperations",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer",
"name": "start"
},
{
"type": "integer",
"name": "goal"
}
],
"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', 'Breadth-First Search'] |
2,060 | Check if an Original String Exists Given Two Encoded Strings | check-if-an-original-string-exists-given-two-encoded-strings | <p>An original string, consisting of lowercase English letters, can be encoded by the following steps:</p>
<ul>
<li>Arbitrarily <strong>split</strong> it into a <strong>sequence</strong> of some number of <strong>non-empty</strong> substrings.</li>
<li>Arbitrarily choose some elements (possibly none) of the sequence... | Hard | 18.3K | 42.5K | 18,292 | 42,523 | 43.0% | ['valid-word-abbreviation', 'check-if-two-string-arrays-are-equivalent'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool possiblyEquals(string s1, string s2) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean possiblyEquals(String s1, String s2) {\n \n }\n}"}, {"value": "python", "te... | "internationalization"
"i18n" | {
"name": "possiblyEquals",
"params": [
{
"name": "s1",
"type": "string"
},
{
"type": "string",
"name": "s2"
}
],
"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... | ['String', 'Dynamic Programming'] |
2,061 | Number of Spaces Cleaning Robot Cleaned | number-of-spaces-cleaning-robot-cleaned | null | Medium | 10K | 16.1K | 9,984 | 16,131 | 61.9% | ['robot-room-cleaner'] | [] | Algorithms | null | [[0,0,0],[1,1,0],[0,0,0]] | {
"name": "numberOfCleanRooms",
"params": [
{
"name": "room",
"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', 'Simulation'] |
2,062 | Count Vowel Substrings of a String | count-vowel-substrings-of-a-string | <p>A <strong>substring</strong> is a contiguous (non-empty) sequence of characters within a string.</p>
<p>A <strong>vowel substring</strong> is a substring that <strong>only</strong> consists of vowels (<code>'a'</code>, <code>'e'</code>, <code>'i'</code>, <code>'o'</code>, and <code>&... | Easy | 57.5K | 81.4K | 57,535 | 81,368 | 70.7% | ['number-of-matching-subsequences', 'subarrays-with-k-different-integers', 'number-of-substrings-with-only-1s', 'longest-substring-of-all-vowels-in-order', 'total-appeal-of-a-string', 'count-of-substrings-containing-every-vowel-and-k-consonants-ii', 'count-of-substrings-containing-every-vowel-and-k-consonants-i'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countVowelSubstrings(string word) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countVowelSubstrings(String word) {\n \n }\n}"}, {"value": "python", "text": "Pytho... | "aeiouu" | {
"name": "countVowelSubstrings",
"params": [
{
"name": "word",
"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... | ['Hash Table', 'String'] |
2,063 | Vowels of All Substrings | vowels-of-all-substrings | <p>Given a string <code>word</code>, return <em>the <strong>sum of the number of vowels</strong> (</em><code>'a'</code>, <code>'e'</code><em>,</em> <code>'i'</code><em>,</em> <code>'o'</code><em>, and</em> <code>'u'</code><em>)</em> <em>in every substring of </em><code>word</code... | Medium | 36.2K | 66.4K | 36,223 | 66,399 | 54.6% | ['number-of-substrings-containing-all-three-characters', 'total-appeal-of-a-string'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long countVowels(string word) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long countVowels(String word) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaul... | "aba" | {
"name": "countVowels",
"params": [
{
"name": "word",
"type": "string"
}
],
"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... | ['Math', 'String', 'Dynamic Programming', 'Combinatorics'] |
2,064 | Minimized Maximum of Products Distributed to Any Store | minimized-maximum-of-products-distributed-to-any-store | <p>You are given an integer <code>n</code> indicating there are <code>n</code> specialty retail stores. There are <code>m</code> product types of varying amounts, which are given as a <strong>0-indexed</strong> integer array <code>quantities</code>, where <code>quantities[i]</code> represents the number of products of ... | Medium | 133.4K | 213.3K | 133,423 | 213,342 | 62.5% | ['koko-eating-bananas', 'capacity-to-ship-packages-within-d-days', 'maximum-candies-allocated-to-k-children', 'find-the-smallest-divisor-given-a-threshold', 'magnetic-force-between-two-balls', 'minimum-limit-of-balls-in-a-bag', 'minimum-time-to-complete-trips', 'maximum-number-of-robots-within-budget'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minimizedMaximum(int n, vector<int>& quantities) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minimizedMaximum(int n, int[] quantities) {\n \n }\n}"}, {"value": "... | 6
[11,6] | {
"name": "minimizedMaximum",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[]",
"name": "quantities"
}
],
"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'] |
2,065 | Maximum Path Quality of a Graph | maximum-path-quality-of-a-graph | <p>There is an <strong>undirected</strong> graph with <code>n</code> nodes numbered from <code>0</code> to <code>n - 1</code> (<strong>inclusive</strong>). You are given a <strong>0-indexed</strong> integer array <code>values</code> where <code>values[i]</code> is the <strong>value </strong>of the <code>i<sup>th</sup><... | Hard | 25.7K | 43.3K | 25,728 | 43,318 | 59.4% | ['cherry-pickup', 'minimum-cost-to-reach-destination-in-time'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maximalPathQuality(vector<int>& values, vector<vector<int>>& edges, int maxTime) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maximalPathQuality(int[] values, int[][] edges... | [0,32,10,43]
[[0,1,10],[1,2,15],[0,3,10]]
49 | {
"name": "maximalPathQuality",
"params": [
{
"name": "values",
"type": "integer[]"
},
{
"type": "integer[][]",
"name": "edges"
},
{
"type": "integer",
"name": "maxTime"
}
],
"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', 'Graph'] |
2,066 | Account Balance | account-balance | null | Medium | 11.2K | 13.6K | 11,215 | 13,637 | 82.2% | [] | ["Create table If Not Exists Transactions (account_id int, day date, type ENUM('Deposit', 'Withdraw'), amount int)", 'Truncate table Transactions', "insert into Transactions (account_id, day, type, amount) values ('1', '2021-11-07', 'Deposit', '2000')", "insert into Transactions (account_id, day, type, amount) values (... | Database | null | {"headers":{"Transactions":["account_id","day","type","amount"]},"rows":{"Transactions":[[1,"2021-11-07","Deposit",2000],[1,"2021-11-09","Withdraw",1000],[1,"2021-11-11","Deposit",3000],[2,"2021-12-07","Deposit",7000],[2,"2021-12-12","Withdraw",7000]]}} | {"mysql": ["Create table If Not Exists Transactions (account_id int, day date, type ENUM('Deposit', 'Withdraw'), amount int)"], "mssql": ["Create table Transactions (account_id int, day date, type varchar(8) NOT NULL CHECK (type IN('Deposit', 'Withdraw')), amount int)"], "oraclesql": ["Create table Transactions (accoun... | {"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,067 | Number of Equal Count Substrings | number-of-equal-count-substrings | null | Medium | 3.3K | 7.5K | 3,335 | 7,479 | 44.6% | ['longest-substring-without-repeating-characters', 'longest-substring-with-at-least-k-repeating-characters', 'unique-substrings-with-equal-digit-frequency'] | [] | Algorithms | null | "aaabcbbcc"
3 | {
"name": "equalCountSubstrings",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer",
"name": "count"
}
],
"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', 'Sliding Window', 'Counting'] |
2,068 | Check Whether Two Strings are Almost Equivalent | check-whether-two-strings-are-almost-equivalent | <p>Two strings <code>word1</code> and <code>word2</code> are considered <strong>almost equivalent</strong> if the differences between the frequencies of each letter from <code>'a'</code> to <code>'z'</code> between <code>word1</code> and <code>word2</code> is <strong>at most</strong> <code>3</code>.</p>... | Easy | 68.6K | 107.9K | 68,643 | 107,855 | 63.6% | ['find-the-occurrence-of-first-almost-equal-substring'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool checkAlmostEquivalent(string word1, string word2) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean checkAlmostEquivalent(String word1, String word2) {\n \n }\n}"... | "aaaa"
"bccb" | {
"name": "checkAlmostEquivalent",
"params": [
{
"name": "word1",
"type": "string"
},
{
"type": "string",
"name": "word2"
}
],
"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... | ['Hash Table', 'String', 'Counting'] |
2,069 | Walking Robot Simulation II | walking-robot-simulation-ii | <p>A <code>width x height</code> grid is on an XY-plane with the <strong>bottom-left</strong> cell at <code>(0, 0)</code> and the <strong>top-right</strong> cell at <code>(width - 1, height - 1)</code>. The grid is aligned with the four cardinal directions (<code>"North"</code>, <code>"East"</code>,... | Medium | 14.5K | 54.3K | 14,494 | 54,334 | 26.7% | ['walking-robot-simulation'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Robot {\npublic:\n Robot(int width, int height) {\n \n }\n \n void step(int num) {\n \n }\n \n vector<int> getPos() {\n \n }\n \n string getDir() {\n \n }\n};\n\n/**\n * Your Robot object will be instanti... | ["Robot","step","step","getPos","getDir","step","step","step","getPos","getDir"]
[[6,3],[2],[2],[],[],[2],[1],[4],[],[]] | {
"classname": "Robot",
"constructor": {
"params": [
{
"type": "integer",
"name": "width"
},
{
"name": "height",
"type": "integer"
}
]
},
"methods": [
{
"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... | ['Design', 'Simulation'] |
2,070 | Most Beautiful Item for Each Query | most-beautiful-item-for-each-query | <p>You are given a 2D integer array <code>items</code> where <code>items[i] = [price<sub>i</sub>, beauty<sub>i</sub>]</code> denotes the <strong>price</strong> and <strong>beauty</strong> of an item respectively.</p>
<p>You are also given a <strong>0-indexed</strong> integer array <code>queries</code>. For each <code>... | Medium | 123.5K | 199K | 123,454 | 198,988 | 62.0% | ['closest-room', 'find-the-score-of-all-prefixes-of-an-array', 'maximum-sum-queries'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> maximumBeauty(vector<vector<int>>& items, vector<int>& queries) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] maximumBeauty(int[][] items, int[] queries) {\n ... | [[1,2],[3,2],[2,4],[5,6],[3,5]]
[1,2,3,4,5,6] | {
"name": "maximumBeauty",
"params": [
{
"name": "items",
"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', 'Sorting'] |
2,071 | Maximum Number of Tasks You Can Assign | maximum-number-of-tasks-you-can-assign | <p>You have <code>n</code> tasks and <code>m</code> workers. Each task has a strength requirement stored in a <strong>0-indexed</strong> integer array <code>tasks</code>, with the <code>i<sup>th</sup></code> task requiring <code>tasks[i]</code> strength to complete. The strength of each worker is stored in a <strong>0-... | Hard | 11.6K | 33.7K | 11,623 | 33,656 | 34.5% | ['most-profit-assigning-work', 'maximum-running-time-of-n-computers', 'maximum-number-of-robots-within-budget', 'maximum-matching-of-players-with-trainers', 'maximize-the-minimum-powered-city'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxTaskAssign(vector<int>& tasks, vector<int>& workers, int pills, int strength) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxTaskAssign(int[] tasks, int[] workers, int ... | [3,2,1]
[0,3,3]
1
1 | {
"name": "maxTaskAssign",
"params": [
{
"name": "tasks",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "workers"
},
{
"type": "integer",
"name": "pills"
},
{
"type": "integer",
"name": "strength"
}
],
"return": {
"type"... | {"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', 'Queue', 'Sorting', 'Monotonic Queue'] |
2,072 | The Winner University | the-winner-university | null | Easy | 13.1K | 17.4K | 13,110 | 17,404 | 75.3% | ['the-number-of-rich-customers'] | ['Create table If Not Exists NewYork (student_id int, score int)', 'Create table If Not Exists California (student_id int, score int)', 'Truncate table NewYork', "insert into NewYork (student_id, score) values ('1', '90')", "insert into NewYork (student_id, score) values ('2', '87')", 'Truncate table California', "inse... | Database | null | {"headers":{"NewYork":["student_id","score"],"California":["student_id","score"]},"rows":{"NewYork":[[1,90],[2,87]],"California":[[2,89],[3,88]]}} | {"mysql": ["Create table If Not Exists NewYork (student_id int, score int)", "Create table If Not Exists California (student_id int, score int)"], "mssql": ["Create table NewYork (student_id int, score int)", "Create table California (student_id int, score int)"], "oraclesql": ["Create table NewYork (student_id int, sc... | {"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,073 | Time Needed to Buy Tickets | time-needed-to-buy-tickets | <p>There are <code>n</code> people in a line queuing to buy tickets, where the <code>0<sup>th</sup></code> person is at the <strong>front</strong> of the line and the <code>(n - 1)<sup>th</sup></code> person is at the <strong>back</strong> of the line.</p>
<p>You are given a <strong>0-indexed</strong> integer array <c... | Easy | 246.2K | 349.3K | 246,163 | 349,282 | 70.5% | ['number-of-students-unable-to-eat-lunch'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int timeRequiredToBuy(vector<int>& tickets, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int timeRequiredToBuy(int[] tickets, int k) {\n \n }\n}"}, {"value": "pyth... | [2,3,2]
2 | {
"name": "timeRequiredToBuy",
"params": [
{
"name": "tickets",
"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', 'Queue', 'Simulation'] |
2,074 | Reverse Nodes in Even Length Groups | reverse-nodes-in-even-length-groups | <p>You are given the <code>head</code> of a linked list.</p>
<p>The nodes in the linked list are <strong>sequentially</strong> assigned to <strong>non-empty</strong> groups whose lengths form the sequence of the natural numbers (<code>1, 2, 3, 4, ...</code>). The <strong>length</strong> of a group is the number of nod... | Medium | 34.3K | 56.9K | 34,331 | 56,938 | 60.3% | ['reverse-nodes-in-k-group', 'reverse-linked-list'] | [] | 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 * ... | [5,2,6,3,9,1,7,3,8,4] | {
"name": "reverseEvenLengthGroups",
"params": [
{
"name": "head",
"type": "ListNode"
}
],
"return": {
"type": "ListNode"
}
} | {"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... | ['Linked List'] |
2,075 | Decode the Slanted Ciphertext | decode-the-slanted-ciphertext | <p>A string <code>originalText</code> is encoded using a <strong>slanted transposition cipher</strong> to a string <code>encodedText</code> with the help of a matrix having a <strong>fixed number of rows</strong> <code>rows</code>.</p>
<p><code>originalText</code> is placed first in a top-left to bottom-right manner.<... | Medium | 16K | 32.6K | 15,987 | 32,646 | 49.0% | ['diagonal-traverse'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string decodeCiphertext(string encodedText, int rows) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String decodeCiphertext(String encodedText, int rows) {\n \n }\n}"}, {"... | "ch ie pr"
3 | {
"name": "decodeCiphertext",
"params": [
{
"name": "encodedText",
"type": "string"
},
{
"type": "integer",
"name": "rows"
}
],
"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', 'Simulation'] |
2,076 | Process Restricted Friend Requests | process-restricted-friend-requests | <p>You are given an integer <code>n</code> indicating the number of people in a network. Each person is labeled from <code>0</code> to <code>n - 1</code>.</p>
<p>You are also given a <strong>0-indexed</strong> 2D integer array <code>restrictions</code>, where <code>restrictions[i] = [x<sub>i</sub>, y<sub>i</sub>]</cod... | Hard | 19.9K | 35K | 19,858 | 35,032 | 56.7% | ['number-of-islands-ii', 'smallest-string-with-swaps', 'maximum-employees-to-be-invited-to-a-meeting'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<bool> friendRequests(int n, vector<vector<int>>& restrictions, vector<vector<int>>& requests) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean[] friendRequests(int n, in... | 3
[[0,1]]
[[0,2],[2,1]] | {
"name": "friendRequests",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[][]",
"name": "restrictions"
},
{
"type": "integer[][]",
"name": "requests"
}
],
"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... | ['Union Find', 'Graph'] |
2,077 | Paths in Maze That Lead to Same Room | paths-in-maze-that-lead-to-same-room | null | Medium | 5.6K | 10K | 5,564 | 9,962 | 55.9% | ['number-of-connected-components-in-an-undirected-graph', 'reachable-nodes-in-subdivided-graph', 'distance-to-a-cycle-in-undirected-graph', 'find-if-path-exists-in-graph'] | [] | Algorithms | null | 5
[[1,2],[5,2],[4,1],[2,4],[3,1],[3,4]] | {
"name": "numberOfPaths",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[][]",
"name": "corridors"
}
],
"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... | ['Graph'] |
2,078 | Two Furthest Houses With Different Colors | two-furthest-houses-with-different-colors | <p>There are <code>n</code> houses evenly lined up on the street, and each house is beautifully painted. You are given a <strong>0-indexed</strong> integer array <code>colors</code> of length <code>n</code>, where <code>colors[i]</code> represents the color of the <code>i<sup>th</sup></code> house.</p>
<p>Return <em>t... | Easy | 72.5K | 110.7K | 72,507 | 110,706 | 65.5% | ['replace-elements-with-greatest-element-on-right-side', 'maximum-distance-between-a-pair-of-values', 'maximum-difference-between-increasing-elements'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxDistance(vector<int>& colors) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxDistance(int[] colors) {\n \n }\n}"}, {"value": "python", "text": "Python", "defa... | [1,1,1,6,1,1,1] | {
"name": "maxDistance",
"params": [
{
"name": "colors",
"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,079 | Watering Plants | watering-plants | <p>You want to water <code>n</code> plants in your garden with a watering can. The plants are arranged in a row and are labeled from <code>0</code> to <code>n - 1</code> from left to right where the <code>i<sup>th</sup></code> plant is located at <code>x = i</code>. There is a river at <code>x = -1</code> that you can ... | Medium | 59.9K | 74.9K | 59,853 | 74,876 | 79.9% | ['watering-plants-ii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int wateringPlants(vector<int>& plants, int capacity) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int wateringPlants(int[] plants, int capacity) {\n \n }\n}"}, {"value":... | [2,2,3,3]
5 | {
"name": "wateringPlants",
"params": [
{
"name": "plants",
"type": "integer[]"
},
{
"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', 'Simulation'] |
2,080 | Range Frequency Queries | range-frequency-queries | <p>Design a data structure to find the <strong>frequency</strong> of a given value in a given subarray.</p>
<p>The <strong>frequency</strong> of a value in a subarray is the number of occurrences of that value in the subarray.</p>
<p>Implement the <code>RangeFreqQuery</code> class:</p>
<ul>
<li><code>RangeFreqQuery... | Medium | 25.8K | 62.2K | 25,788 | 62,183 | 41.5% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class RangeFreqQuery {\npublic:\n RangeFreqQuery(vector<int>& arr) {\n \n }\n \n int query(int left, int right, int value) {\n \n }\n};\n\n/**\n * Your RangeFreqQuery object will be instantiated and called as such:\n * RangeFreqQuery* obj = n... | ["RangeFreqQuery","query","query"]
[[[12,33,4,56,22,2,34,33,22,12,34,56]],[1,2,4],[0,11,33]] | {
"classname": "RangeFreqQuery",
"constructor": {
"params": [
{
"type": "integer[]",
"name": "arr"
}
]
},
"methods": [
{
"params": [
{
"type": "integer",
"name": "left"
},
{
"type": "integer",
"name": "... | {"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', 'Design', 'Segment Tree'] |
2,081 | Sum of k-Mirror Numbers | sum-of-k-mirror-numbers | <p>A <strong>k-mirror number</strong> is a <strong>positive</strong> integer <strong>without leading zeros</strong> that reads the same both forward and backward in base-10 <strong>as well as</strong> in base-k.</p>
<ul>
<li>For example, <code>9</code> is a 2-mirror number. The representation of <code>9</code> in bas... | Hard | 7.9K | 19.2K | 7,949 | 19,200 | 41.4% | ['strobogrammatic-number-ii', 'prime-palindrome'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long kMirror(int k, int n) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long kMirror(int k, int n) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCode"... | 2
5 | {
"name": "kMirror",
"params": [
{
"name": "k",
"type": "integer"
},
{
"type": "integer",
"name": "n"
}
],
"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... | ['Math', 'Enumeration'] |
2,082 | The Number of Rich Customers | the-number-of-rich-customers | null | Easy | 26.8K | 34.5K | 26,789 | 34,550 | 77.5% | ['the-winner-university'] | ['Create table If Not Exists Store (bill_id int, customer_id int, amount int)', 'Truncate table Store', "insert into Store (bill_id, customer_id, amount) values ('6', '1', '549')", "insert into Store (bill_id, customer_id, amount) values ('8', '1', '834')", "insert into Store (bill_id, customer_id, amount) values ('4',... | Database | null | {"headers":{"Store":["bill_id","customer_id","amount"]},"rows":{"Store":[[6,1,549],[8,1,834],[4,2,394],[11,3,657],[13,3,257]]}} | {"mysql": ["Create table If Not Exists Store (bill_id int, customer_id int, amount int)"], "mssql": ["Create table Store (bill_id int, customer_id int, amount int)"], "oraclesql": ["Create table Store (bill_id int, customer_id int, amount int)"], "database": true, "name": "count_rich_customers", "pythondata": ["Store =... | {"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>"]} | ['Database'] |
2,083 | Substrings That Begin and End With the Same Letter | substrings-that-begin-and-end-with-the-same-letter | null | Medium | 13.4K | 18.1K | 13,401 | 18,069 | 74.2% | ['number-of-good-pairs', 'sum-of-beauty-of-all-substrings', 'count-pairs-in-two-arrays', 'unique-substrings-with-equal-digit-frequency'] | [] | Algorithms | null | "abcba" | {
"name": "numberOfSubstrings",
"params": [
{
"name": "s",
"type": "string"
}
],
"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... | ['Hash Table', 'Math', 'String', 'Counting', 'Prefix Sum'] |
2,084 | Drop Type 1 Orders for Customers With Type 0 Orders | drop-type-1-orders-for-customers-with-type-0-orders | null | Medium | 12.8K | 14.7K | 12,804 | 14,682 | 87.2% | [] | ['Create table If Not Exists Orders (order_id int, customer_id int, order_type int)', 'Truncate table Orders', "insert into Orders (order_id, customer_id, order_type) values ('1', '1', '0')", "insert into Orders (order_id, customer_id, order_type) values ('2', '1', '0')", "insert into Orders (order_id, customer_id, ord... | Database | null | {"headers":{"Orders":["order_id","customer_id","order_type"]},"rows":{"Orders":[[1,1,0],[2,1,0],[11,2,0],[12,2,1],[21,3,1],[22,3,0],[31,4,1],[32,4,1]]}} | {"mysql": ["Create table If Not Exists Orders (order_id int, customer_id int, order_type int)"], "mssql": ["Create table Orders (order_id int, customer_id int, order_type int)"], "oraclesql": ["Create table Orders (order_id int, customer_id int, order_type int)"], "database": true, "name": "drop_specific_orders", "pyth... | {"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,085 | Count Common Words With One Occurrence | count-common-words-with-one-occurrence | <p>Given two string arrays <code>words1</code> and <code>words2</code>, return <em>the number of strings that appear <strong>exactly once</strong> in <b>each</b> of the two arrays.</em></p>
<p> </p>
<p><strong class="example">Example 1:</strong></p>
<pre>
<strong>Input:</strong> words1 = ["leetcode&quo... | Easy | 92K | 127.6K | 92,015 | 127,619 | 72.1% | ['intersection-of-two-arrays', 'uncommon-words-from-two-sentences', 'kth-distinct-string-in-an-array'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countWords(vector<string>& words1, vector<string>& words2) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countWords(String[] words1, String[] words2) {\n \n }\n}"}... | ["leetcode","is","amazing","as","is"]
["amazing","leetcode","is"] | {
"name": "countWords",
"params": [
{
"name": "words1",
"type": "string[]"
},
{
"type": "string[]",
"name": "words2"
}
],
"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', 'String', 'Counting'] |
2,086 | Minimum Number of Food Buckets to Feed the Hamsters | minimum-number-of-food-buckets-to-feed-the-hamsters | <p>You are given a <strong>0-indexed</strong> string <code>hamsters</code> where <code>hamsters[i]</code> is either:</p>
<ul>
<li><code>'H'</code> indicating that there is a hamster at index <code>i</code>, or</li>
<li><code>'.'</code> indicating that index <code>i</code> is empty.</li>
</ul>
<p>You... | Medium | 24.8K | 53K | 24,824 | 53,035 | 46.8% | ['maximum-number-of-people-that-can-be-caught-in-tag', 'brightest-position-on-street'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minimumBuckets(string hamsters) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minimumBuckets(String hamsters) {\n \n }\n}"}, {"value": "python", "text": "Python", ... | "H..H" | {
"name": "minimumBuckets",
"params": [
{
"name": "hamsters",
"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', 'Greedy'] |
2,087 | Minimum Cost Homecoming of a Robot in a Grid | minimum-cost-homecoming-of-a-robot-in-a-grid | <p>There is an <code>m x n</code> grid, where <code>(0, 0)</code> is the top-left cell and <code>(m - 1, n - 1)</code> is the bottom-right cell. You are given an integer array <code>startPos</code> where <code>startPos = [start<sub>row</sub>, start<sub>col</sub>]</code> indicates that <strong>initially</strong>, a <str... | Medium | 22K | 43.1K | 21,956 | 43,056 | 51.0% | ['unique-paths', 'minimum-path-sum', 'bomb-enemy', 'count-square-submatrices-with-all-ones', 'paths-in-matrix-whose-sum-is-divisible-by-k', 'check-if-there-is-a-path-with-equal-number-of-0s-and-1s'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minCost(vector<int>& startPos, vector<int>& homePos, vector<int>& rowCosts, vector<int>& colCosts) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minCost(int[] startPos, int[... | [1,0]
[2,3]
[5,4,3]
[8,2,6,7] | {
"name": "minCost",
"params": [
{
"name": "startPos",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "homePos"
},
{
"type": "integer[]",
"name": "rowCosts"
},
{
"type": "integer[]",
"name": "colCosts"
}
],
"return": {
"t... | {"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,088 | Count Fertile Pyramids in a Land | count-fertile-pyramids-in-a-land | <p>A farmer has a <strong>rectangular grid</strong> of land with <code>m</code> rows and <code>n</code> columns that can be divided into unit cells. Each cell is either <strong>fertile</strong> (represented by a <code>1</code>) or <strong>barren</strong> (represented by a <code>0</code>). All cells outside the grid are... | Hard | 11.4K | 17.5K | 11,407 | 17,507 | 65.2% | ['count-square-submatrices-with-all-ones', 'get-biggest-three-rhombus-sums-in-a-grid'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countPyramids(vector<vector<int>>& grid) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countPyramids(int[][] grid) {\n \n }\n}"}, {"value": "python", "text": "Pyth... | [[0,1,1,0],[1,1,1,1]] | {
"name": "countPyramids",
"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', 'Matrix'] |
2,089 | Find Target Indices After Sorting Array | find-target-indices-after-sorting-array | <p>You are given a <strong>0-indexed</strong> integer array <code>nums</code> and a target element <code>target</code>.</p>
<p>A <strong>target index</strong> is an index <code>i</code> such that <code>nums[i] == target</code>.</p>
<p>Return <em>a list of the target indices of</em> <code>nums</code> after<em> sorting... | Easy | 225.3K | 292.3K | 225,343 | 292,252 | 77.1% | ['find-first-and-last-position-of-element-in-sorted-array', 'rank-transform-of-an-array', 'find-words-containing-character'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> targetIndices(vector<int>& nums, int target) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public List<Integer> targetIndices(int[] nums, int target) {\n \n }\n}"}, {... | [1,2,5,2,3]
2 | {
"name": "targetIndices",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer",
"name": "target"
}
],
"return": {
"type": "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', 'Binary Search', 'Sorting'] |
2,090 | K Radius Subarray Averages | k-radius-subarray-averages | <p>You are given a <strong>0-indexed</strong> array <code>nums</code> of <code>n</code> integers, and an integer <code>k</code>.</p>
<p>The <strong>k-radius average</strong> for a subarray of <code>nums</code> <strong>centered</strong> at some index <code>i</code> with the <strong>radius</strong> <code>k</code> is the... | Medium | 158.6K | 345.1K | 158,627 | 345,056 | 46.0% | ['minimum-size-subarray-sum', 'moving-average-from-data-stream', 'subarray-sum-equals-k', 'maximum-average-subarray-i', 'number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold', 'find-the-grid-of-region-average'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> getAverages(vector<int>& nums, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] getAverages(int[] nums, int k) {\n \n }\n}"}, {"value": "python", "te... | [7,4,3,9,1,8,5,2,6]
3 | {
"name": "getAverages",
"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', 'Sliding Window'] |
2,091 | Removing Minimum and Maximum From Array | removing-minimum-and-maximum-from-array | <p>You are given a <strong>0-indexed</strong> array of <strong>distinct</strong> integers <code>nums</code>.</p>
<p>There is an element in <code>nums</code> that has the <strong>lowest</strong> value and an element that has the <strong>highest</strong> value. We call them the <strong>minimum</strong> and <strong>maxim... | Medium | 50.7K | 92.2K | 50,730 | 92,183 | 55.0% | ['maximum-points-you-can-obtain-from-cards', 'minimum-deletions-to-make-character-frequencies-unique'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minimumDeletions(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minimumDeletions(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python",... | [2,10,7,5,4,1,8,6] | {
"name": "minimumDeletions",
"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,092 | Find All People With Secret | find-all-people-with-secret | <p>You are given an integer <code>n</code> indicating there are <code>n</code> people numbered from <code>0</code> to <code>n - 1</code>. You are also given a <strong>0-indexed</strong> 2D integer array <code>meetings</code> where <code>meetings[i] = [x<sub>i</sub>, y<sub>i</sub>, time<sub>i</sub>]</code> indicates tha... | Hard | 103K | 227.1K | 102,984 | 227,114 | 45.3% | ['reachable-nodes-in-subdivided-graph'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> findAllPeople(int n, vector<vector<int>>& meetings, int firstPerson) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public List<Integer> findAllPeople(int n, int[][] meetings, i... | 6
[[1,2,5],[2,3,8],[1,5,10]]
1 | {
"name": "findAllPeople",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[][]",
"name": "meetings"
},
{
"type": "integer",
"name": "firstPerson"
}
],
"return": {
"type": "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... | ['Depth-First Search', 'Breadth-First Search', 'Union Find', 'Graph', 'Sorting'] |
2,093 | Minimum Cost to Reach City With Discounts | minimum-cost-to-reach-city-with-discounts | null | Medium | 11K | 18.4K | 11,028 | 18,423 | 59.9% | ['cheapest-flights-within-k-stops', 'connecting-cities-with-minimum-cost', 'maximum-cost-of-trip-with-k-highways', 'minimum-cost-to-reach-destination-in-time'] | [] | Algorithms | null | 5
[[0,1,4],[2,1,3],[1,4,11],[3,2,3],[3,4,2]]
1 | {
"name": "minimumCost",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[][]",
"name": "highways"
},
{
"type": "integer",
"name": "discounts"
}
],
"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... | ['Graph', 'Heap (Priority Queue)', 'Shortest Path'] |
2,094 | Finding 3-Digit Even Numbers | finding-3-digit-even-numbers | <p>You are given an integer array <code>digits</code>, where each element is a digit. The array may contain duplicates.</p>
<p>You need to find <strong>all</strong> the <strong>unique</strong> integers that follow the given requirements:</p>
<ul>
<li>The integer consists of the <strong>concatenation</strong> of <str... | Easy | 41.8K | 65.6K | 41,789 | 65,640 | 63.7% | ['find-numbers-with-even-number-of-digits'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> findEvenNumbers(vector<int>& digits) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] findEvenNumbers(int[] digits) {\n \n }\n}"}, {"value": "python", "text... | [2,1,3,0] | {
"name": "findEvenNumbers",
"params": [
{
"name": "digits",
"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', 'Enumeration'] |
2,095 | Delete the Middle Node of a Linked List | delete-the-middle-node-of-a-linked-list | <p>You are given the <code>head</code> of a linked list. <strong>Delete</strong> the <strong>middle node</strong>, and return <em>the</em> <code>head</code> <em>of the modified linked list</em>.</p>
<p>The <strong>middle node</strong> of a linked list of size <code>n</code> is the <code>⌊n / 2⌋<sup>th</s... | Medium | 658.8K | 1.1M | 658,817 | 1,105,233 | 59.6% | ['remove-nth-node-from-end-of-list', 'reorder-list', 'remove-linked-list-elements', 'middle-of-the-linked-list'] | [] | 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 * ... | [1,3,4,7,1,2,6] | {
"name": "deleteMiddle",
"params": [
{
"name": "head",
"type": "ListNode"
}
],
"return": {
"type": "ListNode"
}
} | {"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... | ['Linked List', 'Two Pointers'] |
2,096 | Step-By-Step Directions From a Binary Tree Node to Another | step-by-step-directions-from-a-binary-tree-node-to-another | <p>You are given the <code>root</code> of a <strong>binary tree</strong> with <code>n</code> nodes. Each node is uniquely assigned a value from <code>1</code> to <code>n</code>. You are also given an integer <code>startValue</code> representing the value of the start node <code>s</code>, and a different integer <code>d... | Medium | 214.3K | 381K | 214,339 | 381,007 | 56.3% | ['path-sum-ii', 'lowest-common-ancestor-of-a-binary-tree', 'binary-tree-paths', 'find-distance-in-a-binary-tree'] | [] | 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... | [5,1,2,3,null,6,4]
3
6 | {
"name": "getDirections",
"params": [
{
"name": "root",
"type": "TreeNode"
},
{
"type": "integer",
"name": "startValue"
},
{
"type": "integer",
"name": "destValue"
}
],
"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', 'Tree', 'Depth-First Search', 'Binary Tree'] |
2,097 | Valid Arrangement of Pairs | valid-arrangement-of-pairs | <p>You are given a <strong>0-indexed</strong> 2D integer array <code>pairs</code> where <code>pairs[i] = [start<sub>i</sub>, end<sub>i</sub>]</code>. An arrangement of <code>pairs</code> is <strong>valid</strong> if for every index <code>i</code> where <code>1 <= i < pairs.length</code>, we have <code>end<sub>i-1... | Hard | 74.5K | 112.3K | 74,483 | 112,320 | 66.3% | ['reconstruct-itinerary', 'find-if-path-exists-in-graph'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<vector<int>> validArrangement(vector<vector<int>>& pairs) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[][] validArrangement(int[][] pairs) {\n \n }\n}"}, {"val... | [[5,1],[4,5],[11,9],[9,4]] | {
"name": "validArrangement",
"params": [
{
"name": "pairs",
"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', 'Graph', 'Eulerian Circuit'] |
2,098 | Subsequence of Size K With the Largest Even Sum | subsequence-of-size-k-with-the-largest-even-sum | null | Medium | 4.1K | 11.5K | 4,100 | 11,517 | 35.6% | ['split-array-largest-sum', 'partition-array-for-maximum-sum', 'number-of-sub-arrays-with-odd-sum'] | [] | Algorithms | null | [4,1,5,3,1]
3 | {
"name": "largestEvenSum",
"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', 'Greedy', 'Sorting'] |
2,099 | Find Subsequence of Length K With the Largest Sum | find-subsequence-of-length-k-with-the-largest-sum | <p>You are given an integer array <code>nums</code> and an integer <code>k</code>. You want to find a <strong>subsequence </strong>of <code>nums</code> of length <code>k</code> that has the <strong>largest</strong> sum.</p>
<p>Return<em> </em><em><strong>any</strong> such subsequence as an integer array of length </em... | Easy | 64K | 141.7K | 63,950 | 141,732 | 45.1% | ['kth-largest-element-in-an-array', 'maximize-sum-of-array-after-k-negations', 'sort-integers-by-the-number-of-1-bits', 'minimum-difference-in-sums-after-removal-of-elements'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> maxSubsequence(vector<int>& nums, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] maxSubsequence(int[] nums, int k) {\n \n }\n}"}, {"value": "python... | [2,1,3,3]
2 | {
"name": "maxSubsequence",
"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', 'Hash Table', 'Sorting', 'Heap (Priority Queue)'] |
2,100 | Find Good Days to Rob the Bank | find-good-days-to-rob-the-bank | <p>You and a gang of thieves are planning on robbing a bank. You are given a <strong>0-indexed</strong> integer array <code>security</code>, where <code>security[i]</code> is the number of guards on duty on the <code>i<sup>th</sup></code> day. The days are numbered starting from <code>0</code>. You are also given an in... | Medium | 34.9K | 69.7K | 34,873 | 69,670 | 50.1% | ['non-decreasing-array', 'longest-mountain-in-array', 'find-in-mountain-array', 'maximum-ascending-subarray-sum', 'find-all-good-indices'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> goodDaysToRobBank(vector<int>& security, int time) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public List<Integer> goodDaysToRobBank(int[] security, int time) {\n \n ... | [5,3,3,3,5,6,2]
2 | {
"name": "goodDaysToRobBank",
"params": [
{
"type": "integer[]",
"name": "security"
},
{
"type": "integer",
"name": "time"
}
],
"return": {
"type": "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', 'Dynamic Programming', 'Prefix Sum'] |
2,101 | Detonate the Maximum Bombs | detonate-the-maximum-bombs | <p>You are given a list of bombs. The <strong>range</strong> of a bomb is defined as the area where its effect can be felt. This area is in the shape of a <strong>circle</strong> with the center as the location of the bomb.</p>
<p>The bombs are represented by a <strong>0-indexed</strong> 2D integer array <code>bombs</... | Medium | 147.8K | 301.5K | 147,835 | 301,456 | 49.0% | ['minesweeper', 'number-of-provinces', 'max-area-of-island', 'rotting-oranges'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maximumDetonation(vector<vector<int>>& bombs) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maximumDetonation(int[][] bombs) {\n \n }\n}"}, {"value": "python", "te... | [[2,1,3],[6,1,4]] | {
"name": "maximumDetonation",
"params": [
{
"name": "bombs",
"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', 'Depth-First Search', 'Breadth-First Search', 'Graph', 'Geometry'] |
2,102 | Sequentially Ordinal Rank Tracker | sequentially-ordinal-rank-tracker | <p>A scenic location is represented by its <code>name</code> and attractiveness <code>score</code>, where <code>name</code> is a <strong>unique</strong> string among all locations and <code>score</code> is an integer. Locations can be ranked from the best to the worst. The <strong>higher</strong> the score, the better ... | Hard | 17.5K | 27.2K | 17,495 | 27,175 | 64.4% | ['find-median-from-data-stream', 'kth-largest-element-in-a-stream', 'finding-mk-average'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class SORTracker {\npublic:\n SORTracker() {\n \n }\n \n void add(string name, int score) {\n \n }\n \n string get() {\n \n }\n};\n\n/**\n * Your SORTracker object will be instantiated and called as such:\n * SORTracker* obj =... | ["SORTracker","add","add","get","add","get","add","get","add","get","add","get","get"]
[[],["bradford",2],["branford",3],[],["alps",2],[],["orland",2],[],["orlando",3],[],["alpine",2],[],[]] | {
"classname": "SORTracker",
"constructor": {
"params": []
},
"methods": [
{
"params": [
{
"type": "string",
"name": "name"
},
{
"type": "integer",
"name": "score"
}
],
"name": "add",
"return": {
"typ... | {"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... | ['Design', 'Heap (Priority Queue)', 'Data Stream', 'Ordered Set'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.