slug
stringlengths
4
75
solution_id
stringlengths
20
91
primary_algorithm
stringclasses
22 values
verified
null
messages
listlengths
3
3
unique-length-3-palindromic-subsequences
unique-length-3-palindromic-subsequences__01__javascript
Hash Table
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven a string s, return the number of unique palindromes of length ...
longest-common-subsequence-between-sorted-arrays
longest-common-subsequence-between-sorted-arrays__01__javascript
Hash Table
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven an array of integer arrays arrays where each arrays[i] is sort...
the-number-of-the-smallest-unoccupied-chair
the-number-of-the-smallest-unoccupied-chair__01__javascript
Heap
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nThere is a party where n friends numbered from 0 to n - 1 are attend...
largest-number-after-mutating-substring
largest-number-after-mutating-substring__01__javascript
Greedy
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a string num, which represents a large integer. You ar...
maximum-compatibility-score-sum
maximum-compatibility-score-sum__01__javascript
Backtracking
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nThere is a survey that consists of n questions where each question's...
three-divisors
three-divisors__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven an integer n, return true if n has exactly three positive divi...
three-divisors
three-divisors__02__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven an integer n, return true if n has exactly three positive divi...
delete-characters-to-make-fancy-string
delete-characters-to-make-fancy-string__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nA fancy string is a string where no three consecutive characters are...
maximum-matrix-sum
maximum-matrix-sum__01__javascript
Greedy
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an n x n integer matrix. You can do the following oper...
find-unique-binary-string
find-unique-binary-string__01__javascript
Backtracking
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven an array of strings nums containing n unique binary strings ea...
find-unique-binary-string
find-unique-binary-string__02__javascript
Backtracking
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven an array of strings nums containing n unique binary strings ea...
find-the-middle-index-in-array
find-the-middle-index-in-array__01__javascript
Array
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven a 0-indexed integer array nums, find the leftmost middleIndex ...
the-number-of-weak-characters-in-the-game
the-number-of-weak-characters-in-the-game__01__javascript
Sorting
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are playing a game that contains multiple characters, and each o...
number-of-pairs-of-interchangeable-rectangles
number-of-pairs-of-interchangeable-rectangles__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given n rectangles represented by a 0-indexed 2D integer arr...
final-value-of-variable-after-performing-operations
final-value-of-variable-after-performing-operations__01__javascript
Array
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nThere is a programming language with only four operations and one va...
maximum-difference-between-increasing-elements
maximum-difference-between-increasing-elements__01__javascript
Array
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven a 0-indexed integer array nums of size n, find the maximum dif...
brightest-position-on-street
brightest-position-on-street__01__javascript
Sorting
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nA perfectly straight street is represented by a number line. The str...
convert-1d-array-into-2d-array
convert-1d-array-into-2d-array__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed 1-dimensional (1D) integer array original,...
stone-game-ix
stone-game-ix__01__javascript
Greedy
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nAlice and Bob continue their games with stones. There is a row of n ...
stone-game-ix
stone-game-ix__02__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nAlice and Bob continue their games with stones. There is a row of n ...
minimum-operations-to-make-a-uni-value-grid
minimum-operations-to-make-a-uni-value-grid__01__javascript
Greedy
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 2D integer grid of size m x n and an integer x. In o...
kth-distinct-string-in-an-array
kth-distinct-string-in-an-array__01__javascript
Hash Table
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nA distinct string is a string that is present only once in an array....
vowels-of-all-substrings
vowels-of-all-substrings__01__javascript
Brute Force
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven a string word, return the sum of the number of vowels ('a', 'e...
number-of-equal-count-substrings
number-of-equal-count-substrings__01__javascript
Sliding Window
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed string s consisting of only lowercase Engl...
check-whether-two-strings-are-almost-equivalent
check-whether-two-strings-are-almost-equivalent__01__javascript
Hash Table
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nTwo strings word1 and word2 are considered almost equivalent if the ...
range-frequency-queries
range-frequency-queries__01__javascript
Binary Search
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nDesign a data structure to find the frequency of a given value in a ...
substrings-that-begin-and-end-with-the-same-letter
substrings-that-begin-and-end-with-the-same-letter__01__javascript
Hash Table
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed string s consisting of only lowercase Engl...
finding-3-digit-even-numbers
finding-3-digit-even-numbers__01__javascript
Sorting
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array digits, where each element is a digit...
step-by-step-directions-from-a-binary-tree-node-to-another
step-by-step-directions-from-a-binary-tree-node-to-another__01__javascript
DFS
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given the root of a binary tree with n nodes. Each node is u...
step-by-step-directions-from-a-binary-tree-node-to-another
step-by-step-directions-from-a-binary-tree-node-to-another__02__javascript
DFS
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given the root of a binary tree with n nodes. Each node is u...
a-number-after-a-double-reversal
a-number-after-a-double-reversal__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nReversing an integer means to reverse all its digits.\n\n\tFor examp...
destroying-asteroids
destroying-asteroids__01__javascript
Greedy
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an integer mass, which represents the original mass of...
stamping-the-grid
stamping-the-grid__01__javascript
Greedy
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an m x n binary matrix grid where each cell is either ...
minimum-swaps-to-group-all-1s-together-ii
minimum-swaps-to-group-all-1s-together-ii__02__javascript
Sliding Window
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nA swap is defined as taking two distinct positions in an array and s...
find-substring-with-given-hash-value
find-substring-with-given-hash-value__01__javascript
Sliding Window
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nThe hash of a 0-indexed string s of length k, given integers p and m...
partition-array-according-to-given-pivot
partition-array-according-to-given-pivot__02__javascript
Two Pointers
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed integer array nums and an integer pivot. R...
smallest-value-of-the-rearranged-number
smallest-value-of-the-rearranged-number__01__javascript
Sorting
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an integer num. Rearrange the digits of num such that ...
count-operations-to-obtain-zero
count-operations-to-obtain-zero__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given two non-negative integers num1 and num2.\n\nIn one ope...
count-operations-to-obtain-zero
count-operations-to-obtain-zero__03__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given two non-negative integers num1 and num2.\n\nIn one ope...
find-three-consecutive-integers-that-sum-to-a-given-number
find-three-consecutive-integers-that-sum-to-a-given-number__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven an integer num, return three consecutive integers (as a sorted...
minimum-number-of-steps-to-make-two-strings-anagram-ii
minimum-number-of-steps-to-make-two-strings-anagram-ii__01__javascript
Hash Table
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given two strings s and t. In one step, you can append any c...
most-frequent-number-following-key-in-an-array
most-frequent-number-following-key-in-an-array__01__javascript
Hash Table
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed integer array nums. You are also given an ...
sort-the-jumbled-numbers
sort-the-jumbled-numbers__01__javascript
Sorting
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed integer array mapping which represents the...
create-binary-tree-from-descriptions
create-binary-tree-from-descriptions__01__javascript
Hash Table
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 2D integer array descriptions where descriptions[i] ...
divide-array-into-equal-pairs
divide-array-into-equal-pairs__01__javascript
Bit Manipulation
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array nums consisting of 2 * n integers.\n\...
count-collisions-on-a-road
count-collisions-on-a-road__01__javascript
String
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nThere are n cars on an infinitely long road. The cars are numbered f...
maximum-points-in-an-archery-competition
maximum-points-in-an-archery-competition__01__javascript
Backtracking
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nAlice and Bob are opponents in an archery competition. The competiti...
find-the-difference-of-two-arrays
find-the-difference-of-two-arrays__01__javascript
Hash Table
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven two 0-indexed integer arrays nums1 and nums2, return a list an...
maximum-sum-score-of-array
maximum-sum-score-of-array__01__javascript
Array
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed integer array nums of length n.\n\nThe sum...
minimum-bit-flips-to-convert-number
minimum-bit-flips-to-convert-number__01__javascript
Bit Manipulation
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nA bit flip of a number x is choosing a bit in the binary representat...
find-players-with-zero-or-one-losses
find-players-with-zero-or-one-losses__01__javascript
Sorting
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array matches where matches[i] = [winneri, ...
check-if-an-array-is-consecutive
check-if-an-array-is-consecutive__01__javascript
Hash Table
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven an integer array nums, return true if nums is consecutive, oth...
maximum-product-after-k-increments
maximum-product-after-k-increments__01__javascript
Greedy
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an array of non-negative integers nums and an integer ...
calculate-digit-sum-of-a-string
calculate-digit-sum-of-a-string__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a string s consisting of digits and an integer k.\n\nA...
count-unguarded-cells-in-the-grid
count-unguarded-cells-in-the-grid__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given two integers m and n representing a 0-indexed m x n gr...
find-resultant-array-after-removing-anagrams
find-resultant-array-after-removing-anagrams__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed string array words, where words[i] consist...
greatest-english-letter-in-upper-and-lower-case
greatest-english-letter-in-upper-and-lower-case__01__javascript
Hash Table
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven a string of English letters s, return the greatest English let...
longest-binary-subsequence-less-than-or-equal-to-k
longest-binary-subsequence-less-than-or-equal-to-k__01__javascript
Greedy
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a binary string s and a positive integer k.\n\nReturn ...
find-minimum-time-to-finish-all-jobs-ii
find-minimum-time-to-finish-all-jobs-ii__01__javascript
Greedy
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given two 0-indexed integer arrays jobs and workers of equal...
the-latest-time-to-catch-a-bus
the-latest-time-to-catch-a-bus__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed integer array buses of length n, where bus...
maximum-number-of-pairs-in-array
maximum-number-of-pairs-in-array__01__javascript
Hash Table
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed integer array nums. In one operation, you ...
longest-subsequence-with-limited-sum
longest-subsequence-with-limited-sum__01__javascript
Binary Search
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array nums of length n, and an integer arra...
minimum-money-required-before-transactions
minimum-money-required-before-transactions__01__javascript
Greedy
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed 2D integer array transactions, where trans...
sum-of-prefix-scores-of-strings
sum-of-prefix-scores-of-strings__01__javascript
Trie
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an array words of size n consisting of non-empty strin...
longest-subarray-with-maximum-bitwise-and
longest-subarray-with-maximum-bitwise-and__01__javascript
Bit Manipulation
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array nums of size n.\n\nConsider a non-emp...
height-of-binary-tree-after-subtree-removal-queries
height-of-binary-tree-after-subtree-removal-queries__02__javascript
DFS
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given the root of a binary tree with n nodes. Each node is a...
count-ways-to-build-good-strings
count-ways-to-build-good-strings__02__javascript
Dynamic Programming
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven the integers zero, one, low, and high, we can construct a stri...
circular-sentence
circular-sentence__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nA sentence is a list of words that are separated by a single space w...
circular-sentence
circular-sentence__02__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nA sentence is a list of words that are separated by a single space w...
divide-players-into-teams-of-equal-skill
divide-players-into-teams-of-equal-skill__01__javascript
Sorting
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a positive integer array skill of even length n where ...
divide-players-into-teams-of-equal-skill
divide-players-into-teams-of-equal-skill__02__javascript
Two Pointers
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a positive integer array skill of even length n where ...
minimum-score-of-a-path-between-two-cities
minimum-score-of-a-path-between-two-cities__01__javascript
DFS
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a positive integer n representing n cities numbered fr...
divide-nodes-into-the-maximum-number-of-groups
divide-nodes-into-the-maximum-number-of-groups__01__javascript
BFS
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a positive integer n representing the number of nodes ...
longest-square-streak-in-an-array
longest-square-streak-in-an-array__01__javascript
Hash Table
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array nums. A subsequence of nums is called...
longest-square-streak-in-an-array
longest-square-streak-in-an-array__02__javascript
Memoization
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an integer array nums. A subsequence of nums is called...
count-vowel-strings-in-ranges
count-vowel-strings-in-ranges__02__javascript
Array
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed array of strings words and a 2D array of i...
maximum-difference-by-remapping-a-digit
maximum-difference-by-remapping-a-digit__01__javascript
Greedy
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given an integer num. You know that Bob will sneakily remap ...
minimum-time-to-visit-a-cell-in-a-grid
minimum-time-to-visit-a-cell-in-a-grid__01__javascript
Heap
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a m x n matrix grid consisting of non-negative integer...
smallest-missing-non-negative-integer-after-operations
smallest-missing-non-negative-integer-after-operations__01__javascript
Greedy
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed integer array nums and an integer value.\n...
prime-subtraction-operation
prime-subtraction-operation__02__javascript
Greedy
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed integer array nums of length n.\n\nYou can...
prime-in-diagonal
prime-in-diagonal__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed two-dimensional integer array nums.\n\nRet...
sleep
sleep__01__javascript
Brute Force
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven a positive integer millis, write an asynchronous function that...
cousins-in-binary-tree-ii
cousins-in-binary-tree-ii__02__javascript
BFS
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven the root of a binary tree, replace the value of each node in t...
allow-one-function-call
allow-one-function-call__01__javascript
Brute Force
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven a function fn, return a new function that is identical to the ...
chunk-array
chunk-array__01__javascript
Brute Force
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven an array arr and a chunk size size, return a chunked array.\n\...
neighboring-bitwise-xor
neighboring-bitwise-xor__01__javascript
Bit Manipulation
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nA 0-indexed array derived with length n is derived by computing the ...
minimum-string-length-after-removing-substrings
minimum-string-length-after-removing-substrings__01__javascript
String
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a string s consisting only of uppercase English letter...
minimum-string-length-after-removing-substrings
minimum-string-length-after-removing-substrings__02__javascript
String
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a string s consisting only of uppercase English letter...
to-be-or-not-to-be
to-be-or-not-to-be__01__javascript
Brute Force
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nWrite a function expect that helps developers test their code. It sh...
compact-object
compact-object__01__javascript
Recursion
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven an object or array obj, return a compact object.\n\nA compact ...
extra-characters-in-a-string
extra-characters-in-a-string__01__javascript
Dynamic Programming
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed string s and a dictionary of words diction...
timeout-cancellation
timeout-cancellation__01__javascript
Brute Force
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven a function fn, an array of arguments args, and a timeout t in ...
add-two-promises
add-two-promises__01__javascript
Brute Force
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven two promises promise1 and promise2, return a new promise. prom...
is-object-empty
is-object-empty__01__javascript
Brute Force
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven an object or an array, return if it is empty.\n\n\tAn empty ob...
total-distance-traveled
total-distance-traveled__01__javascript
Math
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nA truck has two fuel tanks. You are given two integers, mainTank rep...
continuous-subarrays
continuous-subarrays__02__javascript
Two Pointers
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nYou are given a 0-indexed integer array nums. A subarray of nums is ...
ways-to-express-an-integer-as-sum-of-powers
ways-to-express-an-integer-as-sum-of-powers__01__javascript
Dynamic Programming
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven two positive integers n and x.\n\nReturn the number of ways n ...
create-object-from-two-arrays
create-object-from-two-arrays__01__javascript
Brute Force
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven two arrays keysArr and valuesArr, return a new object obj. Eac...
parallel-execution-of-promises-for-individual-results-retrieval
parallel-execution-of-promises-for-individual-results-retrieval__01__javascript
Brute Force
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nGiven an array functions, return a promise promise. functions is an ...
repeat-string
repeat-string__01__javascript
Brute Force
null
[ { "role": "system", "content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct JavaScript solution." }, { "role": "user", "content": "### Problem\nWrite code that enhances all strings such that you can call the stri...