slug
stringlengths
4
77
solution_id
stringlengths
16
89
primary_algorithm
stringclasses
22 values
verified
bool
1 class
messages
listlengths
3
3
minimum-swaps-to-move-zeros-to-end
minimum-swaps-to-move-zeros-to-end__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 integer array nums.\n\nIn one operation, you can choose...
minimum-operations-to-make-array-modulo-alternating-i
minimum-operations-to-make-array-modulo-alternating-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 an integer array nums and an integer k.\n\nIn one operatio...
limit-occurrences-in-sorted-array
limit-occurrences-in-sorted-array__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 sorted integer array nums and an integer k.\n\nReturn an...
password-strength
password-strength__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 password.\n\nThe strength of the password is calc...
minimum-operations-to-sort-a-permutation
minimum-operations-to-sort-a-permutation__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 of length n, where nums is a permuta...
digit-frequency-score
digit-frequency-score__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.\n\nThe score of n is defined as the sum of d...
maximum-number-of-items-from-sale-i
maximum-number-of-items-from-sale-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 a 2D integer array items, where items[i] = [factori, price...
exactly-one-consecutive-set-bits-pair
exactly-one-consecutive-set-bits-pair__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.\n\nReturn true if its binary representation ...
minimum-energy-to-maintain-brightness
minimum-energy-to-maintain-brightness__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 n, representing n light bulbs arranged in a lin...
sum-of-compatible-numbers-in-range-i
sum-of-compatible-numbers-in-range-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 two integers n and k.\n\nA positive integer x is called co...
valid-binary-strings-with-cost-limit
valid-binary-strings-with-cost-limit__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 integers n and k.\n\nThe cost of a binary string s is ...
minimum-cost-to-split-into-ones-ii
minimum-cost-to-split-into-ones-ii__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.\n\nIn one operation, you may split an intege...
check-good-integer
check-good-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\nYou are given a positive integer n.\n\nLet digitSum be the sum of the di...
frequency-balance-subarray
frequency-balance-subarray__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.\n\nDefine a frequency balanc...
maximize-sum-of-device-ratings
maximize-sum-of-device-ratings__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 units of size m × n where units[i...
minimum-lights-to-illuminate-a-road
minimum-lights-to-illuminate-a-road__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 integer array lights of length n, representing position...
finish-time-of-tasks-i
finish-time-of-tasks-i__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 integer n representing the number of tasks in a project...
maximum-manhattan-distance-after-all-moves
maximum-manhattan-distance-after-all-moves__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 moves consisting of the characters 'U', 'D', 'L',...
valid-subarrays-with-matching-sum-digits-i
valid-subarrays-with-matching-sum-digits-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 an integer array nums and an integer digit x.\n\nA subarra...
maximum-total-sum-of-k-selected-elements
maximum-total-sum-of-k-selected-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 and two integers k and mul.\n\nSelec...
filter-occupied-intervals
filter-occupied-intervals__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 occupiedIntervals, where occupiedInterv...
maximum-subarray-sum-after-multiplier
maximum-subarray-sum-after-multiplier__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\nYou mus...