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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,410 | Maximize Subarray Sum After Removing All Occurrences of One Element | maximize-subarray-sum-after-removing-all-occurrences-of-one-element | <p>You are given an integer array <code>nums</code>.</p>
<p>You can do the following operation on the array <strong>at most</strong> once:</p>
<ul>
<li>Choose <strong>any</strong> integer <code>x</code> such that <code>nums</code> remains <strong>non-empty</strong> on removing all occurrences of <code>x</code>.</li>... | Hard | 2.6K | 12.9K | 2,625 | 12,942 | 20.3% | ['maximum-subarray', 'maximum-subarray-sum-with-one-deletion'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long maxSubarraySum(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long maxSubarraySum(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Pytho... | [-3,2,-2,-1,3,-2,3] | {
"name": "maxSubarraySum",
"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', 'Segment Tree'] |
3,411 | Maximum Subarray With Equal Products | maximum-subarray-with-equal-products | <p>You are given an array of <strong>positive</strong> integers <code>nums</code>.</p>
<p>An array <code>arr</code> is called <strong>product equivalent</strong> if <code>prod(arr) == lcm(arr) * gcd(arr)</code>, where:</p>
<ul>
<li><code>prod(arr)</code> is the product of all elements of <code>arr</code>.</li>
<li>... | Easy | 23.4K | 50.8K | 23,383 | 50,826 | 46.0% | ['find-greatest-common-divisor-of-array'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxLength(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxLength(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCode"... | [1,2,1,2,1,1,1] | {
"name": "maxLength",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Math', 'Sliding Window', 'Enumeration', 'Number Theory'] |
3,412 | Find Mirror Score of a String | find-mirror-score-of-a-string | <p>You are given a string <code>s</code>.</p>
<p>We define the <strong>mirror</strong> of a letter in the English alphabet as its corresponding letter when the alphabet is reversed. For example, the mirror of <code>'a'</code> is <code>'z'</code>, and the mirror of <code>'y'</code> is <code>'... | Medium | 20.8K | 57.7K | 20,834 | 57,659 | 36.1% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long calculateScore(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long calculateScore(String s) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaul... | "aczzx" | {
"name": "calculateScore",
"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', 'String', 'Stack', 'Simulation'] |
3,413 | Maximum Coins From K Consecutive Bags | maximum-coins-from-k-consecutive-bags | <p>There are an infinite amount of bags on a number line, one bag for each coordinate. Some of these bags contain coins.</p>
<p>You are given a 2D array <code>coins</code>, where <code>coins[i] = [l<sub>i</sub>, r<sub>i</sub>, c<sub>i</sub>]</code> denotes that every bag from <code>l<sub>i</sub></code> to <code>r<sub>... | Medium | 6.7K | 28.5K | 6,714 | 28,511 | 23.5% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long maximumCoins(vector<vector<int>>& coins, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long maximumCoins(int[][] coins, int k) {\n \n }\n}"}, {"value": "p... | [[8,10,1],[1,3,2],[5,6,4]]
4 | {
"name": "maximumCoins",
"params": [
{
"name": "coins",
"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', 'Binary Search', 'Greedy', 'Sliding Window', 'Sorting', 'Prefix Sum'] |
3,414 | Maximum Score of Non-overlapping Intervals | maximum-score-of-non-overlapping-intervals | <p>You are given a 2D integer array <code>intervals</code>, where <code>intervals[i] = [l<sub>i</sub>, r<sub>i</sub>, weight<sub>i</sub>]</code>. Interval <code>i</code> starts at position <code>l<sub>i</sub></code> and ends at <code>r<sub>i</sub></code>, and has a weight of <code>weight<sub>i</sub></code>. You can cho... | Hard | 3.1K | 9.8K | 3,142 | 9,754 | 32.2% | ['two-best-non-overlapping-events'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> maximumWeight(vector<vector<int>>& intervals) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] maximumWeight(List<List<Integer>> intervals) {\n \n }\n}"}, {... | [[1,3,2],[4,5,2],[1,5,5],[6,9,3],[6,7,1],[8,9,1]] | {
"name": "maximumWeight",
"params": [
{
"name": "intervals",
"type": "list<list<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'] |
3,415 | Find Products with Three Consecutive Digits | find-products-with-three-consecutive-digits | null | Easy | 851 | 1K | 851 | 1,031 | 82.5% | [] | ['CREATE TABLE if not exists products (\n product_id INT,\n name VARCHAR(255)\n)\n', 'Truncate table Products', "insert into Products (product_id, name) values ('1', 'ABC123XYZ')", "insert into Products (product_id, name) values ('2', 'A12B34C')", "insert into Products (product_id, name) values ('3', 'Product567... | Database | null | {"headers":{"Products":["product_id","name"]},"rows":{"Products":[[1,"ABC123XYZ"],[2,"A12B34C"],[3,"Product56789"],[4,"NoDigitsHere"],[5,"789Product"],[6,"Item003Description"],[7,"Product12X34"]]}} | {"mysql": ["CREATE TABLE if not exists products (\n product_id INT,\n name VARCHAR(255)\n)\n"], "mssql": ["CREATE TABLE products (\n product_id INT,\n name VARCHAR(255)\n)\n"], "oraclesql": ["CREATE TABLE products (\n product_id NUMBER,\n name VARCHAR2(255)\n)\n"], "postgresql": ["CREATE TABLE if not... | {"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'] |
3,416 | Subsequences with a Unique Middle Mode II | subsequences-with-a-unique-middle-mode-ii | null | Hard | 124 | 285 | 124 | 285 | 43.5% | ['subsequences-with-a-unique-middle-mode-i'] | [] | Algorithms | null | [1,1,1,1,1,1] | {
"name": "subsequencesWithMiddleMode",
"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', 'Math', 'Combinatorics'] |
3,417 | Zigzag Grid Traversal With Skip | zigzag-grid-traversal-with-skip | <p>You are given an <code>m x n</code> 2D array <code>grid</code> of <strong>positive</strong> integers.</p>
<p>Your task is to traverse <code>grid</code> in a <strong>zigzag</strong> pattern while skipping every <strong>alternate</strong> cell.</p>
<p>Zigzag pattern traversal is defined as following the below action... | Easy | 31.7K | 49.4K | 31,700 | 49,420 | 64.1% | ['binary-tree-zigzag-level-order-traversal', 'longest-zigzag-path-in-a-binary-tree'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> zigzagTraversal(vector<vector<int>>& grid) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public List<Integer> zigzagTraversal(int[][] grid) {\n \n }\n}"}, {"value": "... | [[1,2],[3,4]] | {
"name": "zigzagTraversal",
"params": [
{
"name": "grid",
"type": "integer[][]"
}
],
"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', 'Matrix', 'Simulation'] |
3,418 | Maximum Amount of Money Robot Can Earn | maximum-amount-of-money-robot-can-earn | <p>You are given an <code>m x n</code> grid. A robot starts at the top-left corner of the grid <code>(0, 0)</code> and wants to reach the bottom-right corner <code>(m - 1, n - 1)</code>. The robot can move either right or down at any point in time.</p>
<p>The grid contains a value <code>coins[i][j]</code> in each cell... | Medium | 20.2K | 67.9K | 20,226 | 67,875 | 29.8% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maximumAmount(vector<vector<int>>& coins) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maximumAmount(int[][] coins) {\n \n }\n}"}, {"value": "python", "text": "Py... | [[0,1,-1],[1,-2,3],[2,-3,4]] | {
"name": "maximumAmount",
"params": [
{
"name": "coins",
"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'] |
3,419 | Minimize the Maximum Edge Weight of Graph | minimize-the-maximum-edge-weight-of-graph | <p>You are given two integers, <code>n</code> and <code>threshold</code>, as well as a <strong>directed</strong> weighted graph of <code>n</code> nodes numbered from 0 to <code>n - 1</code>. The graph is represented by a <strong>2D</strong> integer array <code>edges</code>, where <code>edges[i] = [A<sub>i</sub>, B<sub>... | Medium | 10.8K | 25.1K | 10,838 | 25,068 | 43.2% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minMaxWeight(int n, vector<vector<int>>& edges, int threshold) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minMaxWeight(int n, int[][] edges, int threshold) {\n \n ... | 5
[[1,0,1],[2,0,2],[3,0,1],[4,3,1],[2,1,1]]
2 | {
"name": "minMaxWeight",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[][]",
"name": "edges"
},
{
"type": "integer",
"name": "threshold"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Binary Search', 'Depth-First Search', 'Breadth-First Search', 'Graph', 'Shortest Path'] |
3,420 | Count Non-Decreasing Subarrays After K Operations | count-non-decreasing-subarrays-after-k-operations | <p>You are given an array <code>nums</code> of <code>n</code> integers and an integer <code>k</code>.</p>
<p>For each subarray of <code>nums</code>, you can apply <strong>up to</strong> <code>k</code> operations on it. In each operation, you increment any element of the subarray by 1.</p>
<p><strong>Note</strong> tha... | Hard | 2.8K | 12.9K | 2,817 | 12,878 | 21.9% | ['non-decreasing-array'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long countNonDecreasingSubarrays(vector<int>& nums, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long countNonDecreasingSubarrays(int[] nums, int k) {\n \n }\... | [6,3,1,2,4,4]
7 | {
"name": "countNonDecreasingSubarrays",
"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', 'Stack', 'Segment Tree', 'Queue', 'Sliding Window', 'Monotonic Stack', 'Monotonic Queue'] |
3,421 | Find Students Who Improved | find-students-who-improved | <p>Table: <code>Scores</code></p>
<pre>
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| student_id | int |
| subject | varchar |
| score | int |
| exam_date | varchar |
+-------------+---------+
(student_id, subject, exam_date) is the primary key for this table.
Eac... | Medium | 5.1K | 10.5K | 5,076 | 10,475 | 48.5% | [] | ['CREATE TABLE Scores (\n student_id INT,\n subject VARCHAR(50),\n score INT,\n exam_date VARCHAR(10)\n)', 'Truncate table Scores', "insert into Scores (student_id, subject, score, exam_date) values ('101', 'Math', '70', '2023-01-15')", "insert into Scores (student_id, subject, score, exam_date) values ('10... | Database | [{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"v... | {"headers":{"Scores":["student_id","subject","score","exam_date"]},"rows":{"Scores":[[101,"Math",70,"2023-01-15"],[101,"Math",85,"2023-02-15"],[101,"Physics",65,"2023-01-15"],[101,"Physics",60,"2023-02-15"],[102,"Math",80,"2023-01-15"],[102,"Math",85,"2023-02-15"],[103,"Math",90,"2023-01-15"],[104,"Physics",75,"2023-01... | {"mysql": ["CREATE TABLE Scores (\n student_id INT,\n subject VARCHAR(50),\n score INT,\n exam_date VARCHAR(10)\n)"], "mssql": ["CREATE TABLE Scores (\n student_id INT,\n subject VARCHAR(50),\n score INT,\n exam_date VARCHAR(10)\n)"], "oraclesql": ["CREATE TABLE Scores (\n student_id NUMBER,\... | {"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'] |
3,422 | Minimum Operations to Make Subarray Elements Equal | minimum-operations-to-make-subarray-elements-equal | null | Medium | 418 | 836 | 418 | 836 | 50.0% | ['find-median-from-data-stream', 'minimum-moves-to-equal-array-elements-ii'] | [] | Algorithms | null | [4,-3,2,1,-4,6]
3 | {
"name": "minOperations",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Math', 'Sliding Window', 'Heap (Priority Queue)'] |
3,423 | Maximum Difference Between Adjacent Elements in a Circular Array | maximum-difference-between-adjacent-elements-in-a-circular-array | <p>Given a <strong>circular</strong> array <code>nums</code>, find the <b>maximum</b> absolute difference between adjacent elements.</p>
<p><strong>Note</strong>: In a circular array, the first and last elements are adjacent.</p>
<p> </p>
<p><strong class="example">Example 1:</strong></p>
<div class="example-bl... | Easy | 37K | 50.2K | 37,042 | 50,231 | 73.7% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxAdjacentDistance(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxAdjacentDistance(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Py... | [1,2,4] | {
"name": "maxAdjacentDistance",
"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'] |
3,424 | Minimum Cost to Make Arrays Identical | minimum-cost-to-make-arrays-identical | <p>You are given two integer arrays <code>arr</code> and <code>brr</code> of length <code>n</code>, and an integer <code>k</code>. You can perform the following operations on <code>arr</code> <em>any</em> number of times:</p>
<ul>
<li>Split <code>arr</code> into <em>any</em> number of <strong>contiguous</strong> <spa... | Medium | 22.5K | 61.2K | 22,469 | 61,230 | 36.7% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long minCost(vector<int>& arr, vector<int>& brr, long long k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long minCost(int[] arr, int[] brr, long k) {\n \n }\n}"}, ... | [-7,9,5]
[7,-2,-5]
2 | {
"name": "minCost",
"params": [
{
"name": "arr",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "brr"
},
{
"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', 'Greedy', 'Sorting'] |
3,425 | Longest Special Path | longest-special-path | <p>You are given an undirected tree rooted at node <code>0</code> with <code>n</code> nodes numbered from <code>0</code> to <code>n - 1</code>, represented by a 2D array <code>edges</code> of length <code>n - 1</code>, where <code>edges[i] = [u<sub>i</sub>, v<sub>i</sub>, length<sub>i</sub>]</code> indicates an edge be... | Hard | 4.4K | 21.8K | 4,387 | 21,828 | 20.1% | ['frog-position-after-t-seconds', 'longest-special-path-ii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> longestSpecialPath(vector<vector<int>>& edges, vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] longestSpecialPath(int[][] edges, int[] nums) {\n ... | [[0,1,2],[1,2,3],[1,3,5],[1,4,4],[2,5,6]]
[2,1,2,1,3,1] | {
"name": "longestSpecialPath",
"params": [
{
"name": "edges",
"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... | ['Array', 'Hash Table', 'Tree', 'Depth-First Search', 'Prefix Sum'] |
3,426 | Manhattan Distances of All Arrangements of Pieces | manhattan-distances-of-all-arrangements-of-pieces | <p>You are given three integers <code><font face="monospace">m</font></code>, <code><font face="monospace">n</font></code>, and <code>k</code>.</p>
<p>There is a rectangular grid of size <code>m × n</code> containing <code>k</code> identical pieces. Return the sum of Manhattan distances between every pair of pie... | Hard | 3.1K | 8.6K | 3,097 | 8,644 | 35.8% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int distanceSum(int m, int n, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int distanceSum(int m, int n, int k) {\n \n }\n}"}, {"value": "python", "text": "Python"... | 2
2
2 | {
"name": "distanceSum",
"params": [
{
"name": "m",
"type": "integer"
},
{
"type": "integer",
"name": "n"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Math', 'Combinatorics'] |
3,427 | Sum of Variable Length Subarrays | sum-of-variable-length-subarrays | <p>You are given an integer array <code>nums</code> of size <code>n</code>. For <strong>each</strong> index <code>i</code> where <code>0 <= i < n</code>, define a <span data-keyword="subarray-nonempty">subarray</span> <code>nums[start ... i]</code> where <code>start = max(0, i - nums[i])</code>.</p>
<p>Return th... | Easy | 40.1K | 46.6K | 40,062 | 46,586 | 86.0% | ['range-sum-query-immutable', 'maximum-sum-of-3-non-overlapping-subarrays'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int subarraySum(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int subarraySum(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultC... | [2,3,1] | {
"name": "subarraySum",
"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', 'Prefix Sum'] |
3,428 | Maximum and Minimum Sums of at Most Size K Subsequences | maximum-and-minimum-sums-of-at-most-size-k-subsequences | <p>You are given an integer array <code>nums</code> and a positive integer <code>k</code>. Return the sum of the <strong>maximum</strong> and <strong>minimum</strong> elements of all <strong><span data-keyword="subsequence-sequence-nonempty">subsequences</span></strong> of <code>nums</code> with <strong>at most</strong... | Medium | 10.5K | 50.1K | 10,535 | 50,054 | 21.0% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minMaxSums(vector<int>& nums, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minMaxSums(int[] nums, int k) {\n \n }\n}"}, {"value": "python", "text": "Python... | [1,2,3]
2 | {
"name": "minMaxSums",
"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', 'Math', 'Dynamic Programming', 'Sorting', 'Combinatorics'] |
3,429 | Paint House IV | paint-house-iv | <p>You are given an <strong>even</strong> integer <code>n</code> representing the number of houses arranged in a straight line, and a 2D array <code>cost</code> of size <code>n x 3</code>, where <code>cost[i][j]</code> represents the cost of painting house <code>i</code> with color <code>j + 1</code>.</p>
<p>The house... | Medium | 8.4K | 18.4K | 8,367 | 18,438 | 45.4% | ['paint-house-iii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long minCost(int n, vector<vector<int>>& cost) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long minCost(int n, int[][] cost) {\n \n }\n}"}, {"value": "python", "tex... | 4
[[3,5,7],[6,2,9],[4,8,1],[7,3,5]] | {
"name": "minCost",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[][]",
"name": "cost"
}
],
"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'] |
3,430 | Maximum and Minimum Sums of at Most Size K Subarrays | maximum-and-minimum-sums-of-at-most-size-k-subarrays | <p>You are given an integer array <code>nums</code> and a <strong>positive</strong> integer <code>k</code>. Return the sum of the <strong>maximum</strong> and <strong>minimum</strong> elements of all <span data-keyword="subarray-nonempty">subarrays</span> with <strong>at most</strong> <code>k</code> elements.</p>
<p>&... | Hard | 3K | 12.6K | 2,955 | 12,577 | 23.5% | ['next-greater-element-ii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long minMaxSubarraySum(vector<int>& nums, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long minMaxSubarraySum(int[] nums, int k) {\n \n }\n}"}, {"value": "pyt... | [1,2,3]
2 | {
"name": "minMaxSubarraySum",
"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', 'Math', 'Stack', 'Monotonic Stack'] |
3,431 | Minimum Unlocked Indices to Sort Nums | minimum-unlocked-indices-to-sort-nums | null | Medium | 325 | 546 | 325 | 546 | 59.5% | [] | [] | Algorithms | null | [1,2,1,2,3,2]
[1,0,1,1,0,1] | {
"name": "minUnlockedIndices",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "locked"
}
],
"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'] |
3,432 | Count Partitions with Even Sum Difference | count-partitions-with-even-sum-difference | <p>You are given an integer array <code>nums</code> of length <code>n</code>.</p>
<p>A <strong>partition</strong> is defined as an index <code>i</code> where <code>0 <= i < n - 1</code>, splitting the array into two <strong>non-empty</strong> subarrays such that:</p>
<ul>
<li>Left subarray contains indices <co... | Easy | 43.3K | 53.7K | 43,328 | 53,694 | 80.7% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countPartitions(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countPartitions(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python", "... | [10,10,3,7,6] | {
"name": "countPartitions",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Math', 'Prefix Sum'] |
3,433 | Count Mentions Per User | count-mentions-per-user | <p>You are given an integer <code>numberOfUsers</code> representing the total number of users and an array <code>events</code> of size <code>n x 3</code>.</p>
<p>Each <code inline="">events[i]</code> can be either of the following two types:</p>
<ol>
<li><strong>Message Event:</strong> <code>["MESSAGE", &q... | Medium | 14.8K | 49.2K | 14,845 | 49,237 | 30.2% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> countMentions(int numberOfUsers, vector<vector<string>>& events) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] countMentions(int numberOfUsers, List<List<String>> ... | 2
[["MESSAGE","10","id1 id0"],["OFFLINE","11","0"],["MESSAGE","71","HERE"]] | {
"name": "countMentions",
"params": [
{
"name": "numberOfUsers",
"type": "integer"
},
{
"type": "list<list<string>>",
"name": "events"
}
],
"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', 'Simulation'] |
3,434 | Maximum Frequency After Subarray Operation | maximum-frequency-after-subarray-operation | <p>You are given an array <code>nums</code> of length <code>n</code>. You are also given an integer <code>k</code>.</p>
<p>You perform the following operation on <code>nums</code> <strong>once</strong>:</p>
<ul>
<li>Select a <span data-keyword="subarray-nonempty">subarray</span> <code>nums[i..j]</code> where <code>0... | Medium | 12.2K | 51.8K | 12,180 | 51,770 | 23.5% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxFrequency(vector<int>& nums, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxFrequency(int[] nums, int k) {\n \n }\n}"}, {"value": "python", "text": "Py... | [1,2,3,4,5,6]
1 | {
"name": "maxFrequency",
"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', 'Dynamic Programming', 'Greedy', 'Enumeration', 'Prefix Sum'] |
3,435 | Frequencies of Shortest Supersequences | frequencies-of-shortest-supersequences | <p>You are given an array of strings <code>words</code>. Find all <strong>shortest common supersequences (SCS)</strong> of <code><font face="monospace">words</font></code> that are not <span data-keyword="permutation-string">permutations</span> of each other.</p>
<p>A <strong>shortest common supersequence</strong> is ... | Hard | 1.6K | 6.4K | 1,576 | 6,407 | 24.6% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<vector<int>> supersequences(vector<string>& words) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public List<List<Integer>> supersequences(String[] words) {\n \n }\n}"}, {... | ["ab","ba"] | {
"name": "supersequences",
"params": [
{
"name": "words",
"type": "string[]"
}
],
"return": {
"type": "list<list<integer>>"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'String', 'Bit Manipulation', 'Graph', 'Topological Sort', 'Enumeration'] |
3,436 | Find Valid Emails | find-valid-emails | <p>Table: <code>Users</code></p>
<pre>
+-----------------+---------+
| Column Name | Type |
+-----------------+---------+
| user_id | int |
| email | varchar |
+-----------------+---------+
(user_id) is the unique key for this table.
Each row contains a user's unique ID and email addre... | Easy | 5.9K | 10.2K | 5,928 | 10,182 | 58.2% | [] | ['CREATE TABLE If not Exists Users (\n user_id INT,\n email VARCHAR(255)\n)', 'Truncate table Users', "insert into Users (user_id, email) values ('1', 'alice@example.com')", "insert into Users (user_id, email) values ('2', 'bob_at_example.com')", "insert into Users (user_id, email) values ('3', 'charlie@example.n... | Database | [{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"v... | {"headers":{"Users":["user_id","email"]},"rows":{"Users":[[1,"alice@example.com"],[2,"bob_at_example.com"],[3,"charlie@example.net"],[4,"david@domain.com"],[5,"eve@invalid"]]}} | {"mysql": ["CREATE TABLE If not Exists Users (\n user_id INT,\n email VARCHAR(255)\n)"], "mssql": ["CREATE TABLE Users (\n user_id INT,\n email VARCHAR(255)\n)"], "oraclesql": ["CREATE TABLE Users (\n user_id NUMBER,\n email VARCHAR2(255)\n)"], "database": true, "name": "find_valid_emails", "postgresq... | {"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'] |
3,437 | Permutations III | permutations-iii | null | Medium | 1.5K | 1.7K | 1,504 | 1,728 | 87.0% | ['permutations-iv'] | [] | Algorithms | null | 4 | {
"name": "permute",
"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... | ['Array', 'Backtracking'] |
3,438 | Find Valid Pair of Adjacent Digits in String | find-valid-pair-of-adjacent-digits-in-string | <p>You are given a string <code>s</code> consisting only of digits. A <strong>valid pair</strong> is defined as two <strong>adjacent</strong> digits in <code>s</code> such that:</p>
<ul>
<li>The first digit is <strong>not equal</strong> to the second.</li>
<li>Each digit in the pair appears in <code>s</code> <strong... | Easy | 36.7K | 59.5K | 36,667 | 59,505 | 61.6% | ['majority-element', 'contains-duplicate'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string findValidPair(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String findValidPair(String s) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCo... | "2523533" | {
"name": "findValidPair",
"params": [
{
"name": "s",
"type": "string"
}
],
"return": {
"type": "string"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Hash Table', 'String', 'Counting'] |
3,439 | Reschedule Meetings for Maximum Free Time I | reschedule-meetings-for-maximum-free-time-i | <p>You are given an integer <code>eventTime</code> denoting the duration of an event, where the event occurs from time <code>t = 0</code> to time <code>t = eventTime</code>.</p>
<p>You are also given two integer arrays <code>startTime</code> and <code>endTime</code>, each of length <code>n</code>. These represent the ... | Medium | 17.5K | 55.7K | 17,536 | 55,740 | 31.5% | ['meeting-scheduler'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxFreeTime(int eventTime, int k, vector<int>& startTime, vector<int>& endTime) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxFreeTime(int eventTime, int k, int[] startTi... | 5
1
[1,3]
[2,5] | {
"name": "maxFreeTime",
"params": [
{
"name": "eventTime",
"type": "integer"
},
{
"type": "integer",
"name": "k"
},
{
"type": "integer[]",
"name": "startTime"
},
{
"type": "integer[]",
"name": "endTime"
}
],
"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', 'Greedy', 'Sliding Window'] |
3,440 | Reschedule Meetings for Maximum Free Time II | reschedule-meetings-for-maximum-free-time-ii | <p>You are given an integer <code>eventTime</code> denoting the duration of an event. You are also given two integer arrays <code>startTime</code> and <code>endTime</code>, each of length <code>n</code>.</p>
<p>These represent the start and end times of <code>n</code> <strong>non-overlapping</strong> meetings that occ... | Medium | 10K | 24.8K | 9,958 | 24,779 | 40.2% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxFreeTime(int eventTime, vector<int>& startTime, vector<int>& endTime) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxFreeTime(int eventTime, int[] startTime, int[] endT... | 5
[1,3]
[2,5] | {
"name": "maxFreeTime",
"params": [
{
"name": "eventTime",
"type": "integer"
},
{
"type": "integer[]",
"name": "startTime"
},
{
"type": "integer[]",
"name": "endTime"
}
],
"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', 'Enumeration'] |
3,441 | Minimum Cost Good Caption | minimum-cost-good-caption | <p>You are given a string <code>caption</code> of length <code>n</code>. A <strong>good</strong> caption is a string where <strong>every</strong> character appears in groups of <strong>at least 3</strong> consecutive occurrences.</p>
<p>For example:</p>
<ul>
<li><code>"aaabbb"</code> and <code>"aaaacc... | Hard | 2.3K | 12.2K | 2,343 | 12,182 | 19.2% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string minCostGoodCaption(string caption) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String minCostGoodCaption(String caption) {\n \n }\n}"}, {"value": "python", "text"... | "cdcd" | {
"name": "minCostGoodCaption",
"params": [
{
"name": "caption",
"type": "string"
}
],
"return": {
"type": "string"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['String', 'Dynamic Programming'] |
3,442 | Maximum Difference Between Even and Odd Frequency I | maximum-difference-between-even-and-odd-frequency-i | <p>You are given a string <code>s</code> consisting of lowercase English letters. Your task is to find the <strong>maximum</strong> difference between the frequency of <strong>two</strong> characters in the string such that:</p>
<ul>
<li>One of the characters has an <strong>even frequency</strong> in the string.</li>... | Easy | 39.8K | 81K | 39,779 | 80,977 | 49.1% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxDifference(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxDifference(String s) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCode": "... | "aaaaabbc" | {
"name": "maxDifference",
"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... | ['Hash Table', 'String', 'Counting'] |
3,443 | Maximum Manhattan Distance After K Changes | maximum-manhattan-distance-after-k-changes | <p>You are given a string <code>s</code> consisting of the characters <code>'N'</code>, <code>'S'</code>, <code>'E'</code>, and <code>'W'</code>, where <code>s[i]</code> indicates movements in an infinite grid:</p>
<ul>
<li><code>'N'</code> : Move north by 1 unit.</li>
<li><co... | Medium | 15.6K | 50.3K | 15,616 | 50,345 | 31.0% | ['as-far-from-land-as-possible'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxDistance(string s, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxDistance(String s, int k) {\n \n }\n}"}, {"value": "python", "text": "Python", "defau... | "NWSE"
1 | {
"name": "maxDistance",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Hash Table', 'Math', 'String', 'Counting'] |
3,444 | Minimum Increments for Target Multiples in an Array | minimum-increments-for-target-multiples-in-an-array | <p>You are given two arrays, <code>nums</code> and <code>target</code>.</p>
<p>In a single operation, you may increment any element of <code>nums</code> by 1.</p>
<p>Return <strong>the minimum number</strong> of operations required so that each element in <code>target</code> has <strong>at least</strong> one multiple... | Hard | 5.3K | 20.5K | 5,275 | 20,549 | 25.7% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minimumIncrements(vector<int>& nums, vector<int>& target) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minimumIncrements(int[] nums, int[] target) {\n \n }\n}"}, ... | [1,2,3]
[4] | {
"name": "minimumIncrements",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer[]",
"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', 'Math', 'Dynamic Programming', 'Bit Manipulation', 'Number Theory', 'Bitmask'] |
3,445 | Maximum Difference Between Even and Odd Frequency II | maximum-difference-between-even-and-odd-frequency-ii | <p>You are given a string <code>s</code> and an integer <code>k</code>. Your task is to find the <strong>maximum</strong> difference between the frequency of <strong>two</strong> characters, <code>freq[a] - freq[b]</code>, in a <span data-keyword="substring">substring</span> <code>subs</code> of <code>s</code>, such th... | Hard | 2.1K | 10.8K | 2,089 | 10,797 | 19.3% | ['frequency-of-the-most-frequent-element', 'count-elements-with-maximum-frequency'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxDifference(string s, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxDifference(String s, int k) {\n \n }\n}"}, {"value": "python", "text": "Python", "d... | "12233"
4 | {
"name": "maxDifference",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['String', 'Sliding Window', 'Enumeration', 'Prefix Sum'] |
3,446 | Sort Matrix by Diagonals | sort-matrix-by-diagonals | <p>You are given an <code>n x n</code> square matrix of integers <code>grid</code>. Return the matrix such that:</p>
<ul>
<li>The diagonals in the <strong>bottom-left triangle</strong> (including the middle diagonal) are sorted in <strong>non-increasing order</strong>.</li>
<li>The diagonals in the <strong>top-right... | Medium | 28K | 38.6K | 27,989 | 38,561 | 72.6% | ['sort-the-matrix-diagonally'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<vector<int>> sortMatrix(vector<vector<int>>& grid) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[][] sortMatrix(int[][] grid) {\n \n }\n}"}, {"value": "python",... | [[1,7,3],[9,8,2],[4,5,6]] | {
"name": "sortMatrix",
"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', 'Sorting', 'Matrix'] |
3,447 | Assign Elements to Groups with Constraints | assign-elements-to-groups-with-constraints | <p>You are given an integer array <code>groups</code>, where <code>groups[i]</code> represents the size of the <code>i<sup>th</sup></code> group. You are also given an integer array <code>elements</code>.</p>
<p>Your task is to assign <strong>one</strong> element to each group based on the following rules:</p>
<ul>
... | Medium | 18.1K | 67K | 18,127 | 67,011 | 27.1% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> assignElements(vector<int>& groups, vector<int>& elements) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] assignElements(int[] groups, int[] elements) {\n \n... | [8,4,3,2,4]
[4,2] | {
"name": "assignElements",
"params": [
{
"name": "groups",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "elements"
}
],
"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'] |
3,448 | Count Substrings Divisible By Last Digit | count-substrings-divisible-by-last-digit | <p>You are given a string <code>s</code> consisting of digits.</p>
<p>Return the <strong>number</strong> of <span data-keyword="substring-nonempty">substrings</span> of <code>s</code> <strong>divisible</strong> by their <strong>non-zero</strong> last digit.</p>
<p><strong>Note</strong>: A substring may contain leadin... | Hard | 4.8K | 22.8K | 4,774 | 22,830 | 20.9% | ['number-of-divisible-substrings'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long countSubstrings(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long countSubstrings(String s) {\n \n }\n}"}, {"value": "python", "text": "Python", "defa... | "12936" | {
"name": "countSubstrings",
"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... | ['String', 'Dynamic Programming'] |
3,449 | Maximize the Minimum Game Score | maximize-the-minimum-game-score | <p>You are given an array <code>points</code> of size <code>n</code> and an integer <code>m</code>. There is another array <code>gameScore</code> of size <code>n</code>, where <code>gameScore[i]</code> represents the score achieved at the <code>i<sup>th</sup></code> game. Initially, <code>gameScore[i] == 0</code> for a... | Hard | 2.9K | 11.7K | 2,876 | 11,749 | 24.5% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long maxScore(vector<int>& points, int m) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long maxScore(int[] points, int m) {\n \n }\n}"}, {"value": "python", "text": ... | [2,4]
3 | {
"name": "maxScore",
"params": [
{
"name": "points",
"type": "integer[]"
},
{
"type": "integer",
"name": "m"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Binary Search', 'Greedy'] |
3,450 | Maximum Students on a Single Bench | maximum-students-on-a-single-bench | null | Easy | 1.1K | 1.3K | 1,085 | 1,256 | 86.4% | [] | [] | Algorithms | null | [[1,2],[2,2],[3,3],[1,3],[2,3]] | {
"name": "maxStudentsOnBench",
"params": [
{
"name": "students",
"type": "integer[][]"
}
],
"return": {
"type": "integer"
},
"manual": false
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table'] |
3,451 | Find Invalid IP Addresses | find-invalid-ip-addresses | <p>Table: <code> logs</code></p>
<pre>
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| log_id | int |
| ip | varchar |
| status_code | int |
+-------------+---------+
log_id is the unique key for this table.
Each row contains server access log information including... | Hard | 2.3K | 3.9K | 2,282 | 3,942 | 57.9% | [] | ['CREATE TABLE logs (\n log_id INT,\n ip VARCHAR(255),\n status_code INT\n)\n', 'Truncate table logs', "insert into logs (log_id, ip, status_code) values ('1', '192.168.1.1', '200')", "insert into logs (log_id, ip, status_code) values ('2', '256.1.2.3', '404')", "insert into logs (log_id, ip, status_code) valu... | Database | [{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"v... | {"headers":{"logs":["log_id","ip","status_code"]},"rows":{"logs":[[1,"192.168.1.1",200],[2,"256.1.2.3",404],[3,"192.168.001.1",200],[4,"192.168.1.1",200],[5,"192.168.1",500],[6,"256.1.2.3",404],[7,"192.168.001.1",200]]}} | {"mysql": ["CREATE TABLE logs (\n log_id INT,\n ip VARCHAR(255),\n status_code INT\n)\n"], "mssql": ["CREATE TABLE logs (\n log_id INT,\n ip VARCHAR(255),\n status_code INT\n)\n"], "oraclesql": ["CREATE TABLE logs (\n log_id NUMBER,\n ip VARCHAR2(255),\n status_code NUMBER\n)\n"], "database":... | {"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'] |
3,452 | Sum of Good Numbers | sum-of-good-numbers | <p>Given an array of integers <code>nums</code> and an integer <code>k</code>, an element <code>nums[i]</code> is considered <strong>good</strong> if it is <strong>strictly</strong> greater than the elements at indices <code>i - k</code> and <code>i + k</code> (if those indices exist). If neither of these indices <em>e... | Easy | 41.2K | 59K | 41,239 | 58,984 | 69.9% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int sumOfGoodNumbers(vector<int>& nums, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int sumOfGoodNumbers(int[] nums, int k) {\n \n }\n}"}, {"value": "python", "te... | [1,3,2,1,5,4]
2 | {
"name": "sumOfGoodNumbers",
"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'] |
3,453 | Separate Squares I | separate-squares-i | <p>You are given a 2D integer array <code>squares</code>. Each <code>squares[i] = [x<sub>i</sub>, y<sub>i</sub>, l<sub>i</sub>]</code> represents the coordinates of the bottom-left point and the side length of a square parallel to the x-axis.</p>
<p>Find the <strong>minimum</strong> y-coordinate value of a horizontal ... | Medium | 20.3K | 55.4K | 20,297 | 55,366 | 36.7% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n double separateSquares(vector<vector<int>>& squares) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public double separateSquares(int[][] squares) {\n \n }\n}"}, {"value": "python... | [[0,0,1],[2,2,1]] | {
"name": "separateSquares",
"params": [
{
"name": "squares",
"type": "integer[][]"
}
],
"return": {
"type": "double"
}
} | {"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'] |
3,454 | Separate Squares II | separate-squares-ii | <p>You are given a 2D integer array <code>squares</code>. Each <code>squares[i] = [x<sub>i</sub>, y<sub>i</sub>, l<sub>i</sub>]</code> represents the coordinates of the bottom-left point and the side length of a square parallel to the x-axis.</p>
<p>Find the <strong>minimum</strong> y-coordinate value of a horizontal ... | Hard | 2K | 10.4K | 2,035 | 10,445 | 19.5% | ['rectangle-area-ii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n double separateSquares(vector<vector<int>>& squares) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public double separateSquares(int[][] squares) {\n \n }\n}"}, {"value": "python... | [[0,0,1],[2,2,1]] | {
"name": "separateSquares",
"params": [
{
"name": "squares",
"type": "integer[][]"
}
],
"return": {
"type": "double"
}
} | {"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', 'Segment Tree', 'Line Sweep'] |
3,455 | Shortest Matching Substring | shortest-matching-substring | <p>You are given a string <code>s</code> and a pattern string <code>p</code>, where <code>p</code> contains <strong>exactly two</strong> <code>'*'</code> characters.</p>
<p>The <code>'*'</code> in <code>p</code> matches any sequence of zero or more characters.</p>
<p>Return the length of the <strong>s... | Hard | 5K | 20.5K | 5,018 | 20,485 | 24.5% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int shortestMatchingSubstring(string s, string p) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int shortestMatchingSubstring(String s, String p) {\n \n }\n}"}, {"value": ... | "abaacbaecebce"
"ba*c*ce" | {
"name": "shortestMatchingSubstring",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "string",
"name": "p"
}
],
"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... | ['Two Pointers', 'String', 'Binary Search', 'String Matching'] |
3,456 | Find Special Substring of Length K | find-special-substring-of-length-k | <p>You are given a string <code>s</code> and an integer <code>k</code>.</p>
<p>Determine if there exists a <span data-keyword="substring-nonempty">substring</span> of length <strong>exactly</strong> <code>k</code> in <code>s</code> that satisfies the following conditions:</p>
<ol>
<li>The substring consists of <stro... | Easy | 36.1K | 102.1K | 36,055 | 102,077 | 35.3% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool hasSpecialSubstring(string s, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean hasSpecialSubstring(String s, int k) {\n \n }\n}"}, {"value": "python", "te... | "aaabaaa"
3 | {
"name": "hasSpecialSubstring",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer",
"name": "k"
}
],
"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'] |
3,457 | Eat Pizzas! | eat-pizzas | <p>You are given an integer array <code>pizzas</code> of size <code>n</code>, where <code>pizzas[i]</code> represents the weight of the <code>i<sup>th</sup></code> pizza. Every day, you eat <strong>exactly</strong> 4 pizzas. Due to your incredible metabolism, when you eat pizzas of weights <code>W</code>, <code>X</code... | Medium | 20.9K | 63.9K | 20,878 | 63,939 | 32.7% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long maxWeight(vector<int>& pizzas) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long maxWeight(int[] pizzas) {\n \n }\n}"}, {"value": "python", "text": "Python", "d... | [1,2,3,4,5,6,7,8] | {
"name": "maxWeight",
"params": [
{
"name": "pizzas",
"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', 'Greedy', 'Sorting'] |
3,458 | Select K Disjoint Special Substrings | select-k-disjoint-special-substrings | <p>Given a string <code>s</code> of length <code>n</code> and an integer <code>k</code>, determine whether it is possible to select <code>k</code> disjoint <strong>special substrings</strong>.</p>
<p>A <strong>special substring</strong> is a <span data-keyword="substring-nonempty">substring</span> where:</p>
<ul>
<l... | Medium | 8.8K | 49.3K | 8,792 | 49,252 | 17.9% | ['find-longest-self-contained-substring'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool maxSubstringLength(string s, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean maxSubstringLength(String s, int k) {\n \n }\n}"}, {"value": "python", "text... | "abcdbaefab"
2 | {
"name": "maxSubstringLength",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer",
"name": "k"
}
],
"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', 'Dynamic Programming', 'Greedy', 'Sorting'] |
3,459 | Length of Longest V-Shaped Diagonal Segment | length-of-longest-v-shaped-diagonal-segment | <p>You are given a 2D integer matrix <code>grid</code> of size <code>n x m</code>, where each element is either <code>0</code>, <code>1</code>, or <code>2</code>.</p>
<p>A <strong>V-shaped diagonal segment</strong> is defined as:</p>
<ul>
<li>The segment starts with <code>1</code>.</li>
<li>The subsequent elements ... | Hard | 4.7K | 11.8K | 4,724 | 11,842 | 39.9% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int lenOfVDiagonal(vector<vector<int>>& grid) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int lenOfVDiagonal(int[][] grid) {\n \n }\n}"}, {"value": "python", "text": "Py... | [[2,2,1,2,2],[2,0,2,2,0],[2,0,1,1,0],[1,0,2,2,2],[2,0,0,2,2]] | {
"name": "lenOfVDiagonal",
"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', 'Memoization', 'Matrix'] |
3,460 | Longest Common Prefix After at Most One Removal | longest-common-prefix-after-at-most-one-removal | null | Medium | 600 | 872 | 600 | 872 | 68.8% | ['longest-common-prefix'] | [] | Algorithms | null | "madxa"
"madam" | {
"name": "longestCommonPrefix",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "string",
"name": "t"
}
],
"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... | ['Two Pointers', 'String'] |
3,461 | Check If Digits Are Equal in String After Operations I | check-if-digits-are-equal-in-string-after-operations-i | <p>You are given a string <code>s</code> consisting of digits. Perform the following operation repeatedly until the string has <strong>exactly</strong> two digits:</p>
<ul>
<li>For each pair of consecutive digits in <code>s</code>, starting from the first digit, calculate a new digit as the sum of the two digits <str... | Easy | 44.1K | 55K | 44,062 | 55,017 | 80.1% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool hasSameDigits(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean hasSameDigits(String s) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCod... | "3902" | {
"name": "hasSameDigits",
"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... | ['Math', 'String', 'Simulation', 'Combinatorics', 'Number Theory'] |
3,462 | Maximum Sum With at Most K Elements | maximum-sum-with-at-most-k-elements | <p data-pm-slice="1 3 []">You are given a 2D integer matrix <code>grid</code> of size <code>n x m</code>, an integer array <code>limits</code> of length <code>n</code>, and an integer <code>k</code>. The task is to find the <strong>maximum sum</strong> of <strong>at most</strong> <code>k</code> elements from the matrix... | Medium | 33.5K | 55.5K | 33,472 | 55,489 | 60.3% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long maxSum(vector<vector<int>>& grid, vector<int>& limits, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long maxSum(int[][] grid, int[] limits, int k) {\n \n ... | [[1,2],[3,4]]
[1,2]
2 | {
"name": "maxSum",
"params": [
{
"name": "grid",
"type": "integer[][]"
},
{
"type": "integer[]",
"name": "limits"
},
{
"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', 'Heap (Priority Queue)', 'Matrix'] |
3,463 | Check If Digits Are Equal in String After Operations II | check-if-digits-are-equal-in-string-after-operations-ii | <p>You are given a string <code>s</code> consisting of digits. Perform the following operation repeatedly until the string has <strong>exactly</strong> two digits:</p>
<ul>
<li>For each pair of consecutive digits in <code>s</code>, starting from the first digit, calculate a new digit as the sum of the two digits <str... | Hard | 6.5K | 65.3K | 6,482 | 65,287 | 9.9% | ['pascals-triangle'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n bool hasSameDigits(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public boolean hasSameDigits(String s) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCod... | "3902" | {
"name": "hasSameDigits",
"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... | ['Math', 'String', 'Combinatorics', 'Number Theory'] |
3,464 | Maximize the Distance Between Points on a Square | maximize-the-distance-between-points-on-a-square | <p>You are given an integer <code><font face="monospace">side</font></code>, representing the edge length of a square with corners at <code>(0, 0)</code>, <code>(0, side)</code>, <code>(side, 0)</code>, and <code>(side, side)</code> on a Cartesian plane.</p>
<p>You are also given a <strong>positive</strong> integer <c... | Hard | 2.5K | 13.4K | 2,505 | 13,387 | 18.7% | ['maximum-number-of-integers-to-choose-from-a-range-ii', 'maximum-points-inside-the-square'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxDistance(int side, vector<vector<int>>& points, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxDistance(int side, int[][] points, int k) {\n \n }\n}"},... | 2
[[0,2],[2,0],[2,2],[0,0]]
4 | {
"name": "maxDistance",
"params": [
{
"name": "side",
"type": "integer"
},
{
"type": "integer[][]",
"name": "points"
},
{
"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', 'Binary Search', 'Greedy'] |
3,465 | Find Products with Valid Serial Numbers | find-products-with-valid-serial-numbers | <p>Table: <code>products</code></p>
<pre>
+--------------+------------+
| Column Name | Type |
+--------------+------------+
| product_id | int |
| product_name | varchar |
| description | varchar |
+--------------+------------+
(product_id) is the unique key for this table.
Each row in the tabl... | Easy | 4.1K | 4.9K | 4,124 | 4,888 | 84.4% | [] | ['CREATE TABLE If not exists products (\n product_id INT,\n product_name VARCHAR(255),\n description VARCHAR(255)\n)\n', 'Truncate table products', "insert into products (product_id, product_name, description) values ('1', 'Widget A', 'This is a sample product with SN1234-5678')", "insert into products (produc... | Database | [{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"v... | {"headers":{"products":["product_id","product_name","description"]},"rows":{"products":[[1,"Widget A","This is a sample product with SN1234-5678"],[2,"Widget B","A product with serial SN9876-1234 in the description"],[3,"Widget C","Product SN1234-56789 is available now"],[4,"Widget D","No serial number here"],[5,"Widge... | {"mysql": ["CREATE TABLE If not exists products (\n product_id INT,\n product_name VARCHAR(255),\n description VARCHAR(255)\n)\n"], "mssql": ["CREATE TABLE products (\n product_id INT,\n product_name VARCHAR(255),\n description VARCHAR(255)\n)"], "oraclesql": ["CREATE TABLE products (\n product_id ... | {"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'] |
3,466 | Maximum Coin Collection | maximum-coin-collection | null | Medium | 1.4K | 2.6K | 1,404 | 2,606 | 53.9% | [] | [] | Algorithms | null | [1,-2,-10,3]
[-5,10,0,1] | {
"name": "maxCoins",
"params": [
{
"name": "lane1",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "lane2"
}
],
"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'] |
3,467 | Transform Array by Parity | transform-array-by-parity | <p>You are given an integer array <code>nums</code>. Transform <code>nums</code> by performing the following operations in the <strong>exact</strong> order specified:</p>
<ol>
<li>Replace each even number with 0.</li>
<li>Replace each odd numbers with 1.</li>
<li>Sort the modified array in <strong>non-decreasing</s... | Easy | 43.2K | 48.5K | 43,184 | 48,488 | 89.1% | ['odd-even-linked-list'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> transformArray(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] transformArray(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Py... | [4,3,2,1] | {
"name": "transformArray",
"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', 'Sorting', 'Counting'] |
3,468 | Find the Number of Copy Arrays | find-the-number-of-copy-arrays | <p>You are given an array <code>original</code> of length <code>n</code> and a 2D array <code>bounds</code> of length <code>n x 2</code>, where <code>bounds[i] = [u<sub>i</sub>, v<sub>i</sub>]</code>.</p>
<p>You need to find the number of <strong>possible</strong> arrays <code>copy</code> of length <code>n</code> such... | Medium | 18.7K | 41K | 18,671 | 41,015 | 45.5% | ['count-of-range-sum'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int countArrays(vector<int>& original, vector<vector<int>>& bounds) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int countArrays(int[] original, int[][] bounds) {\n \n }\... | [1,2,3,4]
[[1,2],[2,3],[3,4],[4,5]] | {
"name": "countArrays",
"params": [
{
"name": "original",
"type": "integer[]"
},
{
"type": "integer[][]",
"name": "bounds"
}
],
"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'] |
3,469 | Find Minimum Cost to Remove Array Elements | find-minimum-cost-to-remove-array-elements | <p>You are given an integer array <code>nums</code>. Your task is to remove <strong>all elements</strong> from the array by performing one of the following operations at each step until <code>nums</code> is empty:</p>
<ul>
<li>Choose any two elements from the first three elements of <code>nums</code> and remove them.... | Medium | 8.3K | 47.4K | 8,320 | 47,392 | 17.6% | ['minimum-difference-in-sums-after-removal-of-elements'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minCost(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minCost(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCode": "c... | [6,2,8,4] | {
"name": "minCost",
"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', 'Dynamic Programming'] |
3,470 | Permutations IV | permutations-iv | <p>Given two integers, <code>n</code> and <code>k</code>, an <strong>alternating permutation</strong> is a permutation of the first <code>n</code> positive integers such that no <strong>two</strong> adjacent elements are both odd or both even.</p>
<p>Return the <strong>k-th</strong> <strong>alternating permutation</st... | Hard | 2.3K | 8.7K | 2,314 | 8,735 | 26.5% | ['permutations-iii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> permute(int n, long long k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] permute(int n, long k) {\n \n }\n}"}, {"value": "python", "text": "Python", "de... | 4
6 | {
"name": "permute",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "long",
"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', 'Math', 'Combinatorics', 'Enumeration'] |
3,471 | Find the Largest Almost Missing Integer | find-the-largest-almost-missing-integer | <p>You are given an integer array <code>nums</code> and an integer <code>k</code>.</p>
<p>An integer <code>x</code> is <strong>almost missing</strong> from <code>nums</code> if <code>x</code> appears in <em>exactly</em> one subarray of size <code>k</code> within <code>nums</code>.</p>
<p>Return the <b>largest</b> <st... | Easy | 30K | 82.2K | 30,008 | 82,249 | 36.5% | ['missing-number'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int largestInteger(vector<int>& nums, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int largestInteger(int[] nums, int k) {\n \n }\n}"}, {"value": "python", "text":... | [3,9,2,1,7]
3 | {
"name": "largestInteger",
"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'] |
3,472 | Longest Palindromic Subsequence After at Most K Operations | longest-palindromic-subsequence-after-at-most-k-operations | <p>You are given a string <code>s</code> and an integer <code>k</code>.</p>
<p>In one operation, you can replace the character at any position with the next or previous letter in the alphabet (wrapping around so that <code>'a'</code> is after <code>'z'</code>). For example, replacing <code>'a'<... | Medium | 12.5K | 35.1K | 12,543 | 35,063 | 35.8% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int longestPalindromicSubsequence(string s, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int longestPalindromicSubsequence(String s, int k) {\n \n }\n}"}, {"value"... | "abced"
2 | {
"name": "longestPalindromicSubsequence",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['String', 'Dynamic Programming'] |
3,473 | Sum of K Subarrays With Length at Least M | sum-of-k-subarrays-with-length-at-least-m | <p>You are given an integer array <code>nums</code> and two integers, <code>k</code> and <code>m</code>.</p>
<p>Return the <strong>maximum</strong> sum of <code>k</code> non-overlapping <span data-keyword="subarray">subarrays</span> of <code>nums</code>, where each subarray has a length of <strong>at least</strong> <c... | Medium | 6.1K | 25.1K | 6,099 | 25,063 | 24.3% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxSum(vector<int>& nums, int k, int m) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxSum(int[] nums, int k, int m) {\n \n }\n}"}, {"value": "python", "text": "... | [1,2,-1,3,3,4]
2
2 | {
"name": "maxSum",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer",
"name": "k"
},
{
"type": "integer",
"name": "m"
}
],
"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', 'Prefix Sum'] |
3,474 | Lexicographically Smallest Generated String | lexicographically-smallest-generated-string | <p>You are given two strings, <code>str1</code> and <code>str2</code>, of lengths <code>n</code> and <code>m</code>, respectively.</p>
<p>A string <code>word</code> of length <code>n + m - 1</code> is defined to be <strong>generated</strong> by <code>str1</code> and <code>str2</code> if it satisfies the following cond... | Hard | 2.9K | 10.2K | 2,938 | 10,212 | 28.8% | ['lexicographically-smallest-equivalent-string'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n string generateString(string str1, string str2) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public String generateString(String str1, String str2) {\n \n }\n}"}, {"value": "pyt... | "TFTF"
"ab" | {
"name": "generateString",
"params": [
{
"name": "str1",
"type": "string"
},
{
"type": "string",
"name": "str2"
}
],
"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', 'Greedy', 'String Matching'] |
3,475 | DNA Pattern Recognition | dna-pattern-recognition | <p>Table: <code>Samples</code></p>
<pre>
+----------------+---------+
| Column Name | Type |
+----------------+---------+
| sample_id | int |
| dna_sequence | varchar |
| species | varchar |
+----------------+---------+
sample_id is the unique key for this table.
Each row contains a DNA sequen... | Medium | 3.1K | 3.5K | 3,068 | 3,505 | 87.5% | [] | ['CREATE TABLE if not exists Samples (\n sample_id INT,\n dna_sequence VARCHAR(255),\n species VARCHAR(100)\n)', 'Truncate table Samples', "insert into Samples (sample_id, dna_sequence, species) values ('1', 'ATGCTAGCTAGCTAA', 'Human')", "insert into Samples (sample_id, dna_sequence, species) values ('2', 'GGG... | Database | [{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"v... | {"headers":{"Samples":["sample_id","dna_sequence","species"]},"rows":{"Samples":[[1,"ATGCTAGCTAGCTAA","Human"],[2,"GGGTCAATCATC","Human"],[3,"ATATATCGTAGCTA","Human"],[4,"ATGGGGTCATCATAA","Mouse"],[5,"TCAGTCAGTCAG","Mouse"],[6,"ATATCGCGCTAG","Zebrafish"],[7,"CGTATGCGTCGTA","Zebrafish"]]}} | {"mysql": ["CREATE TABLE if not exists Samples (\n sample_id INT,\n dna_sequence VARCHAR(255),\n species VARCHAR(100)\n)"], "mssql": ["CREATE TABLE Samples (\n sample_id INT,\n dna_sequence VARCHAR(255),\n species VARCHAR(100)\n)"], "oraclesql": ["CREATE TABLE Samples (\n sample_id NUMBER,\n dna... | {"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'] |
3,476 | Maximize Profit from Task Assignment | maximize-profit-from-task-assignment | null | Medium | 424 | 671 | 424 | 671 | 63.2% | [] | [] | Algorithms | null | [1,2,3,4,5]
[[1,100],[2,400],[3,100],[3,400]] | {
"name": "maxProfit",
"params": [
{
"name": "workers",
"type": "integer[]"
},
{
"type": "integer[][]",
"name": "tasks"
}
],
"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', 'Heap (Priority Queue)'] |
3,477 | Fruits Into Baskets II | fruits-into-baskets-ii | <p>You are given two arrays of integers, <code>fruits</code> and <code>baskets</code>, each of length <code>n</code>, where <code>fruits[i]</code> represents the <strong>quantity</strong> of the <code>i<sup>th</sup></code> type of fruit, and <code>baskets[j]</code> represents the <strong>capacity</strong> of the <code>... | Easy | 33.8K | 65.9K | 33,831 | 65,918 | 51.3% | ['fruit-into-baskets'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int numOfUnplacedFruits(vector<int>& fruits, vector<int>& baskets) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int numOfUnplacedFruits(int[] fruits, int[] baskets) {\n \n ... | [4,2,5]
[3,5,4] | {
"name": "numOfUnplacedFruits",
"params": [
{
"name": "fruits",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "baskets"
}
],
"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', 'Segment Tree', 'Simulation'] |
3,478 | Choose K Elements With Maximum Sum | choose-k-elements-with-maximum-sum | <p>You are given two integer arrays, <code>nums1</code> and <code>nums2</code>, both of length <code>n</code>, along with a positive integer <code>k</code>.</p>
<p>For each index <code>i</code> from <code>0</code> to <code>n - 1</code>, perform the following:</p>
<ul>
<li>Find <strong>all</strong> indices <code>j</c... | Medium | 15.5K | 50.7K | 15,530 | 50,672 | 30.6% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<long long> findMaxSum(vector<int>& nums1, vector<int>& nums2, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long[] findMaxSum(int[] nums1, int[] nums2, int k) {\n ... | [4,2,1,5,3]
[10,20,30,40,50]
2 | {
"name": "findMaxSum",
"params": [
{
"name": "nums1",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "nums2"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "long[]"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Sorting', 'Heap (Priority Queue)'] |
3,479 | Fruits Into Baskets III | fruits-into-baskets-iii | <p>You are given two arrays of integers, <code>fruits</code> and <code>baskets</code>, each of length <code>n</code>, where <code>fruits[i]</code> represents the <strong>quantity</strong> of the <code>i<sup>th</sup></code> type of fruit, and <code>baskets[j]</code> represents the <strong>capacity</strong> of the <code>... | Medium | 6.9K | 32.8K | 6,926 | 32,779 | 21.1% | ['block-placement-queries'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int numOfUnplacedFruits(vector<int>& fruits, vector<int>& baskets) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int numOfUnplacedFruits(int[] fruits, int[] baskets) {\n \n ... | [4,2,5]
[3,5,4] | {
"name": "numOfUnplacedFruits",
"params": [
{
"name": "fruits",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "baskets"
}
],
"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', 'Segment Tree', 'Ordered Set'] |
3,480 | Maximize Subarrays After Removing One Conflicting Pair | maximize-subarrays-after-removing-one-conflicting-pair | <p>You are given an integer <code>n</code> which represents an array <code>nums</code> containing the numbers from 1 to <code>n</code> in order. Additionally, you are given a 2D array <code>conflictingPairs</code>, where <code>conflictingPairs[i] = [a, b]</code> indicates that <code>a</code> and <code>b</code> form a c... | Hard | 2.2K | 7K | 2,226 | 7,033 | 31.7% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long maxSubarrays(int n, vector<vector<int>>& conflictingPairs) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long maxSubarrays(int n, int[][] conflictingPairs) {\n \n ... | 4
[[2,3],[1,4]] | {
"name": "maxSubarrays",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer[][]",
"name": "conflictingPairs"
}
],
"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', 'Segment Tree', 'Enumeration', 'Prefix Sum'] |
3,481 | Apply Substitutions | apply-substitutions | null | Medium | 2.6K | 3.4K | 2,594 | 3,359 | 77.2% | ['evaluate-the-bracket-pairs-of-a-string'] | [] | Algorithms | null | [["A","abc"],["B","def"]]
"%A%_%B%" | {
"name": "applySubstitutions",
"params": [
{
"name": "replacements",
"type": "list<list<string>>"
},
{
"type": "string",
"name": "text"
}
],
"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', 'Depth-First Search', 'Breadth-First Search', 'Graph', 'Topological Sort'] |
3,482 | Analyze Organization Hierarchy | analyze-organization-hierarchy | <p>Table: <code>Employees</code></p>
<pre>
+----------------+---------+
| Column Name | Type |
+----------------+---------+
| employee_id | int |
| employee_name | varchar |
| manager_id | int |
| salary | int |
| department | varchar |
+----------------+----------+
employee_id i... | Hard | 1.1K | 1.8K | 1,068 | 1,778 | 60.1% | [] | ['CREATE TABLE if not exists Employees (\n employee_id INT,\n employee_name VARCHAR(100),\n manager_id INT,\n salary INT,\n department VARCHAR(50)\n)', 'Truncate table Employees', "insert into Employees (employee_id, employee_name, manager_id, salary, department) values ('1', 'Alice', NULL, '12000', 'Exe... | Database | [{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"v... | {"headers":{"Employees":["employee_id","employee_name","manager_id","salary","department"]},"rows":{"Employees":[[1,"Alice",null,12000,"Executive"],[2,"Bob",1,10000,"Sales"],[3,"Charlie",1,10000,"Engineering"],[4,"David",2,7500,"Sales"],[5,"Eva",2,7500,"Sales"],[6,"Frank",3,9000,"Engineering"],[7,"Grace",3,8500,"Engine... | {"mysql": ["CREATE TABLE if not exists Employees (\n employee_id INT,\n employee_name VARCHAR(100),\n manager_id INT,\n salary INT,\n department VARCHAR(50)\n)"], "mssql": ["CREATE TABLE Employees (\n employee_id INT,\n employee_name VARCHAR(100),\n manager_id INT,\n salary INT,\n departme... | {"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'] |
3,483 | Unique 3-Digit Even Numbers | unique-3-digit-even-numbers | <p>You are given an array of digits called <code>digits</code>. Your task is to determine the number of <strong>distinct</strong> three-digit even numbers that can be formed using these digits.</p>
<p><strong>Note</strong>: Each <em>copy</em> of a digit can only be used <strong>once per number</strong>, and there may ... | Easy | 27K | 41.1K | 27,006 | 41,078 | 65.7% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int totalNumbers(vector<int>& digits) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int totalNumbers(int[] digits) {\n \n }\n}"}, {"value": "python", "text": "Python", "de... | [1,2,3,4] | {
"name": "totalNumbers",
"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', 'Recursion', 'Enumeration'] |
3,484 | Design Spreadsheet | design-spreadsheet | <p>A spreadsheet is a grid with 26 columns (labeled from <code>'A'</code> to <code>'Z'</code>) and a given number of <code>rows</code>. Each cell in the spreadsheet can hold an integer value between 0 and 10<sup>5</sup>.</p>
<p>Implement the <code>Spreadsheet</code> class:</p>
<ul>
<li><code>Spreadsh... | Medium | 18.5K | 27.3K | 18,540 | 27,274 | 68.0% | ['excel-sheet-column-title'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Spreadsheet {\npublic:\n Spreadsheet(int rows) {\n \n }\n \n void setCell(string cell, int value) {\n \n }\n \n void resetCell(string cell) {\n \n }\n \n int getValue(string formula) {\n \n }\n};\n\n/**\n... | ["Spreadsheet","getValue","setCell","getValue","setCell","getValue","resetCell","getValue"]
[[3],["=5+7"],["A1",10],["=A1+6"],["B2",15],["=A1+B2"],["A1"],["=A1+B2"]] | {
"classname": "Spreadsheet",
"constructor": {
"params": [
{
"type": "integer",
"name": "rows"
}
]
},
"methods": [
{
"params": [
{
"type": "string",
"name": "cell"
},
{
"type": "integer",
"name": "value... | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'String', 'Design', 'Matrix'] |
3,485 | Longest Common Prefix of K Strings After Removal | longest-common-prefix-of-k-strings-after-removal | <p>You are given an array of strings <code>words</code> and an integer <code>k</code>.</p>
<p>For each index <code>i</code> in the range <code>[0, words.length - 1]</code>, find the <strong>length</strong> of the <strong>longest common <span data-keyword="string-prefix">prefix</span></strong> among any <code>k</code> ... | Hard | 4.3K | 22.1K | 4,319 | 22,106 | 19.5% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> longestCommonPrefix(vector<string>& words, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] longestCommonPrefix(String[] words, int k) {\n \n }\n}"},... | ["jump","run","run","jump","run"]
2 | {
"name": "longestCommonPrefix",
"params": [
{
"name": "words",
"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', 'String', 'Trie'] |
3,486 | Longest Special Path II | longest-special-path-ii | <p>You are given an undirected tree rooted at node <code>0</code>, with <code>n</code> nodes numbered from <code>0</code> to <code>n - 1</code>. This is represented by a 2D array <code>edges</code> of length <code>n - 1</code>, where <code>edges[i] = [u<sub>i</sub>, v<sub>i</sub>, length<sub>i</sub>]</code> indicates a... | Hard | 1.2K | 8K | 1,248 | 8,017 | 15.6% | ['longest-special-path'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> longestSpecialPath(vector<vector<int>>& edges, vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] longestSpecialPath(int[][] edges, int[] nums) {\n ... | [[0,1,1],[1,2,3],[1,3,1],[2,4,6],[4,7,2],[3,5,2],[3,6,5],[6,8,3]]
[1,1,0,3,1,2,1,1,0] | {
"name": "longestSpecialPath",
"params": [
{
"name": "edges",
"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... | ['Array', 'Hash Table', 'Tree', 'Depth-First Search', 'Prefix Sum'] |
3,487 | Maximum Unique Subarray Sum After Deletion | maximum-unique-subarray-sum-after-deletion | <p>You are given an integer array <code>nums</code>.</p>
<p>You are allowed to delete any number of elements from <code>nums</code> without making it <strong>empty</strong>. After performing the deletions, select a <span data-keyword="subarray-nonempty">subarray</span> of <code>nums</code> such that:</p>
<ol>
<li>Al... | Easy | 28.6K | 106.4K | 28,579 | 106,439 | 26.9% | ['maximum-subarray-sum-with-one-deletion'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxSum(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxSum(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCode": "cla... | [1,2,3,4,5] | {
"name": "maxSum",
"params": [
{
"name": "nums",
"type": "integer[]"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Greedy'] |
3,488 | Closest Equal Element Queries | closest-equal-element-queries | <p>You are given a <strong>circular</strong> array <code>nums</code> and an array <code>queries</code>.</p>
<p>For each query <code>i</code>, you have to find the following:</p>
<ul>
<li>The <strong>minimum</strong> distance between the element at index <code>queries[i]</code> and <strong>any</strong> other index <c... | Medium | 16.7K | 54.7K | 16,677 | 54,725 | 30.5% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> solveQueries(vector<int>& nums, vector<int>& queries) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public List<Integer> solveQueries(int[] nums, int[] queries) {\n \n ... | [1,3,1,4,1,3,2]
[0,3,5] | {
"name": "solveQueries",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "queries"
}
],
"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', 'Binary Search'] |
3,489 | Zero Array Transformation IV | zero-array-transformation-iv | <p>You are given an integer array <code>nums</code> of length <code>n</code> and a 2D array <code>queries</code>, where <code>queries[i] = [l<sub>i</sub>, r<sub>i</sub>, val<sub>i</sub>]</code>.</p>
<p>Each <code>queries[i]</code> represents the following action on <code>nums</code>:</p>
<ul>
<li>Select a <span data... | Medium | 8K | 27.8K | 8,027 | 27,757 | 28.9% | ['zero-array-transformation-i', 'zero-array-transformation-ii', 'zero-array-transformation-iii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minZeroArray(vector<int>& nums, vector<vector<int>>& queries) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minZeroArray(int[] nums, int[][] queries) {\n \n }\n}"}... | [2,0,2]
[[0,2,1],[0,2,1],[1,1,3]] | {
"name": "minZeroArray",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer[][]",
"name": "queries"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Dynamic Programming'] |
3,490 | Count Beautiful Numbers | count-beautiful-numbers | <p data-end="387" data-start="189">You are given two positive integers, <code><font face="monospace">l</font></code> and <code><font face="monospace">r</font></code>. A positive integer is called <strong data-end="276" data-start="263">beautiful</strong> if the product of its digits is divisible by the sum of its digit... | Hard | 3.5K | 17.1K | 3,458 | 17,079 | 20.2% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int beautifulNumbers(int l, int r) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int beautifulNumbers(int l, int r) {\n \n }\n}"}, {"value": "python", "text": "Python", "d... | 10
20 | {
"name": "beautifulNumbers",
"params": [
{
"name": "l",
"type": "integer"
},
{
"type": "integer",
"name": "r"
}
],
"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'] |
3,491 | Phone Number Prefix | phone-number-prefix | null | Easy | 716 | 952 | 716 | 952 | 75.2% | [] | [] | Algorithms | null | ["1","2","4","3"] | {
"name": "phonePrefix",
"params": [
{
"name": "numbers",
"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... | ['Array', 'String', 'Trie', 'Sorting'] |
3,492 | Maximum Containers on a Ship | maximum-containers-on-a-ship | <p>You are given a positive integer <code>n</code> representing an <code>n x n</code> cargo deck on a ship. Each cell on the deck can hold one container with a weight of <strong>exactly</strong> <code>w</code>.</p>
<p>However, the total weight of all containers, if loaded onto the deck, must not exceed the ship's ... | Easy | 38.9K | 52.3K | 38,873 | 52,313 | 74.3% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxContainers(int n, int w, int maxWeight) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxContainers(int n, int w, int maxWeight) {\n \n }\n}"}, {"value": "pytho... | 2
3
15 | {
"name": "maxContainers",
"params": [
{
"name": "n",
"type": "integer"
},
{
"type": "integer",
"name": "w"
},
{
"type": "integer",
"name": "maxWeight"
}
],
"return": {
"type": "integer"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Math'] |
3,493 | Properties Graph | properties-graph | <p>You are given a 2D integer array <code>properties</code> having dimensions <code>n x m</code> and an integer <code>k</code>.</p>
<p>Define a function <code>intersect(a, b)</code> that returns the <strong>number of distinct integers</strong> common to both arrays <code>a</code> and <code>b</code>.</p>
<p>Construct ... | Medium | 19.3K | 41.7K | 19,346 | 41,745 | 46.3% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int numberOfComponents(vector<vector<int>>& properties, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int numberOfComponents(int[][] properties, int k) {\n \n }\n}"... | [[1,2],[1,1],[3,4],[4,5],[5,6],[7,7]]
1 | {
"name": "numberOfComponents",
"params": [
{
"name": "properties",
"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', 'Depth-First Search', 'Breadth-First Search', 'Union Find', 'Graph'] |
3,494 | Find the Minimum Amount of Time to Brew Potions | find-the-minimum-amount-of-time-to-brew-potions | <p>You are given two integer arrays, <code>skill</code> and <code><font face="monospace">mana</font></code>, of length <code>n</code> and <code>m</code>, respectively.</p>
<p>In a laboratory, <code>n</code> wizards must brew <code>m</code> potions <em>in order</em>. Each potion has a mana capacity <code>mana[j]</code>... | Medium | 9.1K | 27.6K | 9,124 | 27,637 | 33.0% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long minTime(vector<int>& skill, vector<int>& mana) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long minTime(int[] skill, int[] mana) {\n \n }\n}"}, {"value": "pyth... | [1,5,2,4]
[5,1,4,2] | {
"name": "minTime",
"params": [
{
"name": "skill",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "mana"
}
],
"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', 'Simulation', 'Prefix Sum'] |
3,495 | Minimum Operations to Make Array Elements Zero | minimum-operations-to-make-array-elements-zero | <p>You are given a 2D array <code>queries</code>, where <code>queries[i]</code> is of the form <code>[l, r]</code>. Each <code>queries[i]</code> defines an array of integers <code>nums</code> consisting of elements ranging from <code>l</code> to <code>r</code>, both <strong>inclusive</strong>.</p>
<p>In one operation,... | Hard | 5.1K | 16.8K | 5,116 | 16,821 | 30.4% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long minOperations(vector<vector<int>>& queries) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long minOperations(int[][] queries) {\n \n }\n}"}, {"value": "python", ... | [[1,2],[2,4]] | {
"name": "minOperations",
"params": [
{
"name": "queries",
"type": "integer[][]"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Math', 'Bit Manipulation'] |
3,496 | Maximize Score After Pair Deletions | maximize-score-after-pair-deletions | null | Medium | 324 | 517 | 324 | 517 | 62.7% | [] | [] | Algorithms | null | [2,4,1] | {
"name": "maxScore",
"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'] |
3,497 | Analyze Subscription Conversion | analyze-subscription-conversion | <p>Table: <code>UserActivity</code></p>
<pre>
+------------------+---------+
| Column Name | Type |
+------------------+---------+
| user_id | int |
| activity_date | date |
| activity_type | varchar |
| activity_duration| int |
+------------------+---------+
(user_id, activity_date,... | Medium | 1.8K | 2.2K | 1,831 | 2,244 | 81.6% | [] | ['CREATE TABLE if not exists UserActivity (\n user_id INT,\n activity_date DATE,\n activity_type VARCHAR(20),\n activity_duration INT\n)', 'Truncate table UserActivity', "insert into UserActivity (user_id, activity_date, activity_type, activity_duration) values ('1', '2023-01-01', 'free_trial', '45')", "ins... | Database | [{"value": "mysql", "text": "MySQL", "defaultCode": "# Write your MySQL query statement below\n"}, {"value": "mssql", "text": "MS SQL Server", "defaultCode": "/* Write your T-SQL query statement below */\n"}, {"value": "oraclesql", "text": "Oracle", "defaultCode": "/* Write your PL/SQL query statement below */\n"}, {"v... | {"headers":{"UserActivity":["user_id","activity_date","activity_type","activity_duration"]},"rows":{"UserActivity":[[1,"2023-01-01","free_trial",45],[1,"2023-01-02","free_trial",30],[1,"2023-01-05","free_trial",60],[1,"2023-01-10","paid",75],[1,"2023-01-12","paid",90],[1,"2023-01-15","paid",65],[2,"2023-02-01","free_tr... | {"mysql": ["CREATE TABLE if not exists UserActivity (\n user_id INT,\n activity_date DATE,\n activity_type VARCHAR(20),\n activity_duration INT\n)"], "mssql": ["CREATE TABLE UserActivity (\n user_id INT,\n activity_date DATE,\n activity_type VARCHAR(20),\n activity_duration INT\n)"], "oraclesql"... | {"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'] |
3,498 | Reverse Degree of a String | reverse-degree-of-a-string | <p>Given a string <code>s</code>, calculate its <strong>reverse degree</strong>.</p>
<p>The <strong>reverse degree</strong> is calculated as follows:</p>
<ol>
<li>For each character, multiply its position in the <em>reversed</em> alphabet (<code>'a'</code> = 26, <code>'b'</code> = 25, ..., <code>'... | Easy | 33.2K | 37.4K | 33,165 | 37,359 | 88.8% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int reverseDegree(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int reverseDegree(String s) {\n \n }\n}"}, {"value": "python", "text": "Python", "defaultCode": "... | "abc" | {
"name": "reverseDegree",
"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', 'Simulation'] |
3,499 | Maximize Active Section with Trade I | maximize-active-section-with-trade-i | <p>You are given a binary string <code>s</code> of length <code>n</code>, where:</p>
<ul>
<li><code>'1'</code> represents an <strong>active</strong> section.</li>
<li><code>'0'</code> represents an <strong>inactive</strong> section.</li>
</ul>
<p>You can perform <strong>at most one trade</strong> to... | Medium | 11.5K | 38.3K | 11,493 | 38,342 | 30.0% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxActiveSectionsAfterTrade(string s) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxActiveSectionsAfterTrade(String s) {\n \n }\n}"}, {"value": "python", "text"... | "01" | {
"name": "maxActiveSectionsAfterTrade",
"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', 'Enumeration'] |
3,500 | Minimum Cost to Divide Array Into Subarrays | minimum-cost-to-divide-array-into-subarrays | <p>You are given two integer arrays, <code>nums</code> and <code>cost</code>, of the same size, and an integer <code>k</code>.</p>
<p>You can divide <code>nums</code> into <span data-keyword="subarray-nonempty">subarrays</span>. The cost of the <code>i<sup>th</sup></code> subarray consisting of elements <code>nums[l..... | Hard | 2.6K | 11.5K | 2,556 | 11,480 | 22.3% | ['minimum-cost-to-split-an-array'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long minimumCost(vector<int>& nums, vector<int>& cost, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long minimumCost(int[] nums, int[] cost, int k) {\n \n }\n... | [3,1,4]
[4,6,6]
1 | {
"name": "minimumCost",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer[]",
"name": "cost"
},
{
"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', 'Dynamic Programming', 'Prefix Sum'] |
3,501 | Maximize Active Section with Trade II | maximize-active-section-with-trade-ii | <p>You are given a binary string <code>s</code> of length <code>n</code>, where:</p>
<ul>
<li><code>'1'</code> represents an <strong>active</strong> section.</li>
<li><code>'0'</code> represents an <strong>inactive</strong> section.</li>
</ul>
<p>You can perform <strong>at most one trade</strong> to... | Hard | 786 | 4.1K | 786 | 4,087 | 19.2% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> maxActiveSectionsAfterTrade(string s, vector<vector<int>>& queries) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public List<Integer> maxActiveSectionsAfterTrade(String s, int... | "01"
[[0,1]] | {
"name": "maxActiveSectionsAfterTrade",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "integer[][]",
"name": "queries"
}
],
"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', 'String', 'Binary Search', 'Segment Tree'] |
3,502 | Minimum Cost to Reach Every Position | minimum-cost-to-reach-every-position | <p data-end="438" data-start="104">You are given an integer array <code data-end="119" data-start="113">cost</code> of size <code data-end="131" data-start="128">n</code>. You are currently at position <code data-end="166" data-start="163">n</code> (at the end of the line) in a line of <code data-end="187" data-start="... | Easy | 30.9K | 37K | 30,854 | 36,960 | 83.5% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n vector<int> minCosts(vector<int>& cost) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int[] minCosts(int[] cost) {\n \n }\n}"}, {"value": "python", "text": "Python", "defa... | [5,3,4,1,3,2] | {
"name": "minCosts",
"params": [
{
"name": "cost",
"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'] |
3,503 | Longest Palindrome After Substring Concatenation I | longest-palindrome-after-substring-concatenation-i | <p>You are given two strings, <code>s</code> and <code>t</code>.</p>
<p>You can create a new string by selecting a <span data-keyword="substring">substring</span> from <code>s</code> (possibly empty) and a substring from <code>t</code> (possibly empty), then concatenating them <strong>in order</strong>.</p>
<p>Return... | Medium | 18.4K | 42.6K | 18,444 | 42,644 | 43.3% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int longestPalindrome(string s, string t) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int longestPalindrome(String s, String t) {\n \n }\n}"}, {"value": "python", "text"... | "a"
"a" | {
"name": "longestPalindrome",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "string",
"name": "t"
}
],
"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... | ['Two Pointers', 'String', 'Dynamic Programming', 'Enumeration'] |
3,504 | Longest Palindrome After Substring Concatenation II | longest-palindrome-after-substring-concatenation-ii | <p>You are given two strings, <code>s</code> and <code>t</code>.</p>
<p>You can create a new string by selecting a <span data-keyword="substring">substring</span> from <code>s</code> (possibly empty) and a substring from <code>t</code> (possibly empty), then concatenating them <strong>in order</strong>.</p>
<p>Return... | Hard | 4.4K | 29.1K | 4,399 | 29,070 | 15.1% | ['edit-distance'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int longestPalindrome(string s, string t) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int longestPalindrome(String s, String t) {\n \n }\n}"}, {"value": "python", "text"... | "a"
"a" | {
"name": "longestPalindrome",
"params": [
{
"name": "s",
"type": "string"
},
{
"type": "string",
"name": "t"
}
],
"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... | ['Two Pointers', 'String', 'Dynamic Programming'] |
3,505 | Minimum Operations to Make Elements Within K Subarrays Equal | minimum-operations-to-make-elements-within-k-subarrays-equal | <p>You are given an integer array <code>nums</code> and two integers, <code>x</code> and <code>k</code>. You can perform the following operation any number of times (<strong>including zero</strong>):</p>
<ul>
<li>Increase or decrease any element of <code>nums</code> by 1.</li>
</ul>
<p>Return the <strong>minimum</st... | Hard | 2.7K | 9.9K | 2,738 | 9,925 | 27.6% | ['find-median-from-data-stream', 'minimum-moves-to-equal-array-elements-ii'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n long long minOperations(vector<int>& nums, int x, int k) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public long minOperations(int[] nums, int x, int k) {\n \n }\n}"}, {"value"... | [5,-2,1,3,7,3,6,4,-1]
3
2 | {
"name": "minOperations",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer",
"name": "x"
},
{
"type": "integer",
"name": "k"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Hash Table', 'Math', 'Dynamic Programming', 'Sliding Window', 'Heap (Priority Queue)'] |
3,506 | Find Time Required to Eliminate Bacterial Strains | find-time-required-to-eliminate-bacterial-strains | null | Hard | 171 | 293 | 171 | 293 | 58.4% | ['minimum-time-to-build-blocks'] | [] | Algorithms | null | [10,4,5]
2 | {
"name": "minEliminationTime",
"params": [
{
"name": "timeReq",
"type": "integer[]"
},
{
"type": "integer",
"name": "splitTime"
}
],
"return": {
"type": "long"
}
} | {"cpp": ["C++", "<p>Compiled with <code> clang 19 </code> using the latest C++ 23 standard, and <code>libstdc++</code> provided by GCC 14.</p>\r\n\r\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\"https://github.com/google/sanitizers/wiki/AddressSanitizer\" target=\"_blank\">AddressS... | ['Array', 'Math', 'Greedy', 'Heap (Priority Queue)'] |
3,507 | Minimum Pair Removal to Sort Array I | minimum-pair-removal-to-sort-array-i | <p>Given an array <code>nums</code>, you can perform the following operation any number of times:</p>
<ul>
<li>Select the <strong>adjacent</strong> pair with the <strong>minimum</strong> sum in <code>nums</code>. If multiple such pairs exist, choose the leftmost one.</li>
<li>Replace the pair with their sum.</li>
</... | Easy | 26.4K | 46.3K | 26,406 | 46,276 | 57.1% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int minimumPairRemoval(vector<int>& nums) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int minimumPairRemoval(int[] nums) {\n \n }\n}"}, {"value": "python", "text": "Pyth... | [5,2,3,1] | {
"name": "minimumPairRemoval",
"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', 'Linked List', 'Heap (Priority Queue)', 'Simulation', 'Doubly-Linked List', 'Ordered Set'] |
3,508 | Implement Router | implement-router | <p>Design a data structure that can efficiently manage data packets in a network router. Each data packet consists of the following attributes:</p>
<ul>
<li><code>source</code>: A unique identifier for the machine that generated the packet.</li>
<li><code>destination</code>: A unique identifier for the target machin... | Medium | 11.3K | 53.8K | 11,340 | 53,763 | 21.1% | [] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Router {\npublic:\n Router(int memoryLimit) {\n \n }\n \n bool addPacket(int source, int destination, int timestamp) {\n \n }\n \n vector<int> forwardPacket() {\n \n }\n \n int getCount(int destination, int startTi... | ["Router","addPacket","addPacket","addPacket","addPacket","addPacket","forwardPacket","addPacket","getCount"]
[[3],[1,4,90],[2,5,90],[1,4,90],[3,5,95],[4,5,105],[],[5,2,110],[5,100,110]] | {
"classname": "Router",
"constructor": {
"params": [
{
"name": "memoryLimit",
"type": "integer"
}
]
},
"methods": [
{
"params": [
{
"type": "integer",
"name": "source"
},
{
"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', 'Queue', 'Ordered Set'] |
3,509 | Maximum Product of Subsequences With an Alternating Sum Equal to K | maximum-product-of-subsequences-with-an-alternating-sum-equal-to-k | <p>You are given an integer array <code>nums</code> and two integers, <code>k</code> and <code>limit</code>. Your task is to find a non-empty <strong><span data-keyword="subsequence-array">subsequence</span></strong> of <code>nums</code> that:</p>
<ul>
<li>Has an <strong>alternating sum</strong> equal to <code>k</cod... | Hard | 2.9K | 29.6K | 2,924 | 29,646 | 9.9% | ['maximum-alternating-subsequence-sum'] | [] | Algorithms | [{"value": "cpp", "text": "C++", "defaultCode": "class Solution {\npublic:\n int maxProduct(vector<int>& nums, int k, int limit) {\n \n }\n};"}, {"value": "java", "text": "Java", "defaultCode": "class Solution {\n public int maxProduct(int[] nums, int k, int limit) {\n \n }\n}"}, {"value": "py... | [1,2,3]
2
10 | {
"name": "maxProduct",
"params": [
{
"name": "nums",
"type": "integer[]"
},
{
"type": "integer",
"name": "k"
},
{
"type": "integer",
"name": "limit"
}
],
"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', 'Dynamic Programming'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.