Dataset Viewer
Auto-converted to Parquet Duplicate
question_id
int64
1
3.58k
name
stringlengths
3
77
content
stringlengths
516
21.8k
acRate
float64
9.95
93
difficulty
stringclasses
3 values
topics
sequencelengths
1
10
runtimeDistribution
stringlengths
49
2.26k
memoryDistribution
stringlengths
88
2.23k
rt_list
listlengths
0
152
rt_solution_count
int64
0
152
mm_list
listlengths
0
153
mm_solution_count
int64
0
153
1,058
lexicographically-smallest-equivalent-string
<p>You are given two strings of the same length <code>s1</code> and <code>s2</code> and a string <code>baseStr</code>.</p> <p>We say <code>s1[i]</code> and <code>s2[i]</code> are equivalent characters.</p> <ul> <li>For example, if <code>s1 = &quot;abc&quot;</code> and <code>s2 = &quot;cde&quot;</code>, then we have ...
76.709554
Medium
[ "string", "union-find" ]
{"lang": "cpp", "distribution": [["0", 26.3784], ["1", 0.1081], ["2", 6.5946], ["3", 3.4595], ["4", 14.3784], ["5", 14.0541], ["6", 3.3514], ["7", 2.4865], ["8", 2.9189], ["9", 0.5405], ["10", 0.5405], ["11", 1.1892], ["12", 0.3243], ["13", 0.2162], ["14", 0.973], ["15", 1.6216], ["16", 0.973], ["17", 1.1892], ["18", 1...
{"lang": "cpp", "distribution": [["7900", 0.8649], ["8000", 3.027], ["8100", 9.1892], ["8200", 19.7838], ["8300", 17.0811], ["8400", 4.4324], ["8500", 0.4324], ["8600", 0.973], ["8700", 0.3243], ["8800", 0.6486], ["8900", 0.4324], ["9000", 0.3243], ["9100", 0.7568], ["9200", 0.5405], ["9300", 0.8649], ["9400", 2.3784],...
[ { "code": "class Solution {\n struct UnionFind {\n UnionFind() {\n std::iota(parents.begin(), parents.end(), 0);\n std::iota(chars.begin(), chars.end(), 0);\n }\n \n int find(int value) {\n if (parents[value] == value)\n return value...
37
[ { "code": "class Solution {\npublic:\n int par[26];\n \n int find(int x){\n if(par[x]==-1) return x;\n return par[x]=find(par[x]);\n }\n \n void Union(int x, int y) {\n x = find(x);\n y = find(y);\n \n if (x != y) \n par[max(x, y)] = min(x, ...
55
1,984
maximum-distance-between-a-pair-of-values
<p>You are given two <strong>non-increasing 0-indexed </strong>integer arrays <code>nums1</code>​​​​​​ and <code>nums2</code>​​​​​​.</p> <p>A pair of indices <code>(i, j)</code>, where <code>0 &lt;= i &lt; nums1.length</code> and <code>0 &lt;= j &lt; nums2.length</code>, is <strong>valid</strong> if both <code>i &lt;=...
53.520252
Medium
[ "array", "two-pointers", "binary-search" ]
{"lang": "cpp", "distribution": [["48", 0.2193], ["52", 0.2193], ["55", 0.2193], ["60", 0.2193], ["61", 0.4386], ["62", 0.4386], ["63", 0.4386], ["67", 0.2193], ["71", 0.2193], ["72", 0.4386], ["73", 0.2193], ["87", 0.2193], ["90", 0.2193], ["99", 0.4386], ["101", 0.4386], ["102", 0.4386], ["103", 0.6579], ["104", 0.43...
{"lang": "cpp", "distribution": [["100800", 0.6579], ["100900", 5.4825], ["101000", 15.1316], ["101100", 41.886]]}
[ { "code": "class Solution {\npublic:\n int maxDistance(vector<int>& nums1, vector<int>& nums2) {\n ios::sync_with_stdio(false);\n cin.tie(nullptr);\n cout.tie(nullptr);\n int ans = 0;\n int i = 0;\n int j = 0;\n while (i < nums1.size() && j < nums2.size()) {\n...
55
[ { "code": "class Solution {\npublic:\n int maxDistance(vector<int>& nums1, vector<int>& nums2) {\n int res = 0;\n int i = 0, j = 0;\n while(i < nums1.size() && j < nums2.size()){\n while(j < nums2.size() && nums1[i] <= nums2[j]){\n j++;\n }\n ...
6
1,986
largest-color-value-in-a-directed-graph
"<p>There is a <strong>directed graph</strong> of <code>n</code> colored nodes and <code>m</code> ed(...TRUNCATED)
49.838637
Hard
[ "hash-table", "dynamic-programming", "graph", "topological-sort", "memoization", "counting" ]
"{\"lang\": \"cpp\", \"distribution\": [[\"258\", 0.5108], [\"270\", 0.2554], [\"282\", 0.3831], [\"(...TRUNCATED)
"{\"lang\": \"cpp\", \"distribution\": [[\"127939\", 0.6385000000000001], [\"129818\", 0.2554], [\"1(...TRUNCATED)
[{"code":"class Solution {\r\npublic:\r\n int largestPathValue(string colors, vector<vector<int>>(...TRUNCATED)
100
[{"code":"class Solution {\r\npublic:\r\n int largestPathValue(string colors, vector<vector<int>>(...TRUNCATED)
112
1,993
sum-of-all-subset-xor-totals
"<p>The <strong>XOR total</strong> of an array is defined as the bitwise <code>XOR</code> of<strong>(...TRUNCATED)
87.778276
Easy
[ "array", "math", "backtracking", "bit-manipulation", "combinatorics", "enumeration" ]
"{\"lang\": \"cpp\", \"distribution\": [[\"0\", 30.1166], [\"1\", 19.7487], [\"2\", 13.5099], [\"3\"(...TRUNCATED)
"{\"lang\": \"cpp\", \"distribution\": [[\"8413\", 75.763], [\"8841\", 3.0071000000000003], [\"9268\(...TRUNCATED)
[{"code":"class Solution {\n int solve(vector<int>& nums, int i, int xorr)\n {\n if(i =(...TRUNCATED)
72
[{"code":"class Solution {\npublic:\n int subsetXORSum(vector<int>& nums) {\n int n = nums(...TRUNCATED)
82
2,505
number-of-good-paths
"<p>There is a tree (i.e. a connected, undirected graph with no cycles) consisting of <code>n</code>(...TRUNCATED)
56.26695
Hard
[ "array", "hash-table", "tree", "union-find", "graph", "sorting" ]
"{\"lang\": \"cpp\", \"distribution\": [[\"221\", 0.64], [\"228\", 0.48], [\"235\", 0.8], [\"243\", (...TRUNCATED)
"{\"lang\": \"cpp\", \"distribution\": [[\"130665\", 0.48], [\"132597\", 0.16], [\"134530\", 0.48], (...TRUNCATED)
[{"code":"#include <ranges>\n\nclass DisjointSet {\npublic:\n DisjointSet(int n, const vector<int(...TRUNCATED)
135
[{"code":"using P2I = pair<int, int>;\nclass Solution {\npublic:\n int numberOfGoodPaths(vector<i(...TRUNCATED)
120
3,276
minimum-number-of-pushes-to-type-word-ii
"<p>You are given a string <code>word</code> containing lowercase English letters.</p>\n\n<p>Telepho(...TRUNCATED)
80.708191
Medium
[ "hash-table", "string", "greedy", "sorting", "counting" ]
"{\"lang\": \"cpp\", \"distribution\": [[\"4\", 0.023399999999999997], [\"6\", 0.0109], [\"8\", 0.01(...TRUNCATED)
"{\"lang\": \"cpp\", \"distribution\": [[\"8530\", 0.0265], [\"8790\", 0.0031], [\"9050\", 0.0047], (...TRUNCATED)
[{"code":"struct Solution {\n int minimumPushes(string_view input) {\n int i = 0;\n (...TRUNCATED)
104
[{"code":"struct Solution {\n int minimumPushes(string_view input) {\n int i;\n int(...TRUNCATED)
80
2,076
sum-of-digits-of-string-after-convert
"<p>You are given a string <code>s</code> consisting of lowercase English letters, and an integer <c(...TRUNCATED)
74.965412
Easy
[ "string", "simulation" ]
"{\"lang\": \"cpp\", \"distribution\": [[\"0\", 41.3082], [\"1\", 0.024], [\"2\", 3.8779], [\"3\", 1(...TRUNCATED)
"{\"lang\": \"cpp\", \"distribution\": [[\"7500\", 0.0017], [\"7600\", 0.1253], [\"7700\", 2.0247], (...TRUNCATED)
[{"code":"class Solution {\npublic:\n int getLucky(string s, int k) {\n int len = s.length(...TRUNCATED)
2
[{"code":"int sumDigits(int num) {\n int sum = 0;\n while (num) {\n sum += num % 10;\n (...TRUNCATED)
45
2,251
number-of-ways-to-divide-a-long-corridor
"<p>Along a long library corridor, there is a line of seats and decorative plants. You are given a <(...TRUNCATED)
49.341445
Hard
[ "math", "string", "dynamic-programming" ]
"{\"lang\": \"cpp\", \"distribution\": [[\"51\", 1.1365], [\"64\", 1.1365], [\"76\", 0.2273], [\"89\(...TRUNCATED)
"{\"lang\": \"cpp\", \"distribution\": [[\"28675\", 1.1362999999999999], [\"33425\", 39.545500000000(...TRUNCATED)
[{"code":"class Solution {\npublic:\n int numberOfWays(string corridor) {\n ios_base::sync(...TRUNCATED)
74
[{"code":"class Solution {\npublic:\n int numberOfWays(string_view corridor) {\n constexpr(...TRUNCATED)
43
2,271
rearrange-array-elements-by-sign
"<p>You are given a <strong>0-indexed</strong> integer array <code>nums</code> of <strong>even</stro(...TRUNCATED)
84.072132
Medium
[ "array", "two-pointers", "simulation" ]
"{\"lang\": \"cpp\", \"distribution\": [[\"61\", 0.008], [\"62\", 0.004], [\"64\", 0.004], [\"65\", (...TRUNCATED)
"{\"lang\": \"cpp\", \"distribution\": [[\"124617\", 0.064], [\"124852\", 0.0721], [\"125087\", 0.26(...TRUNCATED)
[{"code":"class Solution {\npublic:\n vector<int> rearrangeArray(vector<int>& nums) {\n ios(...TRUNCATED)
120
[{"code":"class Solution {\npublic:\n vector<int> rearrangeArray(vector<int>& nums) {\n st(...TRUNCATED)
108
2,519
find-the-original-array-of-prefix-xor
"<p>You are given an <strong>integer</strong> array <code>pref</code> of size <code>n</code>. Find a(...TRUNCATED)
88.04974
Medium
[ "array", "bit-manipulation" ]
"{\"lang\": \"cpp\", \"distribution\": [[\"30\", 0.0437], [\"31\", 0.0437], [\"33\", 0.0437], [\"34\(...TRUNCATED)
"{\"lang\": \"cpp\", \"distribution\": [[\"78300\", 0.3493], [\"78400\", 1.5721], [\"78500\", 8.821](...TRUNCATED)
[{"code":"class Solution {\npublic:\n vector<int> findArray(vector<int>& v) {\n ios::sync_(...TRUNCATED)
65
[{"code":"#pragma GCC optimize(\"Ofast\", \"inline\", \"unroll-loops\")\nclass Solution {\npublic:\n(...TRUNCATED)
19
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
3