input_output_x stringlengths 29 74M | reason stringclasses 2
values | solutions_x stringlengths 2 867k | correctness bool 2
classes | deepseek_solution stringlengths 1.3k 11k | question stringlengths 171 9.56k | solutions_y stringlengths 2 867k | starter_code stringlengths 0 1.47k | input_output_y stringlengths 29 74M | difficulty stringclasses 1
value | raw_tags stringlengths 2 209 | name stringclasses 458
values | source stringclasses 9
values | tags stringclasses 537
values | skill_types stringclasses 81
values | url stringlengths 36 127 ⌀ | Expected Auxiliary Space stringclasses 179
values | time_limit stringclasses 33
values | date stringclasses 339
values | picture_num stringclasses 6
values | memory_limit stringclasses 10
values | Expected Time Complexity stringclasses 336
values | reasoning stringlengths 1.55k 116k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{"inputs": ["\"AABBBCBBAC\"", "\"aaab\"", "\"GEEKSGEEKSFOR\""], "outputs": ["3", "2", "8"]} | Code is incorrect. | ["class Solution:\n\n\tdef findSubString(self, str):\n\t\tdict = {}\n\t\tans = float('inf')\n\t\tj = 0\n\t\tfor i in str:\n\t\t\tif i not in dict:\n\t\t\t\tdict[i] = 0\n\t\tlength = len(dict)\n\t\tfor i in range(len(str)):\n\t\t\tdict[str[i]] += 1\n\t\t\tif dict[str[i]] == 1:\n\t\t\t\tlength -= 1\n\t\t\twhile length ==... | false | To solve this problem, we need to find the smallest window in a given string that contains all the unique characters of that string at least once. This problem can be efficiently tackled using a sliding window approach combined with a hash map to keep track of character counts.
### Approach
1. **Identify Unique Charac... | Given a string 's'. The task is to find the smallest window length that contains all the characters of the given string at least one time.
For eg. A = aabcbcdbca, then the result would be 4 as of the smallest window will be dbca.
Example 1:
Input : "AABBBCBBAC"
Output : 3
Explanation : Sub-string -> "BAC"
Example 2:
... | ["class Solution:\n\n\tdef findSubString(self, str):\n\t\tdict = {}\n\t\tans = float('inf')\n\t\tj = 0\n\t\tfor i in str:\n\t\t\tif i not in dict:\n\t\t\t\tdict[i] = 0\n\t\tlength = len(dict)\n\t\tfor i in range(len(str)):\n\t\t\tdict[str[i]] += 1\n\t\t\tif dict[str[i]] == 1:\n\t\t\t\tlength -= 1\n\t\t\twhile length ==... | #User function Template for python3
class Solution:
def findSubString(self, str):
# Your code goes here
| {"inputs": ["\"AABBBCBBAC\"", "\"aaab\"", "\"GEEKSGEEKSFOR\""], "outputs": ["3", "2", "8"]} | MEDIUM | ['Algorithms', 'Hash', 'sliding-window', 'Strings', 'Data Structures', 'Arrays'] | null | geeksforgeeks | ['String algorithms', 'Data structures', 'Amortized analysis'] | ['Amortized analysis', 'Data structures'] | https://practice.geeksforgeeks.org/problems/smallest-distant-window3132/1 | O(256) | null | null | 0 | null | O(256.N) | Okay, I need to find the smallest window in a given string that contains all the unique characters of that string. Let's see. Hmm, the examples given show that for "aabcbcdbca", the answer is 4 because the window is "dbca" which has all the characters. So the approach here is to find the minimal length substring that i... |
"{\"inputs\": [\"N = 7\\narr[] = {7 6 5 4 3 2 1}\", \"N = 6\\narr[] = {5 6 4 9 2 1}\"], \"outputs\":(...TRUNCATED) | Code is incorrect. | "[\"class Solution:\\n\\n\\tdef binTreeSortedLevels(self, arr, n):\\n\\t\\tli = []\\n\\t\\ti = 0\\n\(...TRUNCATED) | false | "To solve this problem, we need to generate the level order traversal of a complete binary tree in s(...TRUNCATED) | "Given an array arr[] which contains data of N nodes of Complete Binary tree in level order fashion.(...TRUNCATED) | "[\"class Solution:\\n\\n\\tdef binTreeSortedLevels(self, arr, n):\\n\\t\\tli = []\\n\\t\\ti = 0\\n\(...TRUNCATED) |
class Solution:
def binTreeSortedLevels (self,arr, n):
#code here. | "{\"inputs\": [\"N = 7\\narr[] = {7 6 5 4 3 2 1}\", \"N = 6\\narr[] = {5 6 4 9 2 1}\"], \"outputs\":(...TRUNCATED) | MEDIUM | ['Algorithms', 'Tree', 'Sorting', 'Queue', 'Data Structures', 'priority-queue'] | null | geeksforgeeks | ['Tree algorithms', 'Sorting', 'Data structures'] | ['Sorting', 'Data structures'] | https://practice.geeksforgeeks.org/problems/print-binary-tree-levels-in-sorted-order3241/1 | O(N). | null | null | 0 | null | O(NlogN). | "Okay, let's see. I need to write a Python function called binTreeSortedLevels that takes an array a(...TRUNCATED) |
{"inputs": ["n = 7\nprices = [1,2,3,4,5,6,7]"], "outputs": ["6"]} | Code is incorrect. | "[\"class Solution:\\n\\n\\tdef maximumProfit(self, prices, n):\\n\\t\\tn = len(prices)\\n\\t\\tcurr(...TRUNCATED) | false | "To solve this problem, we need to determine the maximum profit that can be achieved by buying and s(...TRUNCATED) | "You are given the prices of stock for n number of days. every ith day tell the price of the stock o(...TRUNCATED) | "[\"class Solution:\\n\\n\\tdef maximumProfit(self, prices, n):\\n\\t\\tn = len(prices)\\n\\t\\tcurr(...TRUNCATED) | "#User function Template for python3\n\n\n\nclass Solution:\n\n def maximumProfit(self, prices, n(...TRUNCATED) | {"inputs": ["n = 7\nprices = [1,2,3,4,5,6,7]"], "outputs": ["6"]} | MEDIUM | [] | null | geeksforgeeks | [] | [] | https://practice.geeksforgeeks.org/problems/buy-stock-2/1 | O(n^{2}) | null | null | 0 | null | O(n) | "Okay, I need to solve this problem where I have to find the maximum profit by buying and selling st(...TRUNCATED) |
"{\"inputs\": [\"7 6\\nAlena\\nOlya\\nVanya\\nBrus\\nJohn\\nAlice\\nMariana\\nAlena John\\nAlena Ali(...TRUNCATED) | Code is incorrect. | "[\"from sys import stdin, stdout\\nfrom collections import deque\\nimport sys\\nfrom copy import de(...TRUNCATED) | false | "To solve this problem, we need to form the largest possible team of volunteers such that all member(...TRUNCATED) | "When little Petya grew up and entered the university, he started to take part in АСМ contests. L(...TRUNCATED) | "[\"from sys import stdin, stdout\\nfrom collections import deque\\nimport sys\\nfrom copy import de(...TRUNCATED) | "{\"inputs\": [\"7 6\\nAlena\\nOlya\\nVanya\\nBrus\\nJohn\\nAlice\\nMariana\\nAlena John\\nAlena Ali(...TRUNCATED) | MEDIUM | ['brute force', 'bitmasks', 'graphs'] | null | codeforces | ['Bit manipulation', 'Graph algorithms', 'Complete search'] | ['Bit manipulation', 'Complete search'] | https://codeforces.com/problemset/problem/114/B | null | 2.0 seconds | null | null | 256.0 megabytes | null | "Okay, let's see. I need to find the largest possible team of volunteers where everyone gets along. (...TRUNCATED) | |
"{\"inputs\": [\"3 2\\n\", \"3 200\\n\", \"100000 100000\\n\", \"2 1000\\n\", \"2 100000\\n\", \"2 1(...TRUNCATED) | "[\"(N, K) = map(int, input().split())\\nD = [0] * (K + 1)\\nD[K] = 1\\nmod = 10 ** 9 + 7\\nfor i in(...TRUNCATED) | true | "To solve this problem, we need to compute the sum of the greatest common divisor (GCD) of all possi(...TRUNCATED) | "Consider sequences \\{A_1,...,A_N\\} of length N consisting of integers between 1 and K (inclusive)(...TRUNCATED) | "[\"(N, K) = map(int, input().split())\\nD = [0] * (K + 1)\\nD[K] = 1\\nmod = 10 ** 9 + 7\\nfor i in(...TRUNCATED) | "{\"inputs\": [\"3 2\\n\", \"3 200\\n\", \"100000 100000\\n\", \"2 1000\\n\", \"2 100000\\n\", \"2 1(...TRUNCATED) | MEDIUM | [] | AtCoder Beginner Contest 162 - Sum of gcd of Tuples (Hard) | atcoder | [] | [] | https://atcoder.jp/contests/abc162/tasks/abc162_e | null | 2.0 seconds | null | null | 1024.0 megabytes | null | "Okay, let's see. I need to find the sum of the GCD of all possible sequences of length N with eleme(...TRUNCATED) | ||
{"inputs": [], "outputs": []} | Code is incorrect. | [] | false | "To solve this problem, we need to compute the number of SegFaults Ram receives on the k-th day base(...TRUNCATED) | "King Tle4Ever of Time Limit Exceeded has recently appointed Ram as his new cashier. To get this job(...TRUNCATED) | [] | {"inputs": [], "outputs": []} | MEDIUM | ['Algorithms', 'Combinatorics'] | computing-salary | hackerearth | ['Combinatorics'] | [] | null | null | null | null | null | null | null | "Okay, I need to solve this problem where Ram's salary on the kth day is determined by a recurrence (...TRUNCATED) | |
{"inputs": ["8 \nGAAATAAA\n"], "outputs": ["5\n"]} | "[\"def solve(S, n):\\n\\tcount = {}\\n\\tfor c in S:\\n\\t\\tcount[c] = count.get(c, 0) + 1\\n\\tfo(...TRUNCATED) | true | "To solve this problem, we need to determine the smallest substring of a gene that can be replaced t(...TRUNCATED) | "A gene is represented as a string of length $n$ (where $n$ is divisible by $4$), composed of the le(...TRUNCATED) | "[\"def solve(S, n):\\n\\tcount = {}\\n\\tfor c in S:\\n\\t\\tcount[c] = count.get(c, 0) + 1\\n\\tfo(...TRUNCATED) | {"inputs": ["8 \nGAAATAAA\n"], "outputs": ["5\n"]} | MEDIUM | ['Algorithms - Strings'] | null | hackerrank | ['String algorithms'] | [] | https://www.hackerrank.com/challenges/bear-and-steady-gene/problem | null | null | null | 0 | null | null | "Okay, let's see. I need to find the smallest substring to replace in the gene so that the entire ge(...TRUNCATED) | ||
"{\"inputs\": [[\"5\", \"4 1 2 3 4\", \"4\", \"3\", \"4\", \"6\", \"1\", \"\", \"\"], \"5\\n4 0 2 3 (...TRUNCATED) | "[\"n = int(input())\\na = list(map(int, input().split()))\\ncnt = {}\\nfor i in range(n):\\n\\tmn =(...TRUNCATED) | true | "To solve this problem, we need to determine how many subarrays of a given array have a minimum valu(...TRUNCATED) | "Little Elephant is playing a game with arrays. He is given an array A0, A1, ..., AN−1 of N intege(...TRUNCATED) | "[\"n = int(input())\\na = list(map(int, input().split()))\\ncnt = {}\\nfor i in range(n):\\n\\tmn =(...TRUNCATED) | "{\"inputs\": [[\"5\", \"4 1 2 3 4\", \"4\", \"3\", \"4\", \"6\", \"1\", \"\", \"\"], \"5\\n4 0 2 3 (...TRUNCATED) | MEDIUM | ['Algorithms', 'Constructive', 'ad-hoc', 'Brute Force', 'Stacks', 'Data Structures'] | null | codechef | ['Complete search', 'Constructive algorithms', 'Data structures', 'Ad-hoc'] | ['Data structures', 'Complete search'] | https://www.codechef.com/problems/SUBMIN | null | 1 seconds | 2014-01-03 | 0 | 50000 bytes | null | "Okay, I need to solve this problem where for each query K, I have to count the number of subarrays (...TRUNCATED) | ||
"{\"inputs\": [\"10 9\\n1 2 1\\n2 3 1\\n3 4 1\\n4 5 1\\n5 6 1\\n6 7 1\\n7 8 1\\n8 9 1\\n9 10 1\\n1 2(...TRUNCATED) | [] | true | "To solve this problem, we need to find the minimum number of coins required to collect all seven Dr(...TRUNCATED) | "There is a legendary tale about Dragon Balls on Planet X: if one collects seven Dragon Balls, the D(...TRUNCATED) | [] | "{\"inputs\": [\"10 9\\n1 2 1\\n2 3 1\\n3 4 1\\n4 5 1\\n5 6 1\\n6 7 1\\n7 8 1\\n8 9 1\\n9 10 1\\n1 2(...TRUNCATED) | MEDIUM | [] | null | kattis | [] | [] | https://open.kattis.com/problems/dragonball1 | null | null | null | null | null | null | "Okay, so I've got this programming problem to solve. Let's see what it's about. The task is to find(...TRUNCATED) | ||
"{\"inputs\": [\"3 3 2\\n1 2\\n5 4\\n9 2\\n\", \"9 4 1\\n1 5\\n2 4\\n3 3\\n4 2\\n5 1\\n6 2\\n7 3\\n8(...TRUNCATED) | "[\"(n, d, a) = map(int, input().split())\\nxh = [list(map(int, input().split())) for _ in range(n)](...TRUNCATED) | true | "To solve this problem, we need to determine the minimum number of bombs required for Silver Fox to (...TRUNCATED) | "Silver Fox is fighting with N monsters.\nThe monsters are standing in a row, and we can assume them(...TRUNCATED) | "[\"(n, d, a) = map(int, input().split())\\nxh = [list(map(int, input().split())) for _ in range(n)](...TRUNCATED) | "{\"inputs\": [\"3 3 2\\n1 2\\n5 4\\n9 2\\n\", \"9 4 1\\n1 5\\n2 4\\n3 3\\n4 2\\n5 1\\n6 2\\n7 3\\n8(...TRUNCATED) | MEDIUM | [] | AtCoder Beginner Contest 153 - Silver Fox vs Monster | atcoder | [] | [] | https://atcoder.jp/contests/abc153/tasks/abc153_f | null | 2.0 seconds | null | null | 1024.0 megabytes | null | "Okay, let's see. I need to find the minimum number of bombs required to defeat all the monsters. Hm(...TRUNCATED) |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 14