slug stringlengths 3 79 | solution_id stringlengths 13 89 | primary_algorithm stringclasses 22
values | verified null | messages listlengths 3 3 |
|---|---|---|---|---|
split-array-largest-sum | split-array-largest-sum__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums and an integer k, split nums into k non-empty ... |
minimum-unique-word-abbreviation | minimum-unique-word-abbreviation__01__java | Backtracking | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nA string can be abbreviated by replacing any number of non-adjacent substr... |
fizz-buzz | fizz-buzz__01__java | Math | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer n, return a string array answer (1-indexed) where:\n\n\ta... |
arithmetic-slices | arithmetic-slices__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nAn integer array is called arithmetic if it consists of at least three ele... |
third-maximum-number | third-maximum-number__01__java | Sorting | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return the third distinct maximum number in t... |
add-strings | add-strings__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven two non-negative integers, num1 and num2 represented as string, retu... |
partition-equal-subset-sum | partition-equal-subset-sum__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return true if you can partition the array in... |
partition-equal-subset-sum | partition-equal-subset-sum__02__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return true if you can partition the array in... |
pacific-atlantic-water-flow | pacific-atlantic-water-flow__01__java | BFS | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nThere is an m x n rectangular island that borders both the Pacific Ocean a... |
sentence-screen-fitting | sentence-screen-fitting__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven a rows x cols screen and a sentence represented as a list of strings... |
battleships-in-a-board | battleships-in-a-board__01__java | DFS | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an m x n matrix board where each cell is a battleship 'X' or empty '... |
strong-password-checker | strong-password-checker__01__java | Greedy | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nA password is considered strong if the below conditions are all met:\n\n\t... |
maximum-xor-of-two-numbers-in-an-array | maximum-xor-of-two-numbers-in-an-array__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return the maximum result of nums[i] XOR nums... |
valid-word-square | valid-word-square__01__java | Array | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array of strings words, return true if it forms a valid word squa... |
reconstruct-original-digits-from-english | reconstruct-original-digits-from-english__01__java | Math | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven a string s containing an out-of-order English representation of digi... |
longest-repeating-character-replacement | longest-repeating-character-replacement__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given a string s and an integer k. You can choose any character of... |
word-squares | word-squares__01__java | Backtracking | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array of unique strings words, return all the word squares you ca... |
convert-binary-search-tree-to-sorted-doubly-linked-list | convert-binary-search-tree-to-sorted-doubly-linked-list__01__java | DFS | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nConvert a Binary Search Tree to a sorted Circular Doubly-Linked List in pl... |
construct-quad-tree | construct-quad-tree__01__java | Divide and Conquer | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven a n * n matrix grid of 0's and 1's only. We want to represent grid w... |
serialize-and-deserialize-n-ary-tree | serialize-and-deserialize-n-ary-tree__01__java | DFS | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nSerialization is the process of converting a data structure or object into... |
n-ary-tree-level-order-traversal | n-ary-tree-level-order-traversal__01__java | BFS | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an n-ary tree, return the level order traversal of its nodes' values... |
n-ary-tree-level-order-traversal | n-ary-tree-level-order-traversal__02__java | DFS | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an n-ary tree, return the level order traversal of its nodes' values... |
flatten-a-multilevel-doubly-linked-list | flatten-a-multilevel-doubly-linked-list__01__java | DFS | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given a doubly linked list, which contains nodes that have a next ... |
encode-n-ary-tree-to-binary-tree | encode-n-ary-tree-to-binary-tree__01__java | Recursion | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nDesign an algorithm to encode an N-ary tree into a binary tree and decode ... |
all-oone-data-structure | all-oone-data-structure__01__java | Linked List | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nDesign a data structure to store the strings' count with the ability to re... |
minimum-genetic-mutation | minimum-genetic-mutation__01__java | BFS | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nA gene string can be represented by an 8-character long string, with choic... |
number-of-segments-in-a-string | number-of-segments-in-a-string__01__java | String | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven a string s, return the number of segments in the string.\n\nA segmen... |
number-of-segments-in-a-string | number-of-segments-in-a-string__02__java | Math | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven a string s, return the number of segments in the string.\n\nA segmen... |
non-overlapping-intervals | non-overlapping-intervals__01__java | Greedy | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array of intervals intervals where intervals[i] = [starti, endi],... |
find-right-interval | find-right-interval__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given an array of intervals, where intervals[i] = [starti, endi] a... |
path-sum-iii | path-sum-iii__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven the root of a binary tree and an integer targetSum, return the numbe... |
find-all-anagrams-in-a-string | find-all-anagrams-in-a-string__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven two strings s and p, return an array of all the start indices of p's... |
find-all-anagrams-in-a-string | find-all-anagrams-in-a-string__02__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven two strings s and p, return an array of all the start indices of p's... |
ternary-expression-parser | ternary-expression-parser__01__java | Recursion | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven a string expression representing arbitrarily nested ternary expressi... |
k-th-smallest-in-lexicographical-order | k-th-smallest-in-lexicographical-order__01__java | Greedy | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven two integers n and k, return the kth lexicographically smallest inte... |
arranging-coins | arranging-coins__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nYou have n coins and you want to build a staircase with these coins. The s... |
arranging-coins | arranging-coins__02__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nYou have n coins and you want to build a staircase with these coins. The s... |
find-all-duplicates-in-an-array | find-all-duplicates-in-an-array__01__java | Sorting | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums of length n where all the integers of nums are... |
string-compression | string-compression__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array of characters chars, compress it using the following algori... |
sequence-reconstruction | sequence-reconstruction__01__java | Sorting | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given an integer array nums of length n where nums is a permutatio... |
add-two-numbers-ii | add-two-numbers-ii__01__java | Math | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given two non-empty linked lists representing two non-negative int... |
arithmetic-slices-ii-subsequence | arithmetic-slices-ii-subsequence__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return the number of all the arithmetic subse... |
number-of-boomerangs | number-of-boomerangs__01__java | Math | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given n points in the plane that are all distinct, where points[i]... |
number-of-boomerangs | number-of-boomerangs__02__java | Math | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given n points in the plane that are all distinct, where points[i]... |
find-all-numbers-disappeared-in-an-array | find-all-numbers-disappeared-in-an-array__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array nums of n integers where nums[i] is in the range [1, n], re... |
find-all-numbers-disappeared-in-an-array | find-all-numbers-disappeared-in-an-array__02__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array nums of n integers where nums[i] is in the range [1, n], re... |
serialize-and-deserialize-bst | serialize-and-deserialize-bst__01__java | DFS | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nSerialization is converting a data structure or object into a sequence of ... |
delete-node-in-a-bst | delete-node-in-a-bst__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven a root node reference of a BST and a key, delete the node with the g... |
sort-characters-by-frequency | sort-characters-by-frequency__01__java | Sorting | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven a string s, sort it in decreasing order based on the frequency of th... |
minimum-number-of-arrows-to-burst-balloons | minimum-number-of-arrows-to-burst-balloons__01__java | Greedy | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nThere are some spherical balloons taped onto a flat wall that represents t... |
minimum-moves-to-equal-array-elements | minimum-moves-to-equal-array-elements__01__java | Math | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums of size n, return the minimum number of moves ... |
4sum-ii | 4sum-ii__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven four integer arrays nums1, nums2, nums3, and nums4 all of length n, ... |
assign-cookies | assign-cookies__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nAssume you are an awesome parent and want to give your children some cooki... |
132-pattern | 132-pattern__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array of n integers nums, a 132 pattern is a subsequence of three... |
132-pattern | 132-pattern__02__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array of n integers nums, a 132 pattern is a subsequence of three... |
circular-array-loop | circular-array-loop__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are playing a game involving a circular array of non-zero integers num... |
poor-pigs | poor-pigs__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nThere are buckets buckets of liquid, where exactly one of the buckets is p... |
repeated-substring-pattern | repeated-substring-pattern__01__java | String | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven a string s, check if it can be constructed by taking a substring of ... |
lfu-cache | lfu-cache__01__java | Linked List | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nDesign and implement a data structure for a Least Frequently Used (LFU) ca... |
hamming-distance | hamming-distance__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nThe Hamming distance between two integers is the number of positions at wh... |
minimum-moves-to-equal-array-elements-ii | minimum-moves-to-equal-array-elements-ii__01__java | Sorting | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums of size n, return the minimum number of moves ... |
island-perimeter | island-perimeter__01__java | DFS | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given row x col grid representing a map where grid[i][j] = 1 repre... |
can-i-win | can-i-win__01__java | Memoization | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nIn the \"100 game\" two players take turns adding, to a running total, any... |
optimal-account-balancing | optimal-account-balancing__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given an array of transactions transactions where transactions[i] ... |
count-the-repetitions | count-the-repetitions__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nWe define str = [s, n] as the string str which consists of the string s co... |
unique-substrings-in-wraparound-string | unique-substrings-in-wraparound-string__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nWe define the string base to be the infinite wraparound string of \"abcdef... |
validate-ip-address | validate-ip-address__01__java | Math | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven a string queryIP, return \"IPv4\" if IP is a valid IPv4 address, \"I... |
convex-polygon | convex-polygon__01__java | Math | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given an array of points on the X-Y plane points where points[i] =... |
implement-rand10-using-rand7 | implement-rand10-using-rand7__01__java | Math | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven the API rand7() that generates a uniform random integer in the range... |
encode-string-with-shortest-length | encode-string-with-shortest-length__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven a string s, encode the string such that its encoded length is the sh... |
concatenated-words | concatenated-words__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an array of strings words (without duplicates), return all the conca... |
matchsticks-to-square | matchsticks-to-square__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given an integer array matchsticks where matchsticks[i] is the len... |
ones-and-zeroes | ones-and-zeroes__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given an array of binary strings strs and two integers m and n.\n\... |
ones-and-zeroes | ones-and-zeroes__02__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given an array of binary strings strs and two integers m and n.\n\... |
heaters | heaters__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nWinter is coming! During the contest, your first job is to design a standa... |
number-complement | number-complement__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nThe complement of an integer is the integer you get when you flip all the ... |
total-hamming-distance | total-hamming-distance__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nThe Hamming distance between two integers is the number of positions at wh... |
largest-palindrome-product | largest-palindrome-product__01__java | Math | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer n, return the largest palindromic integer that can be rep... |
sliding-window-median | sliding-window-median__01__java | Heap | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nThe median is the middle value in an ordered integer list. If the size of ... |
sliding-window-median | sliding-window-median__02__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nThe median is the middle value in an ordered integer list. If the size of ... |
magical-string | magical-string__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nA magical string s consists of only '1' and '2' and obeys the following ru... |
license-key-formatting | license-key-formatting__01__java | Math | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given a license key represented as a string s that consists of onl... |
smallest-good-base | smallest-good-base__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer n represented as a string, return the smallest good base ... |
find-permutation | find-permutation__01__java | Greedy | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nA permutation perm of n integers of all the integers in the range [1, n] c... |
max-consecutive-ones | max-consecutive-ones__01__java | Array | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven a binary array nums, return the maximum number of consecutive 1's in... |
predict-the-winner | predict-the-winner__01__java | Memoization | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given an integer array nums. Two players are playing a game with t... |
predict-the-winner | predict-the-winner__02__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given an integer array nums. Two players are playing a game with t... |
max-consecutive-ones-ii | max-consecutive-ones-ii__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven a binary array nums, return the maximum number of consecutive 1's in... |
zuma-game | zuma-game__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are playing a variation of the game Zuma.\n\nIn this variation of Zuma... |
robot-room-cleaner | robot-room-cleaner__01__java | Backtracking | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are controlling a robot that is located somewhere in a room. The room ... |
the-maze | the-maze__01__java | DFS | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nThere is a ball in a maze with empty spaces (represented as 0) and walls (... |
the-maze | the-maze__02__java | DFS | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nThere is a ball in a maze with empty spaces (represented as 0) and walls (... |
non-decreasing-subsequences | non-decreasing-subsequences__01__java | Backtracking | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return all the different possible non-decreas... |
construct-the-rectangle | construct-the-rectangle__01__java | Math | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nA web developer needs to know how to design a web page's size. So, given a... |
reverse-pairs | reverse-pairs__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return the number of reverse pairs in the arr... |
reverse-pairs | reverse-pairs__02__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return the number of reverse pairs in the arr... |
reverse-pairs | reverse-pairs__03__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nGiven an integer array nums, return the number of reverse pairs in the arr... |
target-sum | target-sum__01__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given an integer array nums and an integer target.\n\nYou want to ... |
target-sum | target-sum__02__java | 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 Java solution."
},
{
"role": "user",
"content": "### Problem\nYou are given an integer array nums and an integer target.\n\nYou want to ... |
teemo-attacking | teemo-attacking__01__java | Array | null | [
{
"role": "system",
"content": "You are a competitive programming assistant. Given a problem, its examples, and a required algorithm/technique, write a correct Java solution."
},
{
"role": "user",
"content": "### Problem\nOur hero Teemo is attacking an enemy Ashe with poison attacks! When Teemo ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.