slug stringlengths 4 77 | solution_id stringlengths 16 89 | primary_algorithm stringclasses 22
values | verified bool 1
class | messages listlengths 3 3 |
|---|---|---|---|---|
minimum-penalty-for-a-shop | minimum-penalty-for-a-shop__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 the customer visit log of a shop represented by a 0-indexe... |
count-palindromic-subsequences | count-palindromic-subsequences__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 a string of digits s, return the number of palindromic subsequence... |
find-the-pivot-integer | find-the-pivot-integer__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 positive integer n, find the pivot integer x such that:\n\n\tThe... |
append-characters-to-string-to-make-subsequence | append-characters-to-string-to-make-subsequence__01__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 two strings s and t consisting of only lowercase English l... |
remove-nodes-from-linked-list | remove-nodes-from-linked-list__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 the head of a linked list.\n\nRemove every node which has ... |
remove-nodes-from-linked-list | remove-nodes-from-linked-list__02__python | Linked List | 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 the head of a linked list.\n\nRemove every node which has ... |
count-subarrays-with-median-k | count-subarrays-with-median-k__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 nums of size n consisting of distinct integers fr... |
number-of-substrings-with-fixed-ratio | number-of-substrings-with-fixed-ratio__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 binary string s, and two integers num1 and num2. num1 an... |
circular-sentence | circular-sentence__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\nA sentence is a list of words that are separated by a single space with ... |
divide-players-into-teams-of-equal-skill | divide-players-into-teams-of-equal-skill__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 a positive integer array skill of even length n where skil... |
divide-players-into-teams-of-equal-skill | divide-players-into-teams-of-equal-skill__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 a positive integer array skill of even length n where skil... |
minimum-score-of-a-path-between-two-cities | minimum-score-of-a-path-between-two-cities__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 a positive integer n representing n cities numbered from 1... |
minimum-score-of-a-path-between-two-cities | minimum-score-of-a-path-between-two-cities__02__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 positive integer n representing n cities numbered from 1... |
divide-nodes-into-the-maximum-number-of-groups | divide-nodes-into-the-maximum-number-of-groups__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 positive integer n representing the number of nodes in a... |
number-of-subarrays-having-even-product | number-of-subarrays-having-even-product__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 a 0-indexed integer array nums, return the number of subarrays of ... |
maximum-value-of-a-string-in-an-array | maximum-value-of-a-string-in-an-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\nThe value of an alphanumeric string can be defined as:\n\n\tThe numeric ... |
maximum-value-of-a-string-in-an-array | maximum-value-of-a-string-in-an-array__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\nThe value of an alphanumeric string can be defined as:\n\n\tThe numeric ... |
maximum-star-sum-of-a-graph | maximum-star-sum-of-a-graph__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\nThere is an undirected graph consisting of n nodes numbered from 0 to n ... |
frog-jump-ii | frog-jump-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 a 0-indexed integer array stones sorted in strictly increa... |
minimum-total-cost-to-make-arrays-unequal | minimum-total-cost-to-make-arrays-unequal__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 0-indexed integer arrays nums1 and nums2, of equal len... |
delete-greatest-value-in-each-row | delete-greatest-value-in-each-row__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 m x n matrix grid consisting of positive integers.\n\nP... |
longest-square-streak-in-an-array | longest-square-streak-in-an-array__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. A subsequence of nums is called a s... |
longest-square-streak-in-an-array | longest-square-streak-in-an-array__02__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 integer array nums. A subsequence of nums is called a s... |
bitwise-or-of-all-subsequence-sums | bitwise-or-of-all-subsequence-sums__01__python | Bit Manipulation | 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, return the value of the bitwise OR of the s... |
count-pairs-of-similar-strings | count-pairs-of-similar-strings__01__python | Bit Manipulation | 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 string array words.\n\nTwo strings are similar... |
smallest-value-after-replacing-with-sum-of-prime-factors | smallest-value-after-replacing-with-sum-of-prime-factors__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 positive integer n.\n\nContinuously replace n with the s... |
add-edges-to-make-degrees-of-all-nodes-even | add-edges-to-make-degrees-of-all-nodes-even__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 undirected graph consisting of n nodes numbered from 1 to n.... |
cycle-length-queries-in-a-tree | cycle-length-queries-in-a-tree__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. There is a complete binary tree with 2n - 1 ... |
check-if-there-is-a-path-with-equal-number-of-0s-and-1s | check-if-there-is-a-path-with-equal-number-of-0s-and-1s__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 a 0-indexed m x n binary matrix grid. You can move from a ... |
maximum-enemy-forts-that-can-be-captured | maximum-enemy-forts-that-can-be-captured__01__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 a 0-indexed integer array forts of length n representing t... |
reward-top-k-students | reward-top-k-students__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 two string arrays positive_feedback and negative_feedback,... |
count-anagrams | count-anagrams__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 s containing one or more words. Every consecutive... |
shortest-distance-to-target-string-in-a-circular-array | shortest-distance-to-target-string-in-a-circular-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 a 0-indexed circular string array words and a string targe... |
take-k-of-each-character-from-left-and-right | take-k-of-each-character-from-left-and-right__01__python | Sliding Window | 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 of the characters 'a', 'b', and 'c' ... |
maximum-tastiness-of-candy-basket | maximum-tastiness-of-candy-basket__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 of positive integers price where price[i] denotes... |
number-of-great-partitions | number-of-great-partitions__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 nums consisting of positive integers and an integ... |
count-the-number-of-k-big-indices | count-the-number-of-k-big-indices__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\nYou are given a 0-indexed integer array nums and a positive integer k.\n... |
count-the-digits-that-divide-a-number | count-the-digits-that-divide-a-number__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 an integer num, return the number of digits in num that divide num... |
distinct-prime-factors-of-product-of-array | distinct-prime-factors-of-product-of-array__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, return the number of distinct ... |
partition-string-into-substrings-with-values-at-most-k | partition-string-into-substrings-with-values-at-most-k__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 a string s consisting of digits from 1 to 9 and an integer... |
maximum-frequency-score-of-a-subarray | maximum-frequency-score-of-a-subarray__01__python | Sliding Window | 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 a positive integer k.\n\nThe fre... |
categorize-box-according-to-criteria | categorize-box-according-to-criteria__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 four integers length, width, height, and mass, representing the di... |
categorize-box-according-to-criteria | categorize-box-according-to-criteria__02__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 four integers length, width, height, and mass, representing the di... |
maximum-count-of-positive-integer-and-negative-integer | maximum-count-of-positive-integer-and-negative-integer__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 array nums sorted in non-decreasing order, return the maximum b... |
make-number-of-distinct-characters-equal | make-number-of-distinct-characters-equal__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 two 0-indexed strings word1 and word2.\n\nA move consists ... |
number-of-good-binary-strings | number-of-good-binary-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\nYou are given four integers minLength, maxLength, oneGroup and zeroGroup... |
time-taken-to-cross-the-door | time-taken-to-cross-the-door__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\nThere are n persons numbered from 0 to n - 1 and a door. Each person can... |
difference-between-element-sum-and-digit-sum-of-an-array | difference-between-element-sum-and-digit-sum-of-an-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 a positive integer array nums.\n\n\tThe element sum is the... |
increment-submatrices-by-one | increment-submatrices-by-one__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 positive integer n, indicating that we initially have an... |
count-the-number-of-good-subarrays | count-the-number-of-good-subarrays__01__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 nums and an integer k, return the number of good ... |
difference-between-maximum-and-minimum-price-sum | difference-between-maximum-and-minimum-price-sum__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 exists an undirected and initially unrooted tree with n nodes inde... |
minimum-common-value | minimum-common-value__01__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 two integer arrays nums1 and nums2, sorted in non-decreasing order... |
minimum-operations-to-make-array-equal-ii | minimum-operations-to-make-array-equal-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 integer arrays nums1 and nums2 of equal length n and a... |
alternating-digit-sum | alternating-digit-sum__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 positive integer n. Each digit of n has a sign according... |
alternating-digit-sum | alternating-digit-sum__02__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 positive integer n. Each digit of n has a sign according... |
sort-the-students-by-their-kth-score | sort-the-students-by-their-kth-score__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\nThere is a class with m students and n exams. You are given a 0-indexed ... |
apply-bitwise-operations-to-make-strings-equal | apply-bitwise-operations-to-make-strings-equal__01__python | Bit Manipulation | 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 0-indexed binary strings s and target of the same leng... |
minimum-cost-to-split-an-array | minimum-cost-to-split-an-array__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 integer array nums and an integer k.\n\nSplit the array... |
maximum-price-to-fill-a-bag | maximum-price-to-fill-a-bag__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 2D integer array items where items[i] = [pricei, weighti... |
count-distinct-numbers-on-board | count-distinct-numbers-on-board__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 positive integer n, that is initially placed on a board.... |
count-collisions-of-monkeys-on-a-polygon | count-collisions-of-monkeys-on-a-polygon__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\nThere is a regular convex polygon with n vertices. The vertices are labe... |
count-increasing-quadruplets | count-increasing-quadruplets__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 a 0-indexed integer array nums of size n containing all numbers fr... |
separate-the-digits-in-an-array | separate-the-digits-in-an-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\nGiven an array of positive integers nums, return an array answer that co... |
maximum-number-of-integers-to-choose-from-a-range-i | maximum-number-of-integers-to-choose-from-a-range-i__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 integer array banned and two integers n and maxSum. You... |
disconnect-path-in-a-binary-matrix-by-at-most-one-flip | disconnect-path-in-a-binary-matrix-by-at-most-one-flip__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 a 0-indexed m x n binary matrix grid. You can move from a ... |
rearranging-fruits | rearranging-fruits__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 have two fruit baskets containing n fruits each. You are given two 0... |
find-the-array-concatenation-value | find-the-array-concatenation-value__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 0-indexed integer array nums.\n\nThe concatenation of tw... |
substring-xor-queries | substring-xor-queries__01__python | Bit Manipulation | 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 s, and a 2D integer array queries where qu... |
maximum-difference-by-remapping-a-digit | maximum-difference-by-remapping-a-digit__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 integer num. You know that Bob will sneakily remap one ... |
minimum-score-by-changing-two-elements | minimum-score-by-changing-two-elements__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 integer array nums.\n\n\tThe low score of nums is the m... |
minimum-impossible-or | minimum-impossible-or__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 a 0-indexed integer array nums.\n\nWe say that an integer ... |
handling-sum-queries-after-update | handling-sum-queries-after-update__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 two 0-indexed arrays nums1 and nums2 and a 2D array querie... |
minimum-operations-to-reduce-an-integer-to-0 | minimum-operations-to-reduce-an-integer-to-0__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 positive integer n, you can do the following operation a... |
count-the-number-of-square-free-subsets | count-the-number-of-square-free-subsets__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 positive integer 0-indexed array nums.\n\nA subset of th... |
left-and-right-sum-differences | left-and-right-sum-differences__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 0-indexed integer array nums of size n.\n\nDefine two ar... |
find-the-divisibility-array-of-a-string | find-the-divisibility-array-of-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\nYou are given a 0-indexed string word of length n consisting of digits, ... |
split-with-minimum-sum | split-with-minimum-sum__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 a positive integer num, split it into two non-negative integers nu... |
split-with-minimum-sum | split-with-minimum-sum__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\nGiven a positive integer num, split it into two non-negative integers nu... |
count-total-number-of-colored-cells | count-total-number-of-colored-cells__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\nThere exists an infinitely large two-dimensional grid of uncolored unit ... |
count-ways-to-group-overlapping-ranges | count-ways-to-group-overlapping-ranges__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 a 2D integer array ranges where ranges[i] = [starti, endi]... |
count-ways-to-group-overlapping-ranges | count-ways-to-group-overlapping-ranges__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 given a 2D integer array ranges where ranges[i] = [starti, endi]... |
pass-the-pillow | pass-the-pillow__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\nThere are n people standing in a line labeled from 1 to n. The first per... |
pass-the-pillow | pass-the-pillow__02__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\nThere are n people standing in a line labeled from 1 to n. The first per... |
split-the-array-to-make-coprime-products | split-the-array-to-make-coprime-products__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 0-indexed integer array nums of length n.\n\nA split at ... |
number-of-ways-to-earn-points | number-of-ways-to-earn-points__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 is a test that has n types of questions. You are given an integer ... |
count-the-number-of-vowel-strings-in-range | count-the-number-of-vowel-strings-in-range__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 0-indexed array of string words and two integers left an... |
rearrange-array-to-maximize-prefix-score | rearrange-array-to-maximize-prefix-score__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 0-indexed integer array nums. You can rearrange the elem... |
count-the-number-of-beautiful-subarrays | count-the-number-of-beautiful-subarrays__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 0-indexed integer array nums. In one operation, you can:... |
minimum-time-to-complete-all-tasks | minimum-time-to-complete-all-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\nThere is a computer that can run an unlimited number of tasks at the sam... |
distribute-money-to-maximum-children | distribute-money-to-maximum-children__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 integer money denoting the amount of money (in dollars)... |
maximize-greatness-of-an-array | maximize-greatness-of-an-array__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 0-indexed integer array nums. You are allowed to permute... |
find-score-of-an-array-after-marking-all-elements | find-score-of-an-array-after-marking-all-elements__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 given an array nums consisting of positive integers.\n\nStarting... |
number-of-even-and-odd-bits | number-of-even-and-odd-bits__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 a positive integer n.\n\nLet even denote the number of eve... |
number-of-even-and-odd-bits | number-of-even-and-odd-bits__02__python | Bit Manipulation | 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 positive integer n.\n\nLet even denote the number of eve... |
the-number-of-beautiful-subsets | the-number-of-beautiful-subsets__01__python | Backtracking | 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 positive integers and a positive integer ... |
smallest-missing-non-negative-integer-after-operations | smallest-missing-non-negative-integer-after-operations__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 0-indexed integer array nums and an integer value.\n\nIn... |
k-items-with-the-maximum-sum | k-items-with-the-maximum-sum__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\nThere is a bag that consists of items, each item has a number 1, 0, or -... |
collect-coins-in-a-tree | collect-coins-in-a-tree__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\nThere exists an undirected and unrooted tree with n nodes indexed from 0... |
form-smallest-number-from-two-digit-arrays | form-smallest-number-from-two-digit-arrays__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 unique digits nums1 and nums2, return the smallest n... |
form-smallest-number-from-two-digit-arrays | form-smallest-number-from-two-digit-arrays__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 unique digits nums1 and nums2, return the smallest n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.