slug stringlengths 4 77 | solution_id stringlengths 16 89 | primary_algorithm stringclasses 22
values | verified bool 1
class | messages listlengths 3 3 |
|---|---|---|---|---|
shortest-palindrome | shortest-palindrome__02__python | String | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nYou are given a string s. You can convert s to a palindrome by adding ch... |
kth-largest-element-in-an-array | kth-largest-element-in-an-array__01__python | Divide and Conquer | true | [
{
"role": "system",
"content": "You 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 kth largest ele... |
combination-sum-iii | combination-sum-iii__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\nFind all valid combinations of k numbers that sum up to n such that the ... |
contains-duplicate | contains-duplicate__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 an integer array nums, return true if any value appears at least t... |
the-skyline-problem | the-skyline-problem__01__python | Divide and Conquer | true | [
{
"role": "system",
"content": "You 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 city's skyline is the outer contour of the silhouette formed by all th... |
contains-duplicate-ii | contains-duplicate-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 nums and an integer k, return true if there are t... |
maximal-square | maximal-square__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 m x n binary matrix filled with 0's and 1's, find the largest s... |
count-complete-tree-nodes | count-complete-tree-nodes__01__python | Recursion | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven the root of a complete binary tree, return the number of the nodes... |
count-complete-tree-nodes | count-complete-tree-nodes__02__python | Binary Search | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven the root of a complete binary tree, return the number of the nodes... |
rectangle-area | rectangle-area__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 the coordinates of two rectilinear rectangles in a 2D plane, retur... |
basic-calculator | basic-calculator__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 string s representing a valid expression, implement a basic calc... |
invert-binary-tree | invert-binary-tree__01__python | Recursion | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven the root of a binary tree, invert the tree, and return its root.\n... |
basic-calculator-ii | basic-calculator-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\nGiven a string s which represents an expression, evaluate this expressio... |
summary-ranges | summary-ranges__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 unique integer array nums.\n\nA range [a,b] is th... |
kth-smallest-element-in-a-bst | kth-smallest-element-in-a-bst__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\nGiven the root of a binary search tree, and an integer k, return the kth... |
kth-smallest-element-in-a-bst | kth-smallest-element-in-a-bst__02__python | DFS | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven the root of a binary search tree, and an integer k, return the kth... |
number-of-digit-one | number-of-digit-one__01__python | Dynamic Programming | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer n, count the total number of digit 1 appearing in all n... |
palindrome-linked-list | palindrome-linked-list__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 the head of a singly linked list, return true if it is a palindrom... |
product-of-array-except-self | product-of-array-except-self__01__python | Array | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return an array answer such that answer[i] ... |
sliding-window-maximum | sliding-window-maximum__02__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 array of integers nums, there is a sliding window of si... |
search-a-2d-matrix-ii | search-a-2d-matrix-ii__02__python | Binary Search | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nWrite an efficient algorithm that searches for a value target in an m x ... |
valid-anagram | valid-anagram__01__python | Sorting | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven two strings s and t, return true if t is an anagram of s, and fals... |
valid-anagram | valid-anagram__02__python | Sorting | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven two strings s and t, return true if t is an anagram of s, and fals... |
shortest-word-distance | shortest-word-distance__01__python | Array | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array of strings wordsDict and two different strings that alrea... |
shortest-word-distance-iii | shortest-word-distance-iii__01__python | Array | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array of strings wordsDict and two strings that already exist i... |
strobogrammatic-number | strobogrammatic-number__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 a string num which represents an integer, return true if num is a ... |
strobogrammatic-number-iii | strobogrammatic-number-iii__01__python | Recursion | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven two strings low and high that represent two integers low and high ... |
count-univalue-subtrees | count-univalue-subtrees__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\nGiven the root of a binary tree, return the number of uni-value subtrees... |
meeting-rooms-ii | meeting-rooms-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 of meeting time intervals intervals where intervals[i] = ... |
meeting-rooms-ii | meeting-rooms-ii__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 an array of meeting time intervals intervals where intervals[i] = ... |
verify-preorder-sequence-in-binary-search-tree | verify-preorder-sequence-in-binary-search-tree__01__python | Recursion | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array of unique integers preorder, return true if it is the cor... |
paint-house | paint-house__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 row of n houses, where each house can be painted one of three... |
add-digits | add-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\nGiven an integer num, repeatedly add all its digits until the result has... |
3sum-smaller | 3sum-smaller__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 array of n integers nums and an integer target, find the number... |
graph-valid-tree | graph-valid-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 have a graph of n nodes labeled from 0 to n - 1. You are given an in... |
graph-valid-tree | graph-valid-tree__02__python | DFS | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nYou have a graph of n nodes labeled from 0 to n - 1. You are given an in... |
ugly-number | ugly-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\nAn ugly number is a positive integer which does not have a prime factor ... |
ugly-number-ii | ugly-number-ii__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\nAn ugly number is a positive integer whose prime factors are limited to ... |
paint-house-ii | paint-house-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\nThere are a row of n houses, each house can be painted with one of the k... |
palindrome-permutation | palindrome-permutation__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 a string s, return true if a permutation of the string could form ... |
missing-number | missing-number__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 an array nums containing n distinct numbers in the range [0, n], r... |
alien-dictionary | alien-dictionary__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 a new alien language that uses the English alphabet. However, t... |
closest-binary-search-tree-value | closest-binary-search-tree-value__01__python | Recursion | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven the root of a binary search tree and a target value, return the va... |
closest-binary-search-tree-value | closest-binary-search-tree-value__02__python | Binary Search | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven the root of a binary search tree and a target value, return the va... |
integer-to-english-words | integer-to-english-words__01__python | Math | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nConvert a non-negative integer num to its English words representation.\... |
h-index | h-index__01__python | Sorting | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array of integers citations where citations[i] is the number of... |
h-index | h-index__02__python | Sorting | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array of integers citations where citations[i] is the number of... |
h-index | h-index__03__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 of integers citations where citations[i] is the number of... |
h-index-ii | h-index-ii__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 of integers citations where citations[i] is the number of... |
wiggle-sort | wiggle-sort__01__python | Greedy | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, reorder it such that nums[0] <= nums[1] >= ... |
move-zeroes | move-zeroes__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, move all 0's to the end of it while maintai... |
walls-and-gates | walls-and-gates__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 m x n grid rooms initialized with these three possible ... |
game-of-life | game-of-life__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\nAccording to Wikipedia's article: \"The Game of Life, also known simply ... |
word-pattern | word-pattern__01__python | Hash Table | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven a pattern and a string s, find if s follows the same pattern.\n\nH... |
word-pattern-ii | word-pattern-ii__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\nGiven a pattern and a string s, return true if s matches the pattern.\n\... |
nim-game | nim-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 playing the following Nim Game with your friend:\n\n\tInitially,... |
flip-game-ii | flip-game-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 playing a Flip Game with your friend.\n\nYou are given a string ... |
flip-game-ii | flip-game-ii__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 playing a Flip Game with your friend.\n\nYou are given a string ... |
best-meeting-point | best-meeting-point__01__python | Sorting | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an m x n binary grid grid where each 1 marks the home of one frien... |
binary-tree-longest-consecutive-sequence | binary-tree-longest-consecutive-sequence__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\nGiven the root of a binary tree, return the length of the longest consec... |
bulls-and-cows | bulls-and-cows__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 playing the Bulls and Cows game with your friend.\n\nYou write d... |
longest-increasing-subsequence | longest-increasing-subsequence__01__python | Dynamic Programming | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return the length of the longest strictly i... |
smallest-rectangle-enclosing-black-pixels | smallest-rectangle-enclosing-black-pixels__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 m x n binary matrix image where 0 represents a white pi... |
best-time-to-buy-and-sell-stock-with-cooldown | best-time-to-buy-and-sell-stock-with-cooldown__01__python | Memoization | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nYou are given an array prices where prices[i] is the price of a given st... |
best-time-to-buy-and-sell-stock-with-cooldown | best-time-to-buy-and-sell-stock-with-cooldown__02__python | Dynamic Programming | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nYou are given an array prices where prices[i] is the price of a given st... |
best-time-to-buy-and-sell-stock-with-cooldown | best-time-to-buy-and-sell-stock-with-cooldown__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 array prices where prices[i] is the price of a given st... |
minimum-height-trees | minimum-height-trees__01__python | Sorting | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nA tree is an undirected graph in which any two vertices are connected by... |
sparse-matrix-multiplication | sparse-matrix-multiplication__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 sparse matrices mat1 of size m x k and mat2 of size k x n, ret... |
sparse-matrix-multiplication | sparse-matrix-multiplication__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 sparse matrices mat1 of size m x k and mat2 of size k x n, ret... |
burst-balloons | burst-balloons__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 n balloons, indexed from 0 to n - 1. Each balloon is paint... |
binary-tree-vertical-order-traversal | binary-tree-vertical-order-traversal__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\nGiven the root of a binary tree, return the vertical order traversal of ... |
binary-tree-vertical-order-traversal | binary-tree-vertical-order-traversal__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\nGiven the root of a binary tree, return the vertical order traversal of ... |
count-of-smaller-numbers-after-self | count-of-smaller-numbers-after-self__01__python | Binary Search | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return an integer array counts where counts... |
count-of-smaller-numbers-after-self | count-of-smaller-numbers-after-self__02__python | Binary Search | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return an integer array counts where counts... |
count-of-smaller-numbers-after-self | count-of-smaller-numbers-after-self__03__python | Sorting | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return an integer array counts where counts... |
remove-duplicate-letters | remove-duplicate-letters__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 string s, remove duplicate letters so that every letter appears ... |
remove-duplicate-letters | remove-duplicate-letters__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 string s, remove duplicate letters so that every letter appears ... |
shortest-distance-from-all-buildings | shortest-distance-from-all-buildings__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 m x n grid grid of values 0, 1, or 2, where:\n\n\teach ... |
maximum-product-of-word-lengths | maximum-product-of-word-lengths__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 a string array words, return the maximum value of length(word[i]) ... |
maximum-product-of-word-lengths | maximum-product-of-word-lengths__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\nGiven a string array words, return the maximum value of length(word[i]) ... |
create-maximum-number | create-maximum-number__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 lengths m and n resp... |
coin-change | coin-change__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 coins representing coins of different den... |
number-of-connected-components-in-an-undirected-graph | number-of-connected-components-in-an-undirected-graph__01__python | DFS | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nYou have a graph of n nodes. You are given an integer n and an array edg... |
number-of-connected-components-in-an-undirected-graph | number-of-connected-components-in-an-undirected-graph__02__python | DFS | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nYou have a graph of n nodes. You are given an integer n and an array edg... |
number-of-connected-components-in-an-undirected-graph | number-of-connected-components-in-an-undirected-graph__03__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 have a graph of n nodes. You are given an integer n and an array edg... |
wiggle-sort-ii | wiggle-sort-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 integer array nums, reorder it such that nums[0] < nums[1] > nu... |
wiggle-sort-ii | wiggle-sort-ii__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 an integer array nums, reorder it such that nums[0] < nums[1] > nu... |
maximum-size-subarray-sum-equals-k | maximum-size-subarray-sum-equals-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 integer array nums and an integer k, return the maximum length ... |
power-of-three | power-of-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\nGiven an integer n, return true if it is a power of three. Otherwise, re... |
power-of-three | power-of-three__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 an integer n, return true if it is a power of three. Otherwise, re... |
odd-even-linked-list | odd-even-linked-list__01__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\nGiven the head of a singly linked list, group all the nodes with odd ind... |
reconstruct-itinerary | reconstruct-itinerary__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 list of airline tickets where tickets[i] = [fromi, toi] ... |
largest-bst-subtree | largest-bst-subtree__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 the root of a binary tree, find the largest subtree, which is also... |
increasing-triplet-subsequence | increasing-triplet-subsequence__01__python | Greedy | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return true if there exists a triple of ind... |
self-crossing | self-crossing__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 integers distance.\n\nYou start at the point (... |
palindrome-pairs | palindrome-pairs__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 0-indexed array of unique strings words.\n\nA palindrome... |
house-robber-iii | house-robber-iii__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\nThe thief has found himself a new place for his thievery again. There is... |
counting-bits | counting-bits__01__python | Dynamic Programming | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer n, return an array ans of length n + 1 such that for ea... |
counting-bits | counting-bits__02__python | Dynamic Programming | true | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Python solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer n, return an array ans of length n + 1 such that for ea... |
longest-substring-with-at-most-k-distinct-characters | longest-substring-with-at-most-k-distinct-characters__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 length of the longest subs... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.