slug
stringlengths
4
77
solution_id
stringlengths
16
89
primary_algorithm
stringclasses
22 values
verified
bool
1 class
messages
listlengths
3
3
maximum-length-of-subarray-with-positive-product
maximum-length-of-subarray-with-positive-product__02__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an array of integers nums, find the maximum length of a subarray w...
minimum-number-of-days-to-disconnect-island
minimum-number-of-days-to-disconnect-island__01__python
DFS
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an m x n binary grid grid where 1 represents land and 0 re...
number-of-ways-to-reorder-array-to-get-same-bst
number-of-ways-to-reorder-array-to-get-same-bst__01__python
Recursion
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an array nums that represents a permutation of integers from 1 to ...
number-of-ways-to-split-a-string
number-of-ways-to-split-a-string__01__python
Math
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven a binary string s, you can split s into 3 non-empty strings s1, s2...
shortest-subarray-to-be-removed-to-make-array-sorted
shortest-subarray-to-be-removed-to-make-array-sorted__02__python
Two Pointers
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an integer array arr, remove a subarray (can be empty) from arr su...
count-all-possible-routes
count-all-possible-routes__01__python
Memoization
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an array of distinct positive integers locations where loc...
count-all-possible-routes
count-all-possible-routes__02__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an array of distinct positive integers locations where loc...
replace-all-s-to-avoid-consecutive-repeating-characters
replace-all-s-to-avoid-consecutive-repeating-characters__01__python
String
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven a string s containing only lowercase English letters and the '?' c...
number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers
number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers__01__python
Hash Table
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven two arrays of integers nums1 and nums2, return the number of tripl...
number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers
number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers__02__python
Hash Table
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven two arrays of integers nums1 and nums2, return the number of tripl...
minimum-time-to-make-rope-colorful
minimum-time-to-make-rope-colorful__01__python
Greedy
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nAlice has n balloons arranged on a rope. You are given a 0-indexed strin...
put-boxes-into-the-warehouse-ii
put-boxes-into-the-warehouse-ii__01__python
Greedy
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given two arrays of positive integers, boxes and warehouse, repr...
special-positions-in-a-binary-matrix
special-positions-in-a-binary-matrix__01__python
Array
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an m x n binary matrix mat, return the number of special positions...
count-unhappy-friends
count-unhappy-friends__01__python
Array
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a list of preferences for n friends, where n is always eve...
min-cost-to-connect-all-points
min-cost-to-connect-all-points__01__python
Graph
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an array points representing integer coordinates of some p...
min-cost-to-connect-all-points
min-cost-to-connect-all-points__02__python
Graph
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an array points representing integer coordinates of some p...
check-if-string-is-transformable-with-substring-sort-operations
check-if-string-is-transformable-with-substring-sort-operations__01__python
Sorting
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven two strings s and t, transform string s into string t using the fo...
maximum-sum-obtained-of-any-permutation
maximum-sum-obtained-of-any-permutation__01__python
Greedy
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nWe have an array of integers, nums, and an array of requests where reque...
make-sum-divisible-by-p
make-sum-divisible-by-p__01__python
Hash Table
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an array of positive integers nums, remove the smallest subarray (...
rearrange-spaces-between-words
rearrange-spaces-between-words__01__python
Math
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a string text of words that are placed among some number o...
maximum-non-negative-product-in-a-matrix
maximum-non-negative-product-in-a-matrix__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a m x n matrix grid. Initially, you are located at the top...
crawler-log-folder
crawler-log-folder__01__python
Array
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nThe Leetcode file system keeps a log each time some user performs a chan...
maximum-profit-of-operating-a-centennial-wheel
maximum-profit-of-operating-a-centennial-wheel__01__python
Math
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are the operator of a Centennial Wheel that has four gondolas, and e...
alert-using-same-key-card-three-or-more-times-in-a-one-hour-period
alert-using-same-key-card-three-or-more-times-in-a-one-hour-period__01__python
Sorting
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nLeetCode company workers use key-cards to unlock office doors. Each time...
special-array-with-x-elements-greater-than-or-equal-x
special-array-with-x-elements-greater-than-or-equal-x__01__python
Brute Force
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an array nums of non-negative integers. nums is considered...
even-odd-tree
even-odd-tree__01__python
BFS
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nA binary tree is named Even-Odd if it meets the following conditions:\n\...
even-odd-tree
even-odd-tree__02__python
DFS
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nA binary tree is named Even-Odd if it meets the following conditions:\n\...
minimum-one-bit-operations-to-make-integers-zero
minimum-one-bit-operations-to-make-integers-zero__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an integer n, you must transform it into 0 using the following ope...
maximum-nesting-depth-of-the-parentheses
maximum-nesting-depth-of-the-parentheses__01__python
String
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven a valid parentheses string s, return the nesting depth of s. The n...
maximal-network-rank
maximal-network-rank__01__python
Graph
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nThere is an infrastructure of n cities with some number of roads connect...
count-subtrees-with-max-distance-between-cities
count-subtrees-with-max-distance-between-cities__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nThere are n cities numbered from 1 to n. You are given an array edges of...
count-subtrees-with-max-distance-between-cities
count-subtrees-with-max-distance-between-cities__02__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nThere are n cities numbered from 1 to n. You are given an array edges of...
mean-of-array-after-removing-some-elements
mean-of-array-after-removing-some-elements__01__python
Sorting
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an integer array arr, return the mean of the remaining integers af...
number-of-sets-of-k-non-overlapping-line-segments
number-of-sets-of-k-non-overlapping-line-segments__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven n points on a 1-D plane, where the ith point (from 0 to n-1) is at...
largest-substring-between-two-equal-characters
largest-substring-between-two-equal-characters__01__python
Hash Table
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven a string s, return the length of the longest substring between two...
lexicographically-smallest-string-after-applying-operations
lexicographically-smallest-string-after-applying-operations__01__python
BFS
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a string s of even length consisting of digits from 0 to 9...
lexicographically-smallest-string-after-applying-operations
lexicographically-smallest-string-after-applying-operations__02__python
DFS
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a string s of even length consisting of digits from 0 to 9...
best-team-with-no-conflicts
best-team-with-no-conflicts__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are the manager of a basketball team. For the upcoming tournament, y...
best-team-with-no-conflicts
best-team-with-no-conflicts__02__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are the manager of a basketball team. For the upcoming tournament, y...
slowest-key
slowest-key__01__python
Array
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nA newly designed keypad was tested, where a tester pressed a sequence of...
rank-transform-of-a-matrix
rank-transform-of-a-matrix__01__python
Graph
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an m x n matrix, return a new matrix answer where answer[row][col]...
sort-array-by-increasing-frequency
sort-array-by-increasing-frequency__01__python
Sorting
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an array of integers nums, sort the array in increasing order base...
widest-vertical-area-between-two-points-containing-no-points
widest-vertical-area-between-two-points-containing-no-points__02__python
Sorting
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven n points on a 2D plane where points[i] = [xi, yi], Return the wide...
count-substrings-that-differ-by-one-character
count-substrings-that-differ-by-one-character__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven two strings s and t, find the number of ways you can choose a non-...
count-substrings-that-differ-by-one-character
count-substrings-that-differ-by-one-character__02__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven two strings s and t, find the number of ways you can choose a non-...
number-of-ways-to-form-a-target-string-given-a-dictionary
number-of-ways-to-form-a-target-string-given-a-dictionary__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a list of strings of the same length words and a string ta...
number-of-ways-to-form-a-target-string-given-a-dictionary
number-of-ways-to-form-a-target-string-given-a-dictionary__02__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a list of strings of the same length words and a string ta...
check-array-formation-through-concatenation
check-array-formation-through-concatenation__01__python
Hash Table
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an array of distinct integers arr and an array of integer ...
check-array-formation-through-concatenation
check-array-formation-through-concatenation__02__python
Hash Table
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an array of distinct integers arr and an array of integer ...
count-sorted-vowel-strings
count-sorted-vowel-strings__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an integer n, return the number of strings of length n that consis...
count-sorted-vowel-strings
count-sorted-vowel-strings__02__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an integer n, return the number of strings of length n that consis...
get-maximum-in-generated-array
get-maximum-in-generated-array__01__python
Array
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an integer n. A 0-indexed integer array nums of length n +...
minimum-deletions-to-make-character-frequencies-unique
minimum-deletions-to-make-character-frequencies-unique__01__python
Sorting
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nA string s is called good if there are no two different characters in s ...
minimum-deletions-to-make-character-frequencies-unique
minimum-deletions-to-make-character-frequencies-unique__02__python
Greedy
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nA string s is called good if there are no two different characters in s ...
create-sorted-array-through-instructions
create-sorted-array-through-instructions__01__python
Binary Search
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an integer array instructions, you are asked to create a sorted ar...
create-sorted-array-through-instructions
create-sorted-array-through-instructions__02__python
Binary Search
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an integer array instructions, you are asked to create a sorted ar...
defuse-the-bomb
defuse-the-bomb__01__python
Math
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou have a bomb to defuse, and your time is running out! Your informer w...
minimum-deletions-to-make-string-balanced
minimum-deletions-to-make-string-balanced__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a string s consisting only of characters 'a' and 'b'​​​​.\...
minimum-deletions-to-make-string-balanced
minimum-deletions-to-make-string-balanced__02__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a string s consisting only of characters 'a' and 'b'​​​​.\...
minimum-jumps-to-reach-home
minimum-jumps-to-reach-home__01__python
BFS
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nA certain bug's home is on the x-axis at position x. Help them get there...
distribute-repeating-integers
distribute-repeating-integers__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an array of n integers, nums, where there are at most 50 u...
minimum-operations-to-reduce-x-to-zero
minimum-operations-to-reduce-x-to-zero__01__python
Hash Table
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array nums and an integer x. In one operation, ...
minimum-operations-to-reduce-x-to-zero
minimum-operations-to-reduce-x-to-zero__02__python
Two Pointers
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array nums and an integer x. In one operation, ...
maximize-grid-happiness
maximize-grid-happiness__01__python
Memoization
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given four integers, m, n, introvertsCount, and extrovertsCount....
maximize-grid-happiness
maximize-grid-happiness__02__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given four integers, m, n, introvertsCount, and extrovertsCount....
check-if-two-string-arrays-are-equivalent
check-if-two-string-arrays-are-equivalent__01__python
Array
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven two string arrays word1 and word2, return true if the two arrays r...
check-if-two-string-arrays-are-equivalent
check-if-two-string-arrays-are-equivalent__02__python
Array
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven two string arrays word1 and word2, return true if the two arrays r...
smallest-string-with-a-given-numeric-value
smallest-string-with-a-given-numeric-value__01__python
Greedy
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nThe numeric value of a lowercase character is defined as its position (1...
ways-to-make-a-fair-array
ways-to-make-a-fair-array__01__python
Array
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array nums. You can choose exactly one index (0...
minimum-initial-energy-to-finish-tasks
minimum-initial-energy-to-finish-tasks__01__python
Greedy
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an array tasks where tasks[i] = [actuali, minimumi]:\n\n\t...
merge-in-between-linked-lists
merge-in-between-linked-lists__01__python
Math
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given two linked lists: list1 and list2 of sizes n and m respect...
minimum-number-of-removals-to-make-mountain-array
minimum-number-of-removals-to-make-mountain-array__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou may recall that an array arr is a mountain array if and only if:\n\n...
find-the-most-competitive-subsequence
find-the-most-competitive-subsequence__01__python
Greedy
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven an integer array nums and a positive integer k, return the most co...
goal-parser-interpretation
goal-parser-interpretation__01__python
String
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou own a Goal Parser that can interpret a string command. The command c...
goal-parser-interpretation
goal-parser-interpretation__02__python
String
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou own a Goal Parser that can interpret a string command. The command c...
max-number-of-k-sum-pairs
max-number-of-k-sum-pairs__01__python
Sorting
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array nums and an integer k.\n\nIn one operatio...
max-number-of-k-sum-pairs
max-number-of-k-sum-pairs__02__python
Hash Table
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array nums and an integer k.\n\nIn one operatio...
minimum-incompatibility
minimum-incompatibility__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array nums​​​ and an integer k. You are asked t...
longest-palindromic-subsequence-ii
longest-palindromic-subsequence-ii__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nA subsequence of a string s is considered a good palindromic subsequence...
count-the-number-of-consistent-strings
count-the-number-of-consistent-strings__01__python
Hash Table
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a string allowed consisting of distinct characters and an ...
sum-of-absolute-differences-in-a-sorted-array
sum-of-absolute-differences-in-a-sorted-array__01__python
Math
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array nums sorted in non-decreasing order.\n\nB...
stone-game-vi
stone-game-vi__01__python
Greedy
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nAlice and Bob take turns playing a game, with Alice starting first.\n\nT...
count-of-matches-in-tournament
count-of-matches-in-tournament__01__python
Math
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an integer n, the number of teams in a tournament that has...
partitioning-into-minimum-number-of-deci-binary-numbers
partitioning-into-minimum-number-of-deci-binary-numbers__01__python
Greedy
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nA decimal number is called deci-binary if each of its digits is either 0...
maximum-height-by-stacking-cuboids
maximum-height-by-stacking-cuboids__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven n cuboids where the dimensions of the ith cuboid is cuboids[i] = [...
count-ways-to-distribute-candies
count-ways-to-distribute-candies__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nThere are n unique candies (labeled 1 through n) and k bags. You are ask...
maximum-erasure-value
maximum-erasure-value__02__python
Two Pointers
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an array of positive integers nums and want to erase a sub...
jump-game-vi
jump-game-vi__01__python
Dynamic Programming
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed integer array nums and an integer k.\n\nYou ar...
number-of-distinct-substrings-in-a-string
number-of-distinct-substrings-in-a-string__01__python
Brute Force
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven a string s, return the number of distinct substrings of s.\n\nA su...
number-of-distinct-substrings-in-a-string
number-of-distinct-substrings-in-a-string__02__python
Trie
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nGiven a string s, return the number of distinct substrings of s.\n\nA su...
maximum-binary-string-after-change
maximum-binary-string-after-change__01__python
Greedy
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a binary string binary consisting of only 0's or 1's. You ...
determine-if-string-halves-are-alike
determine-if-string-halves-are-alike__01__python
String
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a string s of even length. Split this string into two halv...
where-will-the-ball-fall
where-will-the-ball-fall__01__python
DFS
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou have a 2-D grid of size m x n representing a box, and you have n bal...
maximum-xor-with-an-element-from-array
maximum-xor-with-an-element-from-array__01__python
Trie
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an array nums consisting of non-negative integers. You are...
largest-subarray-length-k
largest-subarray-length-k__01__python
Math
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nAn array A is larger than some array B if for the first index i where A[...
maximum-units-on-a-truck
maximum-units-on-a-truck__01__python
Greedy
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are assigned to put some amount of boxes onto one truck. You are giv...
maximum-units-on-a-truck
maximum-units-on-a-truck__02__python
Sorting
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are assigned to put some amount of boxes onto one truck. You are giv...
minimum-operations-to-make-a-subsequence
minimum-operations-to-make-a-subsequence__01__python
Greedy
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given an array target that consists of distinct integers and ano...
calculate-money-in-leetcode-bank
calculate-money-in-leetcode-bank__01__python
Math
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nHercy wants to save money for his first car. He puts money in the Leetco...
maximum-score-from-removing-substrings
maximum-score-from-removing-substrings__01__python
Greedy
true
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution." }, { "role": "user", "content": "### Problem\nYou are given a string s and two integers x and y. You can perform two t...