slug stringlengths 4 77 | solution_id stringlengths 16 89 | primary_algorithm stringclasses 22
values | verified bool 1
class | messages listlengths 3 3 |
|---|---|---|---|---|
minimum-number-of-chairs-in-a-waiting-room | minimum-number-of-chairs-in-a-waiting-room__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. Simulate events at each second i:\n\n\tIf s[i]... |
count-days-without-meetings | count-days-without-meetings__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 days representing the total number of d... |
clear-digits | clear-digits__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.\n\nYour task is to remove all digits by doing ... |
find-the-maximum-length-of-a-good-subsequence-i | find-the-maximum-length-of-a-good-subsequence-i__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 a non-negative integer k. A sequ... |
find-the-maximum-length-of-a-good-subsequence-i | find-the-maximum-length-of-a-good-subsequence-i__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 integer array nums and a non-negative integer k. A sequ... |
find-the-maximum-length-of-a-good-subsequence-ii | find-the-maximum-length-of-a-good-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\nYou are given an integer array nums and a non-negative integer k. A sequ... |
find-the-child-who-has-the-ball-after-k-seconds | find-the-child-who-has-the-ball-after-k-seconds__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 positive integers n and k. There are n children number... |
find-the-n-th-value-after-k-seconds | find-the-n-th-value-after-k-seconds__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 integers n and k.\n\nInitially, you start with an arra... |
maximum-total-reward-using-operations-i | maximum-total-reward-using-operations-i__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 integer array rewardValues of length n, representing th... |
maximum-total-reward-using-operations-i | maximum-total-reward-using-operations-i__03__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 rewardValues of length n, representing th... |
maximum-total-reward-using-operations-ii | maximum-total-reward-using-operations-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\nYou are given an integer array rewardValues of length n, representing th... |
the-number-of-ways-to-make-the-sum | the-number-of-ways-to-make-the-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\nYou have an infinite number of coins with values 1, 2, and 6, and only 2... |
the-number-of-ways-to-make-the-sum | the-number-of-ways-to-make-the-sum__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 have an infinite number of coins with values 1, 2, and 6, and only 2... |
count-pairs-that-form-a-complete-day-i | count-pairs-that-form-a-complete-day-i__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 integer array hours representing times in hours, return an inte... |
count-pairs-that-form-a-complete-day-ii | count-pairs-that-form-a-complete-day-ii__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 integer array hours representing times in hours, return an inte... |
peaks-in-array | peaks-in-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\nA peak in an array arr is an element that is greater than its previous a... |
minimum-moves-to-get-a-peaceful-board | minimum-moves-to-get-a-peaceful-board__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 2D array rooks of length n, where rooks[i] = [xi, yi] indicates ... |
find-minimum-operations-to-make-all-elements-divisible-by-three | find-minimum-operations-to-make-all-elements-divisible-by-three__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. In one operation, you can add or su... |
minimum-operations-to-make-binary-array-elements-equal-to-one-i | minimum-operations-to-make-binary-array-elements-equal-to-one-i__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 array nums.\n\nYou can do the following operation... |
minimum-operations-to-make-binary-array-elements-equal-to-one-ii | minimum-operations-to-make-binary-array-elements-equal-to-one-ii__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 array nums.\n\nYou can do the following operation... |
count-the-number-of-inversions | count-the-number-of-inversions__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 n and a 2D array requirements, where requiremen... |
minimum-average-of-smallest-and-largest-elements | minimum-average-of-smallest-and-largest-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\nYou have an array of floating point numbers averages which is initially ... |
find-the-minimum-area-to-cover-all-ones-i | find-the-minimum-area-to-cover-all-ones-i__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 2D binary array grid. Find a rectangle with horizontal a... |
find-the-minimum-area-to-cover-all-ones-ii | find-the-minimum-area-to-cover-all-ones-ii__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 2D binary array grid. You need to find 3 non-overlapping... |
count-triplets-with-even-xor-set-bits-i | count-triplets-with-even-xor-set-bits-i__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 three integer arrays a, b, and c, return the number of triplets (a... |
maximum-height-of-a-triangle | maximum-height-of-a-triangle__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 integers red and blue representing the count of red an... |
find-the-maximum-length-of-valid-subsequence-ii | find-the-maximum-length-of-valid-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\nYou are given an integer array nums and a positive integer k.\n\nA subse... |
maximum-array-hopping-score-i | maximum-array-hopping-score-i__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\nGiven an array nums, you have to get the maximum score starting from ind... |
maximum-array-hopping-score-i | maximum-array-hopping-score-i__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 nums, you have to get the maximum score starting from ind... |
maximum-array-hopping-score-i | maximum-array-hopping-score-i__03__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 nums, you have to get the maximum score starting from ind... |
alternating-groups-i | alternating-groups-i__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\nThere is a circle of red and blue tiles. You are given an array of integ... |
maximum-points-after-enemy-battles | maximum-points-after-enemy-battles__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 enemyEnergies denoting the energy values ... |
alternating-groups-ii | alternating-groups-ii__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\nThere is a circle of red and blue tiles. You are given an array of integ... |
number-of-subarrays-with-and-value-of-k | number-of-subarrays-with-and-value-of-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\nGiven an array of integers nums and an integer k, return the number of s... |
find-the-encrypted-string | find-the-encrypted-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 string s and an integer k. Encrypt the string using the ... |
generate-binary-strings-without-adjacent-zeros | generate-binary-strings-without-adjacent-zeros__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.\n\nA binary string x is valid if all... |
count-submatrices-with-equal-frequency-of-x-and-y | count-submatrices-with-equal-frequency-of-x-and-y__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 a 2D character matrix grid, where grid[i][j] is either 'X', 'Y', o... |
construct-string-with-minimum-cost | construct-string-with-minimum-cost__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 target, an array of strings words, and an integer... |
count-triplets-with-even-xor-set-bits-ii | count-triplets-with-even-xor-set-bits-ii__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 three integer arrays a, b, and c, return the number of triplets (a... |
minimum-cost-for-cutting-cake-i | minimum-cost-for-cutting-cake-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\nThere is an m x n cake that needs to be cut into 1 x 1 pieces.\n\nYou ar... |
minimum-cost-for-cutting-cake-ii | minimum-cost-for-cutting-cake-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\nThere is an m x n cake that needs to be cut into 1 x 1 pieces.\n\nYou ar... |
maximum-array-hopping-score-ii | maximum-array-hopping-score-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\nGiven an array nums, you have to get the maximum score starting from ind... |
find-the-winning-player-in-coin-game | find-the-winning-player-in-coin-game__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 positive integers x and y, denoting the number of coin... |
minimum-length-of-string-after-operations | minimum-length-of-string-after-operations__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 s.\n\nYou can perform the following process on s ... |
number-of-bit-changes-to-make-two-integers-equal | number-of-bit-changes-to-make-two-integers-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 positive integers n and k.\n\nYou can choose any bit i... |
vowels-game-in-a-string | vowels-game-in-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\nAlice and Bob are playing a game on a string.\n\nYou are given a string ... |
maximum-number-of-operations-to-move-ones-to-the-end | maximum-number-of-operations-to-move-ones-to-the-end__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 s.\n\nYou can perform the following operat... |
minimum-operations-to-make-array-equal-to-target | minimum-operations-to-make-array-equal-to-target__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 two positive integer arrays nums and target, of the same l... |
minimum-number-of-increasing-subsequence-to-be-removed | minimum-number-of-increasing-subsequence-to-be-removed__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 array of integers nums, you are allowed to perform the followin... |
find-if-digit-game-can-be-won | find-if-digit-game-can-be-won__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 array of positive integers nums.\n\nAlice and Bob are p... |
count-the-number-of-substrings-with-dominant-ones | count-the-number-of-substrings-with-dominant-ones__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 binary string s.\n\nReturn the number of substrings with... |
check-if-the-rectangle-corner-is-reachable | check-if-the-rectangle-corner-is-reachable__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 two positive integers xCorner and yCorner, and a 2D array ... |
alt-and-tab-simulation | alt-and-tab-simulation__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\nThere are n windows open numbered from 1 to n, we want to simulate using... |
find-the-number-of-winning-players | find-the-number-of-winning-players__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 n representing the number of players in a game ... |
minimum-number-of-flips-to-make-binary-grid-palindromic-i | minimum-number-of-flips-to-make-binary-grid-palindromic-i__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 an m x n binary matrix grid.\n\nA row or column is conside... |
minimum-number-of-flips-to-make-binary-grid-palindromic-ii | minimum-number-of-flips-to-make-binary-grid-palindromic-ii__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 an m x n binary matrix grid.\n\nA row or column is conside... |
shortest-distance-after-road-addition-queries-i | shortest-distance-after-road-addition-queries-i__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 an integer n and a 2D integer array queries.\n\nThere are ... |
shortest-distance-after-road-addition-queries-ii | shortest-distance-after-road-addition-queries-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 an integer n and a 2D integer array queries.\n\nThere are ... |
number-of-subsequences-with-odd-sum | number-of-subsequences-with-odd-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\nGiven an array nums, return the number of subsequences with an odd sum o... |
snake-in-matrix | snake-in-matrix__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 snake in an n x n matrix grid and can move in four possible d... |
count-the-number-of-good-nodes | count-the-number-of-good-nodes__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\nThere is an undirected tree with n nodes labeled from 0 to n - 1, and ro... |
construct-string-with-minimum-cost-easy | construct-string-with-minimum-cost-easy__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 a string target, an array of strings words, and an integer... |
count-substrings-that-satisfy-k-constraint-i | count-substrings-that-satisfy-k-constraint-i__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 binary string s and an integer k.\n\nA binary string sat... |
count-substrings-that-satisfy-k-constraint-ii | count-substrings-that-satisfy-k-constraint-ii__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 binary string s and an integer k.\n\nYou are also given ... |
count-almost-equal-pairs-i | count-almost-equal-pairs-i__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 array nums consisting of positive integers.\n\nWe call ... |
count-almost-equal-pairs-ii | count-almost-equal-pairs-ii__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\nAttention: In this version, the number of operations that can be perform... |
constructing-two-increasing-arrays | constructing-two-increasing-arrays__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 2 integer arrays nums1 and nums2 consisting only of 0 and 1, your ... |
find-the-key-of-the-numbers | find-the-key-of-the-numbers__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 three positive integers num1, num2, and num3.\n\nThe key o... |
hash-divided-string | hash-divided-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 string s of length n and an integer k, where n is a mult... |
check-if-two-chessboard-squares-have-the-same-color | check-if-two-chessboard-squares-have-the-same-color__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 strings, coordinate1 and coordinate2, representing the... |
select-cells-in-grid-with-maximum-score | select-cells-in-grid-with-maximum-score__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 2D matrix grid consisting of positive integers.\n\nYou h... |
maximum-xor-score-subarray-queries | maximum-xor-score-subarray-queries__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 of n integers, and a 2D integer array querie... |
maximum-total-area-occupied-by-pistons | maximum-total-area-occupied-by-pistons__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\nThere are several pistons in an old car engine, and we want to calculate... |
convert-date-to-binary | convert-date-to-binary__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 date representing a Gregorian calendar date in th... |
maximize-score-of-numbers-in-ranges | maximize-score-of-numbers-in-ranges__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 an array of integers start and an integer d, representing ... |
maximum-number-of-moves-to-kill-all-pawns | maximum-number-of-moves-to-kill-all-pawns__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\nThere is a 50 x 50 chessboard with one knight and some pawns on it. You ... |
find-indices-of-stable-mountains | find-indices-of-stable-mountains__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\nThere are n mountains in a row, and each mountain has a height. You are ... |
find-the-maximum-sequence-value-of-array | find-the-maximum-sequence-value-of-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 are given an integer array nums and a positive integer k.\n\nThe val... |
the-two-sneaky-numbers-of-digitville | the-two-sneaky-numbers-of-digitville__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\nIn the town of Digitville, there was a list of numbers called nums conta... |
maximum-multiplication-score | maximum-multiplication-score__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 a of size 4 and another integer array b o... |
minimum-number-of-valid-strings-to-form-target-ii | minimum-number-of-valid-strings-to-form-target-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 an array of strings words and a string target.\n\nA string... |
report-spam-message | report-spam-message__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 strings message and an array of strings banned... |
count-substrings-that-can-be-rearranged-to-contain-a-string-i | count-substrings-that-can-be-rearranged-to-contain-a-string-i__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 two strings word1 and word2.\n\nA string x is called valid... |
count-substrings-that-can-be-rearranged-to-contain-a-string-ii | count-substrings-that-can-be-rearranged-to-contain-a-string-ii__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 two strings word1 and word2.\n\nA string x is called valid... |
sum-of-consecutive-subsequences | sum-of-consecutive-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\nWe call an array arr of length n consecutive if one of the following hol... |
minimum-element-after-replacement-with-digit-sum | minimum-element-after-replacement-with-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 an integer array nums.\n\nYou replace each element in nums... |
find-the-k-th-character-in-string-game-i | find-the-k-th-character-in-string-game-i__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\nAlice and Bob are playing a game. Initially, Alice has a string word = \... |
count-of-substrings-containing-every-vowel-and-k-consonants-i | count-of-substrings-containing-every-vowel-and-k-consonants-i__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 word and a non-negative integer k.\n\nReturn the ... |
count-of-substrings-containing-every-vowel-and-k-consonants-ii | count-of-substrings-containing-every-vowel-and-k-consonants-ii__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 word and a non-negative integer k.\n\nReturn the ... |
find-the-k-th-character-in-string-game-ii | find-the-k-th-character-in-string-game-ii__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\nAlice and Bob are playing a game. Initially, Alice has a string word = \... |
remove-methods-from-project | remove-methods-from-project__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 maintaining a project that has n methods numbered from 0 to n - ... |
construct-the-minimum-bitwise-array-i | construct-the-minimum-bitwise-array-i__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 an array nums consisting of n prime integers.\n\nYou need ... |
construct-the-minimum-bitwise-array-ii | construct-the-minimum-bitwise-array-ii__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 an array nums consisting of n prime integers.\n\nYou need ... |
find-the-number-of-possible-ways-for-an-event | find-the-number-of-possible-ways-for-an-event__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 three integers n, x, and y.\n\nAn event is being held for ... |
k-th-largest-perfect-subtree-size-in-binary-tree | k-th-largest-perfect-subtree-size-in-binary-tree__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 the root of a binary tree and an integer k.\n\nReturn an i... |
count-the-number-of-winning-sequences | count-the-number-of-winning-sequences__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\nAlice and Bob are playing a fantasy battle game consisting of n rounds w... |
count-substrings-with-k-frequency-characters-i | count-substrings-with-k-frequency-characters-i__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\nGiven a string s and an integer k, return the total number of substrings... |
minimum-division-operations-to-make-array-non-decreasing | minimum-division-operations-to-make-array-non-decreasing__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\nAny positive divisor of a natura... |
count-substrings-with-k-frequency-characters-ii | count-substrings-with-k-frequency-characters-ii__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\nGiven a string s and an integer k, return the total number of substrings... |
find-subtree-sizes-after-changes | find-subtree-sizes-after-changes__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 tree rooted at node 0 that consists of n nodes numbered ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.