[ { "question_id": 1, "task_id": "two-sum", "drop": [], "similar": [ "3sum", "4sum", "two-sum-ii-input-array-is-sorted", "two-sum-iii-data-structure-design", "subarray-sum-equals-k", "two-sum-iv-input-is-a-bst", "two-sum-less-than-k", "max-number-of-k-sum-pairs", "count-good-meals", "count-number-of-pairs-with-absolute-difference-k", "number-of-pairs-of-strings-with-concatenation-equal-to-target", "find-all-k-distant-indices-in-an-array", "first-letter-to-appear-twice", "number-of-excellent-pairs", "number-of-arithmetic-triplets", "node-with-highest-edge-score", "check-distances-between-same-letters", "find-subarrays-with-equal-sum", "largest-positive-integer-that-exists-with-its-negative", "number-of-distinct-averages", "count-pairs-whose-sum-is-less-than-target" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums", "target" ], "tests": { "total": 80, "kept": 70, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "-10**(9) <= target <= 10**(9)" ] }, { "line": 18, "end_line": 18, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 34, "end_line": 34, "violates": [ "-10**(9) <= nums[i] <= 10**(9)", "-10**(9) <= target <= 10**(9)" ] }, { "line": 45, "end_line": 45, "violates": [ "-10**(9) <= target <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "-10**(9) <= target <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "-10**(9) <= target <= 10**(9)" ] }, { "line": 61, "end_line": 61, "violates": [ "-10**(9) <= target <= 10**(9)" ] }, { "line": 67, "end_line": 67, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "-10**(9) <= target <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "-10**(9) <= nums[i] <= 10**(9)", "-10**(9) <= target <= 10**(9)" ] } ], "unchecked_constraints": [ "Only one valid answer exists." ], "public_tests": 3, "hints": [ "A really brute force way would be to search for all possible pairs of numbers but that would be too slow. Again, it's best to try out brute force solutions just for completeness. It is from these brute force solutions that you can come up with optimizations.", "So, if we fix one of the numbers, say x, we have to scan the entire array to find the next number y which is value - x where value is the input parameter. Can we change our array somehow so that this search becomes faster?", "The second train of thought is, without changing the array, can we use additional space somehow? Like maybe a hash map to speed up the search?" ] }, { "question_id": 2, "task_id": "add-two-numbers", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "multiply-strings", "add-binary", "sum-of-two-integers", "add-strings", "add-two-numbers-ii", "add-to-array-form-of-integer", "add-two-polynomials-represented-as-linked-lists", "double-a-number-represented-as-a-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "l1", "l2" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in each linked list is in the range [1, 100].", "0 <= Node.val <= 9", "It is guaranteed that the list represents a number that does not have leading zeros." ] }, { "question_id": 3, "task_id": "longest-substring-without-repeating-characters", "drop": [], "similar": [ "longest-substring-with-at-most-two-distinct-characters", "longest-substring-with-at-most-k-distinct-characters", "subarrays-with-k-different-integers", "maximum-erasure-value", "number-of-equal-count-substrings", "minimum-consecutive-cards-to-pick-up", "longest-nice-subarray", "optimal-partition-of-string", "count-complete-subarrays-in-an-array", "find-longest-special-substring-that-occurs-thrice-ii", "find-longest-special-substring-that-occurs-thrice-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 69, "kept": 69, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s consists of English letters, digits, symbols and spaces." ], "public_tests": 3, "hints": [ "There are less than 100 unique characters. We can check all substrings with length at most 100 for example. This is a good enough approximation." ] }, { "question_id": 4, "task_id": "median-of-two-sorted-arrays", "drop": [], "similar": [ "median-of-a-row-wise-sorted-matrix" ], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 112, "kept": 108, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "-10**(6) <= nums1[i], nums2[i] <= 10**(6)" ] }, { "line": 26, "end_line": 26, "violates": [ "-10**(6) <= nums1[i], nums2[i] <= 10**(6)" ] }, { "line": 48, "end_line": 48, "violates": [ "-10**(6) <= nums1[i], nums2[i] <= 10**(6)" ] }, { "line": 75, "end_line": 75, "violates": [ "-10**(6) <= nums1[i], nums2[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 5, "task_id": "longest-palindromic-substring", "drop": [], "similar": [ "shortest-palindrome", "palindrome-permutation", "palindrome-pairs", "longest-palindromic-subsequence", "palindromic-substrings", "maximum-number-of-non-overlapping-palindrome-substrings" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 124, "kept": 124, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How can we reuse a previously computed palindrome to compute a larger palindrome?", "If \u201caba\u201d is a palindrome, is \u201cxabax\u201d a palindrome? Similarly is \u201cxabay\u201d a palindrome?", "Complexity based hint: If we use brute-force and check whether for every start and end position a substring is a palindrome we have O(n^2) start - end pairs and O(n) palindromic checks. Can we reduce the time for palindromic checks to O(1) by reusing some previous computation." ] }, { "question_id": 6, "task_id": "zigzag-conversion", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "numRows" ], "tests": { "total": 104, "kept": 86, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= s.length <= 1000" ] }, { "line": 27, "end_line": 27, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 28, "end_line": 28, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 29, "end_line": 29, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 30, "end_line": 30, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= s.length <= 1000" ] }, { "line": 38, "end_line": 38, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 50, "end_line": 50, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 60, "end_line": 60, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 64, "end_line": 64, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 67, "end_line": 67, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 74, "end_line": 74, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 75, "end_line": 75, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 79, "end_line": 79, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= s.length <= 1000" ] }, { "line": 92, "end_line": 92, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] }, { "line": 102, "end_line": 102, "violates": [ "s consists of English letters (lower-case and upper-case), ',' and '.'." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 7, "task_id": "reverse-integer", "drop": [], "similar": [ "string-to-integer-atoi", "reverse-bits", "a-number-after-a-double-reversal", "count-number-of-distinct-integers-after-reverse-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "x" ], "tests": { "total": 61, "kept": 51, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 38, "end_line": 38, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 44, "end_line": 44, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 46, "end_line": 46, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 48, "end_line": 48, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 52, "end_line": 52, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 55, "end_line": 55, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 57, "end_line": 57, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 58, "end_line": 58, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 62, "end_line": 62, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 8, "task_id": "string-to-integer-atoi", "drop": [], "similar": [ "reverse-integer", "valid-number", "check-if-numbers-are-ascending-in-a-sentence" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 185, "kept": 184, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 149, "end_line": 149, "violates": [ "s consists of English letters (lower-case and upper-case), digits (0 - 9), ' ', '+', '-', and '.'." ] } ], "unchecked_constraints": [], "public_tests": 5, "hints": [] }, { "question_id": 9, "task_id": "palindrome-number", "drop": [], "similar": [ "palindrome-linked-list", "find-palindrome-with-fixed-length", "strictly-palindromic-number", "count-symmetric-integers", "find-the-count-of-good-integers", "find-the-largest-palindrome-divisible-by-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "x" ], "tests": { "total": 61, "kept": 37, "dropped": { "constraint_violation": 24 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 22, "end_line": 22, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 23, "end_line": 23, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 24, "end_line": 24, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 26, "end_line": 26, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 27, "end_line": 27, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 28, "end_line": 28, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 30, "end_line": 30, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 31, "end_line": 31, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 32, "end_line": 32, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 37, "end_line": 37, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 38, "end_line": 38, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 39, "end_line": 39, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 40, "end_line": 40, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 41, "end_line": 41, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 44, "end_line": 44, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 46, "end_line": 46, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 50, "end_line": 50, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 54, "end_line": 54, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 57, "end_line": 57, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 58, "end_line": 58, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 59, "end_line": 59, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 60, "end_line": 60, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] }, { "line": 61, "end_line": 61, "violates": [ "-2**(31) <= x <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Beware of overflow when you reverse the integer." ], "similar_to_test": [ "3260 find-the-largest-palindrome-divisible-by-k", "3272 find-the-count-of-good-integers" ] }, { "question_id": 10, "task_id": "regular-expression-matching", "drop": [], "similar": [ "wildcard-matching" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "p" ], "tests": { "total": 151, "kept": 133, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "p contains only lowercase English letters, '.', and '*'." ] }, { "line": 16, "end_line": 16, "violates": [ "p contains only lowercase English letters, '.', and '*'." ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= p.length <= 20" ] }, { "line": 25, "end_line": 25, "violates": [ "p contains only lowercase English letters, '.', and '*'." ] }, { "line": 43, "end_line": 43, "violates": [ "p contains only lowercase English letters, '.', and '*'." ] }, { "line": 48, "end_line": 48, "violates": [ "p contains only lowercase English letters, '.', and '*'." ] }, { "line": 55, "end_line": 55, "violates": [ "p contains only lowercase English letters, '.', and '*'." ] }, { "line": 57, "end_line": 57, "violates": [ "p contains only lowercase English letters, '.', and '*'." ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= p.length <= 20" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= p.length <= 20" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= p.length <= 20" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= p.length <= 20" ] }, { "line": 115, "end_line": 115, "violates": [ "p contains only lowercase English letters, '.', and '*'." ] }, { "line": 132, "end_line": 132, "violates": [ "s contains only lowercase English letters.", "p contains only lowercase English letters, '.', and '*'." ] }, { "line": 133, "end_line": 133, "violates": [ "1 <= p.length <= 20" ] }, { "line": 139, "end_line": 139, "violates": [ "p contains only lowercase English letters, '.', and '*'." ] }, { "line": 140, "end_line": 140, "violates": [ "p contains only lowercase English letters, '.', and '*'." ] }, { "line": 148, "end_line": 148, "violates": [ "p contains only lowercase English letters, '.', and '*'." ] } ], "unchecked_constraints": [ "It is guaranteed for each appearance of the character '*', there will be a previous valid character to match." ], "public_tests": 3, "hints": [] }, { "question_id": 11, "task_id": "container-with-most-water", "drop": [], "similar": [ "trapping-rain-water", "maximum-tastiness-of-candy-basket", "house-robber-iv" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "height" ], "tests": { "total": 116, "kept": 116, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If you simulate the problem, it will be O(n^2) which is not efficient.", "Try to use two-pointers. Set one pointer to the left and one to the right of the array. Always move the pointer that points to the lower line.", "How can you calculate the amount of water at each step?" ] }, { "question_id": 12, "task_id": "integer-to-roman", "drop": [], "similar": [ "roman-to-integer", "integer-to-english-words" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 77, "kept": 77, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 13, "task_id": "roman-to-integer", "drop": [], "similar": [ "integer-to-roman" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 94, "kept": 94, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "It is guaranteed that s is a valid roman numeral in the range [1, 3999]." ], "public_tests": 3, "hints": [ "Problem is simpler to solve by working the string from back to front and using a map." ] }, { "question_id": 14, "task_id": "longest-common-prefix", "drop": [], "similar": [ "smallest-missing-integer-greater-than-sequential-prefix-sum", "find-the-length-of-the-longest-common-prefix", "longest-common-suffix-queries", "longest-common-prefix-after-at-most-one-removal" ], "flags": [], "comparison": "exact", "parameter_names": [ "strs" ], "tests": { "total": 148, "kept": 148, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3460 longest-common-prefix-after-at-most-one-removal" ] }, { "question_id": 15, "task_id": "3sum", "drop": [], "similar": [ "two-sum", "3sum-closest", "4sum", "3sum-smaller", "number-of-arithmetic-triplets", "minimum-sum-of-mountain-triplets-i", "minimum-sum-of-mountain-triplets-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 104, "kept": 104, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "So, we essentially need to find three numbers x, y, and z such that they add up to the given value. If we fix one of the numbers say x, we are left with the two-sum problem at hand!", "For the two-sum problem, if we fix one of the numbers, say x, we have to scan the entire array to find the next number y, which is value - x where value is the input parameter. Can we change our array somehow so that this search becomes faster?", "The second train of thought for two-sum is, without changing the array, can we use additional space somehow? Like maybe a hash map to speed up the search?" ] }, { "question_id": 16, "task_id": "3sum-closest", "drop": [], "similar": [ "3sum", "3sum-smaller" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 99, "kept": 98, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 58, "end_line": 58, "violates": [ "-1000 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 17, "task_id": "letter-combinations-of-a-phone-number", "drop": [], "similar": [ "generate-parentheses", "combination-sum", "binary-watch", "count-number-of-texts", "minimum-number-of-pushes-to-type-word-i", "minimum-number-of-pushes-to-type-word-ii" ], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "digits" ], "tests": { "total": 79, "kept": 75, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= digits.length <= 4" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= digits.length <= 4" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= digits.length <= 4" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= digits.length <= 4" ] } ], "unchecked_constraints": [ "digits[i] is a digit in the range ['2', '9']." ], "public_tests": 2, "hints": [] }, { "question_id": 18, "task_id": "4sum", "drop": [], "similar": [ "two-sum", "3sum", "4sum-ii", "count-special-quadruplets" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums", "target" ], "tests": { "total": 90, "kept": 84, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "-10**(9) <= target <= 10**(9)", "-10**(9) <= target <= 10**(9)" ] }, { "line": 9, "end_line": 9, "violates": [ "-10**(9) <= target <= 10**(9)", "-10**(9) <= target <= 10**(9)" ] }, { "line": 26, "end_line": 26, "violates": [ "-10**(9) <= target <= 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "-10**(9) <= target <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "-10**(9) <= target <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 19, "task_id": "remove-nth-node-from-end-of-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "swapping-nodes-in-a-linked-list", "delete-n-nodes-after-m-nodes-of-a-linked-list", "delete-the-middle-node-of-a-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head", "n" ], "tests": { "total": 2, "kept": 0, "dropped": { "unreadable": 2 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is sz.", "1 <= sz <= 30", "0 <= Node.val <= 100", "1 <= n <= sz" ] }, { "question_id": 20, "task_id": "valid-parentheses", "drop": [], "similar": [ "generate-parentheses", "longest-valid-parentheses", "remove-invalid-parentheses", "check-if-word-is-valid-after-substitutions", "check-if-a-parentheses-string-can-be-valid", "move-pieces-to-obtain-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 148, "kept": 147, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= s.length <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 5, "hints": [ "Use a stack of characters.", "When you encounter an opening bracket, push it to the top of the stack.", "When you encounter a closing bracket, check if the top of the stack was the opening for it. If yes, pop it from the stack. Otherwise, return false." ] }, { "question_id": 21, "task_id": "merge-two-sorted-lists", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "merge-k-sorted-lists", "merge-sorted-array", "sort-list", "shortest-word-distance-ii", "add-two-polynomials-represented-as-linked-lists", "longest-common-subsequence-between-sorted-arrays", "merge-two-2d-arrays-by-summing-values" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "list1", "list2" ], "tests": { "total": 1, "kept": 0, "dropped": { "unreadable": 1 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in both lists is in the range [0, 50].", "-100 <= Node.val <= 100", "Both list1 and list2 are sorted in non-decreasing order." ] }, { "question_id": 22, "task_id": "generate-parentheses", "drop": [ "too_few_tests" ], "similar": [ "letter-combinations-of-a-phone-number", "valid-parentheses", "check-if-a-parentheses-string-can-be-valid" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 8, "kept": 8, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 23, "task_id": "merge-k-sorted-lists", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "merge-two-sorted-lists", "ugly-number-ii", "smallest-subarrays-with-maximum-bitwise-or" ], "flags": [], "comparison": "exact", "parameter_names": [ "lists" ], "tests": { "total": 3, "kept": 3, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The sum of lists[i].length will not exceed 10**(4)." ] }, { "question_id": 24, "task_id": "swap-nodes-in-pairs", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "reverse-nodes-in-k-group", "swapping-nodes-in-a-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 1, "kept": 0, "dropped": { "unreadable": 1 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is in the range [0, 100].", "0 <= Node.val <= 100" ] }, { "question_id": 25, "task_id": "reverse-nodes-in-k-group", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "swap-nodes-in-pairs", "swapping-nodes-in-a-linked-list", "reverse-nodes-in-even-length-groups" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head", "k" ], "tests": { "total": 1, "kept": 0, "dropped": { "unreadable": 1 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is n.", "1 <= k <= n <= 5000", "0 <= Node.val <= 1000" ] }, { "question_id": 26, "task_id": "remove-duplicates-from-sorted-array", "drop": [ "in_place" ], "similar": [ "remove-element", "remove-duplicates-from-sorted-array-ii", "apply-operations-to-an-array", "sum-of-distances" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 127, "kept": 127, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 27, "task_id": "remove-element", "drop": [ "in_place" ], "similar": [ "remove-duplicates-from-sorted-array", "remove-linked-list-elements", "move-zeroes" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "val" ], "tests": { "total": 112, "kept": 108, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= nums[i] <= 50" ] } ], "unchecked_constraints": [] }, { "question_id": 28, "task_id": "find-the-index-of-the-first-occurrence-in-a-string", "drop": [], "similar": [ "shortest-palindrome", "repeated-substring-pattern" ], "flags": [], "comparison": "exact", "parameter_names": [ "haystack", "needle" ], "tests": { "total": 144, "kept": 132, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= haystack.length, needle.length <= 10**(4)" ] }, { "line": 19, "end_line": 19, "violates": [ "haystack and needle consist of only lowercase English characters." ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= haystack.length, needle.length <= 10**(4)" ] }, { "line": 49, "end_line": 49, "violates": [ "haystack and needle consist of only lowercase English characters." ] }, { "line": 50, "end_line": 50, "violates": [ "haystack and needle consist of only lowercase English characters." ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= haystack.length, needle.length <= 10**(4)" ] }, { "line": 86, "end_line": 86, "violates": [ "haystack and needle consist of only lowercase English characters." ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= haystack.length, needle.length <= 10**(4)" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= haystack.length, needle.length <= 10**(4)" ] }, { "line": 108, "end_line": 108, "violates": [ "haystack and needle consist of only lowercase English characters." ] }, { "line": 117, "end_line": 117, "violates": [ "haystack and needle consist of only lowercase English characters." ] }, { "line": 123, "end_line": 123, "violates": [ "haystack and needle consist of only lowercase English characters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 29, "task_id": "divide-two-integers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "dividend", "divisor" ], "tests": { "total": 135, "kept": 134, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "-2**(31) <= dividend, divisor <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 30, "task_id": "substring-with-concatenation-of-all-words", "drop": [], "similar": [ "minimum-window-substring" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "s", "words" ], "tests": { "total": 94, "kept": 94, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 31, "task_id": "next-permutation", "drop": [ "in_place", "interface" ], "similar": [ "permutations", "permutations-ii", "permutation-sequence", "palindrome-permutation-ii", "minimum-adjacent-swaps-to-reach-the-kth-smallest-number" ], "interface_problems": [ "rust: unparsed signature" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 98, "kept": 98, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 32, "task_id": "longest-valid-parentheses", "drop": [], "similar": [ "valid-parentheses" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 133, "kept": 133, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s[i] is '(', or ')'." ], "public_tests": 3, "hints": [] }, { "question_id": 33, "task_id": "search-in-rotated-sorted-array", "drop": [], "similar": [ "search-in-rotated-sorted-array-ii", "find-minimum-in-rotated-sorted-array", "pour-water-between-buckets-to-make-water-levels-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 131, "kept": 130, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 98, "end_line": 98, "violates": [ "All values of nums are unique." ] } ], "unchecked_constraints": [ "nums is an ascending array that is possibly rotated." ], "public_tests": 3, "hints": [] }, { "question_id": 34, "task_id": "find-first-and-last-position-of-element-in-sorted-array", "drop": [], "similar": [ "first-bad-version", "plates-between-candles", "find-target-indices-after-sorting-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 137, "kept": 137, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums is a non-decreasing array." ], "public_tests": 3, "hints": [] }, { "question_id": 35, "task_id": "search-insert-position", "drop": [], "similar": [ "first-bad-version", "minimum-operations-to-exceed-threshold-value-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 119, "kept": 115, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 42, "end_line": 42, "violates": [ "-10**(4) <= nums[i] <= 10**(4)", "-10**(4) <= target <= 10**(4)" ] }, { "line": 57, "end_line": 57, "violates": [ "-10**(4) <= target <= 10**(4)" ] }, { "line": 103, "end_line": 103, "violates": [ "-10**(4) <= nums[i] <= 10**(4)", "-10**(4) <= target <= 10**(4)" ] }, { "line": 113, "end_line": 113, "violates": [ "-10**(4) <= nums[i] <= 10**(4)", "-10**(4) <= target <= 10**(4)" ] } ], "unchecked_constraints": [ "nums contains distinct values sorted in ascending order." ], "public_tests": 3, "hints": [] }, { "question_id": 36, "task_id": "valid-sudoku", "drop": [], "similar": [ "sudoku-solver", "check-if-every-row-and-column-contains-all-numbers" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board" ], "tests": { "total": 19, "kept": 19, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "board[i][j] is a digit 1-9 or '.'." ], "public_tests": 2, "hints": [] }, { "question_id": 37, "task_id": "sudoku-solver", "drop": [ "in_place", "interface" ], "similar": [ "valid-sudoku", "unique-paths-iii" ], "interface_problems": [ "rust: unparsed signature" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "board" ], "tests": { "total": 22, "kept": 22, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "board[i][j] is a digit or '.'.", "It is guaranteed that the input board has only one solution." ] }, { "question_id": 38, "task_id": "count-and-say", "drop": [], "similar": [ "encode-and-decode-strings", "string-compression" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 28, "kept": 28, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Create a helper function that maps an integer to pairs of its digits and their frequencies. For example, if you call this function with \"223314444411\", then it maps it to an array of pairs [[2,2], [3,2], [1,1], [4,5], [1, 2]].", "Create another helper function that takes the array of pairs and creates a new integer. For example, if you call this function with [[2,2], [3,2], [1,1], [4,5], [1, 2]], it should create \"22\"+\"23\"+\"11\"+\"54\"+\"21\" = \"2223115421\".", "Now, with the two helper functions, you can start with \"1\" and call the two functions alternatively n-1 times. The answer is the last integer you will obtain." ] }, { "question_id": 39, "task_id": "combination-sum", "drop": [], "similar": [ "letter-combinations-of-a-phone-number", "combination-sum-ii", "combinations", "combination-sum-iii", "factor-combinations", "combination-sum-iv", "the-number-of-ways-to-make-the-sum" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "candidates", "target" ], "tests": { "total": 93, "kept": 30, "dropped": { "constraint_violation": 63 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "2 <= candidates[i] <= 40", "All elements of candidates are distinct." ] }, { "line": 11, "end_line": 11, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 17, "end_line": 17, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 18, "end_line": 18, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 22, "end_line": 22, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 23, "end_line": 23, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 24, "end_line": 24, "violates": [ "2 <= candidates[i] <= 40", "All elements of candidates are distinct." ] }, { "line": 25, "end_line": 25, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= target <= 40" ] }, { "line": 28, "end_line": 28, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 29, "end_line": 29, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 30, "end_line": 30, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 31, "end_line": 31, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= target <= 40" ] }, { "line": 33, "end_line": 33, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 34, "end_line": 34, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= target <= 40" ] }, { "line": 37, "end_line": 37, "violates": [ "2 <= candidates[i] <= 40", "2 <= candidates[i] <= 40", "1 <= target <= 40", "1 <= target <= 40" ] }, { "line": 38, "end_line": 38, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 39, "end_line": 39, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 40, "end_line": 40, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= target <= 40" ] }, { "line": 42, "end_line": 42, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 43, "end_line": 43, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= target <= 40" ] }, { "line": 45, "end_line": 45, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 46, "end_line": 46, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= target <= 40" ] }, { "line": 49, "end_line": 49, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= target <= 40" ] }, { "line": 51, "end_line": 51, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 52, "end_line": 52, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= target <= 40", "1 <= target <= 40" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= target <= 40" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= target <= 40" ] }, { "line": 56, "end_line": 56, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= target <= 40", "1 <= target <= 40" ] }, { "line": 58, "end_line": 58, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 60, "end_line": 60, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= target <= 40" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= target <= 40" ] }, { "line": 63, "end_line": 63, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= target <= 40" ] }, { "line": 65, "end_line": 65, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 66, "end_line": 66, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 67, "end_line": 67, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 71, "end_line": 71, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 73, "end_line": 73, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 75, "end_line": 75, "violates": [ "2 <= candidates[i] <= 40", "2 <= candidates[i] <= 40", "1 <= target <= 40", "1 <= target <= 40" ] }, { "line": 76, "end_line": 76, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 77, "end_line": 77, "violates": [ "2 <= candidates[i] <= 40" ] }, { "line": 78, "end_line": 78, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= target <= 40" ] }, { "line": 81, "end_line": 81, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 82, "end_line": 82, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= target <= 40" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= target <= 40" ] }, { "line": 86, "end_line": 86, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= target <= 40" ] }, { "line": 88, "end_line": 88, "violates": [ "2 <= candidates[i] <= 40", "1 <= target <= 40" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= target <= 40" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= target <= 40" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= target <= 40" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 40, "task_id": "combination-sum-ii", "drop": [], "similar": [ "combination-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "candidates", "target" ], "tests": { "total": 102, "kept": 79, "dropped": { "constraint_violation": 23 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= target <= 30" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= target <= 30" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= target <= 30" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= target <= 30" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= target <= 30" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= target <= 30" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= target <= 30" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= target <= 30", "1 <= target <= 30" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= target <= 30" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= target <= 30" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= target <= 30" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= target <= 30" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= candidates[i] <= 50", "1 <= candidates[i] <= 50", "1 <= target <= 30", "1 <= target <= 30" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= candidates[i] <= 50", "1 <= candidates[i] <= 50", "1 <= target <= 30", "1 <= target <= 30" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= target <= 30" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= target <= 30" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= target <= 30" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= target <= 30" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= target <= 30" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= candidates[i] <= 50", "1 <= target <= 30" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= target <= 30", "1 <= target <= 30" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= target <= 30" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= candidates[i] <= 50", "1 <= target <= 30" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 41, "task_id": "first-missing-positive", "drop": [], "similar": [ "missing-number", "find-the-duplicate-number", "find-all-numbers-disappeared-in-an-array", "couples-holding-hands", "smallest-number-in-infinite-set", "maximum-number-of-integers-to-choose-from-a-range-i", "smallest-missing-non-negative-integer-after-operations", "maximum-number-of-integers-to-choose-from-a-range-ii", "smallest-missing-integer-greater-than-sequential-prefix-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 126, "kept": 125, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= nums.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think about how you would solve the problem in non-constant space. Can you apply that logic to the existing space?", "We don't care about duplicates or non-positive integers", "Remember that O(2n) = O(n)" ] }, { "question_id": 42, "task_id": "trapping-rain-water", "drop": [], "similar": [ "container-with-most-water", "product-of-array-except-self", "trapping-rain-water-ii", "pour-water", "maximum-value-of-an-ordered-triplet-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "height" ], "tests": { "total": 128, "kept": 128, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 43, "task_id": "multiply-strings", "drop": [], "similar": [ "add-two-numbers", "plus-one", "add-binary", "add-strings", "apply-discount-to-prices" ], "flags": [], "comparison": "exact", "parameter_names": [ "num1", "num2" ], "tests": { "total": 71, "kept": 71, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Both num1 and num2 do not contain any leading zero, except the number 0 itself." ], "public_tests": 2, "hints": [] }, { "question_id": 44, "task_id": "wildcard-matching", "drop": [], "similar": [ "regular-expression-matching", "substring-matching-pattern" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "p" ], "tests": { "total": 209, "kept": 206, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 150, "end_line": 150, "violates": [ "s contains only lowercase English letters." ] }, { "line": 172, "end_line": 172, "violates": [ "s contains only lowercase English letters.", "p contains only lowercase English letters, '?' or '*'." ] }, { "line": 205, "end_line": 205, "violates": [ "s contains only lowercase English letters.", "p contains only lowercase English letters, '?' or '*'." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [], "similar_to_test": [ "3407 substring-matching-pattern" ] }, { "question_id": 45, "task_id": "jump-game-ii", "drop": [], "similar": [ "jump-game", "jump-game-iii", "jump-game-vii", "jump-game-viii", "minimum-number-of-visited-cells-in-a-grid", "maximum-number-of-jumps-to-reach-the-last-index", "visit-array-positions-to-maximize-score" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 44, "kept": 44, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "It's guaranteed that you can reach nums[n - 1]." ], "public_tests": 2, "hints": [] }, { "question_id": 46, "task_id": "permutations", "drop": [], "similar": [ "next-permutation", "permutations-ii", "permutation-sequence", "combinations" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums" ], "tests": { "total": 60, "kept": 45, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 8, "end_line": 8, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 14, "end_line": 14, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 15, "end_line": 15, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 18, "end_line": 18, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 25, "end_line": 25, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 26, "end_line": 26, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 30, "end_line": 30, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 33, "end_line": 33, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 38, "end_line": 38, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 39, "end_line": 39, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 40, "end_line": 40, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 48, "end_line": 48, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 49, "end_line": 49, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 58, "end_line": 58, "violates": [ "-10 <= nums[i] <= 10" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 47, "task_id": "permutations-ii", "drop": [], "similar": [ "next-permutation", "permutations", "palindrome-permutation-ii", "number-of-squareful-arrays" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums" ], "tests": { "total": 73, "kept": 72, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 57, "end_line": 57, "violates": [ "-10 <= nums[i] <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 48, "task_id": "rotate-image", "drop": [ "in_place", "interface" ], "similar": [ "determine-whether-matrix-can-be-obtained-by-rotation" ], "interface_problems": [ "rust: unparsed signature" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 41, "kept": 40, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "-1000 <= matrix[i][j] <= 1000" ] } ], "unchecked_constraints": [] }, { "question_id": 49, "task_id": "group-anagrams", "drop": [], "similar": [ "valid-anagram", "group-shifted-strings", "find-resultant-array-after-removing-anagrams", "count-anagrams" ], "flags": [ "unordered_groups" ], "comparison": "unordered_groups", "parameter_names": [ "strs" ], "tests": { "total": 69, "kept": 68, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "strs[i] consists of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 50, "task_id": "powx-n", "drop": [], "similar": [ "sqrtx", "super-pow", "count-collisions-of-monkeys-on-a-polygon" ], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "x", "n" ], "tests": { "total": 83, "kept": 78, "dropped": { "non_finite": 5 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 42, "end_line": 42, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 55, "end_line": 55, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 62, "end_line": 62, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 72, "end_line": 72, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] } ], "unchecked_constraints": [ "n is an integer.", "Either x is not zero or n > 0.", "-10**(4) <= x**(n) <= 10**(4)" ], "public_tests": 3, "hints": [] }, { "question_id": 51, "task_id": "n-queens", "drop": [ "too_few_tests" ], "similar": [ "n-queens-ii", "grid-illumination" ], "flags": [ "any_order", "figure_reference", "has_images" ], "comparison": "unordered", "parameter_names": [ "n" ], "tests": { "total": 8, "kept": 8, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 52, "task_id": "n-queens-ii", "drop": [ "too_few_tests" ], "similar": [ "n-queens" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 9, "kept": 9, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 53, "task_id": "maximum-subarray", "drop": [], "similar": [ "best-time-to-buy-and-sell-stock", "maximum-product-subarray", "degree-of-an-array", "longest-turbulent-subarray", "maximum-score-of-spliced-array", "maximum-absolute-sum-of-any-subarray", "maximum-subarray-sum-after-one-operation", "substring-with-largest-variance", "count-subarrays-with-score-less-than-k", "maximum-value-of-a-string-in-an-array", "find-the-substring-with-maximum-cost", "k-items-with-the-maximum-sum", "maximum-good-subarray-sum", "maximize-subarray-sum-after-removing-all-occurrences-of-one-element" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 98, "kept": 98, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [], "similar_to_test": [ "3410 maximize-subarray-sum-after-removing-all-occurrences-of-one-element" ] }, { "question_id": 54, "task_id": "spiral-matrix", "drop": [], "similar": [ "spiral-matrix-ii", "spiral-matrix-iii", "spiral-matrix-iv" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 53, "kept": 49, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= m, n <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= m, n <= 10" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= m, n <= 10", "-100 <= matrix[i][j] <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= m, n <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Well for some problems, the best way really is to come up with some algorithms for simulation. Basically, you need to simulate what the problem asks us to do.", "We go boundary by boundary and move inwards. That is the essential operation. First row, last column, last row, first column, and then we move inwards by 1 and repeat. That's all. That is all the simulation that we need.", "Think about when you want to switch the progress on one of the indexes. If you progress on i out of [i, j], you'll shift in the same column. Similarly, by changing values for j, you'd be shifting in the same row. Also, keep track of the end of a boundary so that you can move inwards and then keep repeating. It's always best to simulate edge cases like a single column or a single row to see if anything breaks or not." ] }, { "question_id": 55, "task_id": "jump-game", "drop": [], "similar": [ "jump-game-ii", "jump-game-iii", "jump-game-vii", "jump-game-viii", "minimum-number-of-visited-cells-in-a-grid", "largest-element-in-an-array-after-merge-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 66, "kept": 66, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 56, "task_id": "merge-intervals", "drop": [], "similar": [ "insert-interval", "meeting-rooms", "meeting-rooms-ii", "teemo-attacking", "add-bold-tag-in-string", "range-module", "employee-free-time", "partition-labels", "interval-list-intersections", "amount-of-new-area-painted-each-day", "longest-substring-of-one-repeating-character", "count-integers-in-intervals", "divide-intervals-into-minimum-number-of-groups", "determine-if-two-events-have-conflict", "count-ways-to-group-overlapping-ranges", "points-that-intersect-with-cars", "count-days-without-meetings", "minimize-connected-groups-by-inserting-interval" ], "flags": [], "comparison": "exact", "parameter_names": [ "intervals" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [], "similar_to_test": [ "3323 minimize-connected-groups-by-inserting-interval" ] }, { "question_id": 57, "task_id": "insert-interval", "drop": [], "similar": [ "merge-intervals", "range-module", "count-integers-in-intervals" ], "flags": [], "comparison": "exact", "parameter_names": [ "intervals", "newInterval" ], "tests": { "total": 166, "kept": 166, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "intervals is sorted by starti in ascending order.", "0 <= start <= end <= 10**(5)" ], "public_tests": 2, "hints": [ "Intervals Array is sorted. Can you use Binary Search to find the correct position to insert the new Interval.?", "Can you try merging the overlapping intervals while inserting the new interval?", "This can be done by comparing the end of the last interval with the start of the new interval and vice versa." ] }, { "question_id": 58, "task_id": "length-of-last-word", "drop": [ "too_few_tests" ], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 3, "kept": 3, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There will be at least one word in s." ] }, { "question_id": 59, "task_id": "spiral-matrix-ii", "drop": [], "similar": [ "spiral-matrix", "spiral-matrix-iii", "spiral-matrix-iv" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 20, "kept": 20, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 60, "task_id": "permutation-sequence", "drop": [], "similar": [ "next-permutation", "permutations" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 58, "kept": 58, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= k <= n!" ], "public_tests": 3, "hints": [] }, { "question_id": 61, "task_id": "rotate-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "rotate-array", "split-linked-list-in-parts" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head", "k" ], "tests": { "total": 4, "kept": 0, "dropped": { "unreadable": 4 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is in the range [0, 500].", "-100 <= Node.val <= 100" ] }, { "question_id": 62, "task_id": "unique-paths", "drop": [], "similar": [ "unique-paths-ii", "minimum-path-sum", "dungeon-game", "minimum-path-cost-in-a-grid", "minimum-cost-homecoming-of-a-robot-in-a-grid", "number-of-ways-to-reach-a-position-after-exactly-k-steps", "paths-in-matrix-whose-sum-is-divisible-by-k" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n" ], "tests": { "total": 55, "kept": 24, "dropped": { "int_overflow": 31 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 8, "end_line": 8, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 12, "end_line": 12, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 13, "end_line": 13, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 14, "end_line": 14, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "java" ] }, { "line": 18, "end_line": 18, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 19, "end_line": 19, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 20, "end_line": 20, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 21, "end_line": 21, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 22, "end_line": 22, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 23, "end_line": 23, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 24, "end_line": 24, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 25, "end_line": 25, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 27, "end_line": 27, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 29, "end_line": 29, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 34, "end_line": 34, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 35, "end_line": 35, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 38, "end_line": 38, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 39, "end_line": 39, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 41, "end_line": 41, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 42, "end_line": 42, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 43, "end_line": 43, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 45, "end_line": 45, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 46, "end_line": 46, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 48, "end_line": 48, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 49, "end_line": 49, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 51, "end_line": 51, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 53, "end_line": 53, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 54, "end_line": 54, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 55, "end_line": 55, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 56, "end_line": 56, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 63, "task_id": "unique-paths-ii", "drop": [], "similar": [ "unique-paths", "unique-paths-iii", "minimum-path-cost-in-a-grid", "paths-in-matrix-whose-sum-is-divisible-by-k" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "obstacleGrid" ], "tests": { "total": 102, "kept": 102, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "obstacleGrid[i][j] is 0 or 1." ], "public_tests": 2, "hints": [ "Use dynamic programming since, from each cell, you can move to the right or down.", "assume dp[i][j] is the number of unique paths to reach (i, j). dp[i][j] = dp[i][j -1] + dp[i - 1][j]. Be careful when you encounter an obstacle. set its value in dp to 0." ] }, { "question_id": 64, "task_id": "minimum-path-sum", "drop": [], "similar": [ "unique-paths", "dungeon-game", "cherry-pickup", "minimum-path-cost-in-a-grid", "maximum-number-of-points-with-cost", "minimum-cost-homecoming-of-a-robot-in-a-grid", "paths-in-matrix-whose-sum-is-divisible-by-k", "check-if-there-is-a-path-with-equal-number-of-0s-and-1s", "minimum-cost-of-a-path-with-special-roads" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 77, "kept": 74, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 42, "end_line": 42, "violates": [ "0 <= grid[i][j] <= 200" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= grid[i][j] <= 200" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= grid[i][j] <= 200" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 65, "task_id": "valid-number", "drop": [], "similar": [ "string-to-integer-atoi" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 306, "kept": 239, "dropped": { "constraint_violation": 67 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= s.length <= 20" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= s.length <= 20" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= s.length <= 20" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= s.length <= 20" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= s.length <= 20" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= s.length <= 20" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= s.length <= 20" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= s.length <= 20" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= s.length <= 20" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= s.length <= 20" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= s.length <= 20" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= s.length <= 20" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= s.length <= 20" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= s.length <= 20" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= s.length <= 20" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= s.length <= 20" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= s.length <= 20" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= s.length <= 20" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= s.length <= 20" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= s.length <= 20" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= s.length <= 20" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= s.length <= 20" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= s.length <= 20" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= s.length <= 20" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= s.length <= 20" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= s.length <= 20" ] }, { "line": 131, "end_line": 131, "violates": [ "1 <= s.length <= 20" ] }, { "line": 135, "end_line": 135, "violates": [ "1 <= s.length <= 20" ] }, { "line": 144, "end_line": 144, "violates": [ "1 <= s.length <= 20" ] }, { "line": 153, "end_line": 153, "violates": [ "1 <= s.length <= 20" ] }, { "line": 160, "end_line": 160, "violates": [ "1 <= s.length <= 20" ] }, { "line": 169, "end_line": 169, "violates": [ "1 <= s.length <= 20" ] }, { "line": 175, "end_line": 175, "violates": [ "1 <= s.length <= 20" ] }, { "line": 176, "end_line": 176, "violates": [ "1 <= s.length <= 20" ] }, { "line": 178, "end_line": 178, "violates": [ "1 <= s.length <= 20" ] }, { "line": 179, "end_line": 179, "violates": [ "1 <= s.length <= 20" ] }, { "line": 188, "end_line": 188, "violates": [ "1 <= s.length <= 20" ] }, { "line": 189, "end_line": 189, "violates": [ "1 <= s.length <= 20" ] }, { "line": 191, "end_line": 191, "violates": [ "1 <= s.length <= 20" ] }, { "line": 196, "end_line": 196, "violates": [ "1 <= s.length <= 20" ] }, { "line": 199, "end_line": 199, "violates": [ "1 <= s.length <= 20" ] }, { "line": 200, "end_line": 200, "violates": [ "s consists of only English letters (both uppercase and lowercase), digits (0-9), plus '+', minus '-', or dot '.'." ] }, { "line": 206, "end_line": 206, "violates": [ "1 <= s.length <= 20" ] }, { "line": 208, "end_line": 208, "violates": [ "1 <= s.length <= 20" ] }, { "line": 211, "end_line": 211, "violates": [ "1 <= s.length <= 20" ] }, { "line": 213, "end_line": 213, "violates": [ "1 <= s.length <= 20" ] }, { "line": 214, "end_line": 214, "violates": [ "1 <= s.length <= 20" ] }, { "line": 215, "end_line": 215, "violates": [ "1 <= s.length <= 20" ] }, { "line": 221, "end_line": 221, "violates": [ "1 <= s.length <= 20" ] }, { "line": 222, "end_line": 222, "violates": [ "1 <= s.length <= 20" ] }, { "line": 230, "end_line": 230, "violates": [ "1 <= s.length <= 20" ] }, { "line": 237, "end_line": 237, "violates": [ "1 <= s.length <= 20" ] }, { "line": 242, "end_line": 242, "violates": [ "1 <= s.length <= 20" ] }, { "line": 247, "end_line": 247, "violates": [ "1 <= s.length <= 20" ] }, { "line": 250, "end_line": 250, "violates": [ "1 <= s.length <= 20" ] }, { "line": 251, "end_line": 251, "violates": [ "1 <= s.length <= 20" ] }, { "line": 252, "end_line": 252, "violates": [ "1 <= s.length <= 20" ] }, { "line": 254, "end_line": 254, "violates": [ "1 <= s.length <= 20" ] }, { "line": 270, "end_line": 270, "violates": [ "1 <= s.length <= 20" ] }, { "line": 273, "end_line": 273, "violates": [ "1 <= s.length <= 20" ] }, { "line": 277, "end_line": 277, "violates": [ "1 <= s.length <= 20" ] }, { "line": 283, "end_line": 283, "violates": [ "1 <= s.length <= 20" ] }, { "line": 286, "end_line": 286, "violates": [ "1 <= s.length <= 20" ] }, { "line": 287, "end_line": 287, "violates": [ "1 <= s.length <= 20" ] }, { "line": 288, "end_line": 288, "violates": [ "1 <= s.length <= 20" ] }, { "line": 295, "end_line": 295, "violates": [ "1 <= s.length <= 20" ] }, { "line": 297, "end_line": 297, "violates": [ "1 <= s.length <= 20" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 66, "task_id": "plus-one", "drop": [], "similar": [ "multiply-strings", "add-binary", "plus-one-linked-list", "add-to-array-form-of-integer", "minimum-operations-to-reduce-an-integer-to-0" ], "flags": [], "comparison": "exact", "parameter_names": [ "digits" ], "tests": { "total": 77, "kept": 77, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "digits does not contain any leading 0's." ], "public_tests": 3, "hints": [] }, { "question_id": 67, "task_id": "add-binary", "drop": [], "similar": [ "add-two-numbers", "multiply-strings", "plus-one", "add-to-array-form-of-integer" ], "flags": [], "comparison": "exact", "parameter_names": [ "a", "b" ], "tests": { "total": 86, "kept": 86, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Each string does not contain leading zeros except for the zero itself." ], "public_tests": 2, "hints": [] }, { "question_id": 68, "task_id": "text-justification", "drop": [], "similar": [ "rearrange-spaces-between-words", "divide-a-string-into-groups-of-size-k", "split-message-based-on-limit" ], "flags": [], "comparison": "exact", "parameter_names": [ "words", "maxWidth" ], "tests": { "total": 108, "kept": 101, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= words[i].length <= 20", "words[i].length <= maxWidth" ] }, { "line": 50, "end_line": 50, "violates": [ "words[i].length <= maxWidth" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 95, "end_line": 95, "violates": [ "words[i].length <= maxWidth" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= words[i].length <= 20", "words[i].length <= maxWidth" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= words[i].length <= 20", "words[i].length <= maxWidth" ] } ], "unchecked_constraints": [ "words[i] consists of only English letters and symbols." ], "public_tests": 3, "hints": [] }, { "question_id": 69, "task_id": "sqrtx", "drop": [], "similar": [ "powx-n", "valid-perfect-square" ], "flags": [], "comparison": "exact", "parameter_names": [ "x" ], "tests": { "total": 67, "kept": 56, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "0 <= x <= 2**(31) - 1" ] }, { "line": 14, "end_line": 14, "violates": [ "0 <= x <= 2**(31) - 1" ] }, { "line": 15, "end_line": 15, "violates": [ "0 <= x <= 2**(31) - 1" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= x <= 2**(31) - 1" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= x <= 2**(31) - 1" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= x <= 2**(31) - 1" ] }, { "line": 35, "end_line": 35, "violates": [ "0 <= x <= 2**(31) - 1" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= x <= 2**(31) - 1" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= x <= 2**(31) - 1" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= x <= 2**(31) - 1" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= x <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try exploring all integers. (Credits: @annujoshi)", "Use the sorted property of integers to reduced the search space. (Credits: @annujoshi)" ] }, { "question_id": 70, "task_id": "climbing-stairs", "drop": [], "similar": [ "min-cost-climbing-stairs", "fibonacci-number", "n-th-tribonacci-number", "minimum-rounds-to-complete-all-tasks", "count-number-of-ways-to-place-houses", "number-of-ways-to-reach-a-position-after-exactly-k-steps", "count-ways-to-build-good-strings", "frog-jump-ii", "find-number-of-ways-to-reach-the-k-th-stair", "the-number-of-ways-to-make-the-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 16, "kept": 16, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "To reach nth step, what could have been your previous steps? (Think about the step sizes)" ] }, { "question_id": 71, "task_id": "simplify-path", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "path" ], "tests": { "total": 198, "kept": 198, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "path is a valid absolute Unix path." ], "public_tests": 5, "hints": [] }, { "question_id": 72, "task_id": "edit-distance", "drop": [], "similar": [ "one-edit-distance", "delete-operation-for-two-strings", "minimum-ascii-delete-sum-for-two-strings", "uncrossed-lines", "minimum-white-tiles-after-covering-with-carpets", "longest-palindrome-after-substring-concatenation-ii", "minimum-steps-to-convert-string-with-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "word1", "word2" ], "tests": { "total": 132, "kept": 132, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3504 longest-palindrome-after-substring-concatenation-ii" ] }, { "question_id": 73, "task_id": "set-matrix-zeroes", "drop": [ "in_place", "interface" ], "similar": [ "game-of-life", "number-of-laser-beams-in-a-bank", "minimum-operations-to-remove-adjacent-ones-in-matrix", "remove-all-ones-with-row-and-column-flips-ii" ], "interface_problems": [ "rust: unparsed signature" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 102, "kept": 102, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 74, "task_id": "search-a-2d-matrix", "drop": [], "similar": [ "search-a-2d-matrix-ii", "split-message-based-on-limit" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix", "target" ], "tests": { "total": 143, "kept": 142, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 139, "end_line": 139, "violates": [ "-10**(4) <= matrix[i][j], target <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 75, "task_id": "sort-colors", "drop": [ "in_place", "interface" ], "similar": [ "sort-list", "wiggle-sort", "wiggle-sort-ii" ], "interface_problems": [ "rust: unparsed signature" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 128, "kept": 128, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 76, "task_id": "minimum-window-substring", "drop": [], "similar": [ "substring-with-concatenation-of-all-words", "minimum-size-subarray-sum", "sliding-window-maximum", "permutation-in-string", "smallest-range-covering-elements-from-k-lists", "minimum-window-subsequence", "count-substrings-that-can-be-rearranged-to-contain-a-string-ii", "count-substrings-that-can-be-rearranged-to-contain-a-string-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 80, "kept": 80, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use two pointers to create a window of letters in s, which would have all the characters from t.", "Expand the right pointer until all the characters of t are covered.", "Once all the characters are covered, move the left pointer and ensure that all the characters are still covered to minimize the subarray size.", "Continue expanding the right and left pointers until you reach the end of s." ], "similar_to_test": [ "3297 count-substrings-that-can-be-rearranged-to-contain-a-string-i", "3298 count-substrings-that-can-be-rearranged-to-contain-a-string-ii" ] }, { "question_id": 77, "task_id": "combinations", "drop": [], "similar": [ "combination-sum", "permutations" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "n", "k" ], "tests": { "total": 36, "kept": 36, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 78, "task_id": "subsets", "drop": [], "similar": [ "subsets-ii", "generalized-abbreviation", "letter-case-permutation", "find-array-given-subset-sums", "count-number-of-maximum-bitwise-or-subsets" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums" ], "tests": { "total": 91, "kept": 64, "dropped": { "constraint_violation": 27 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "-10 <= nums[i] <= 10", "-10 <= nums[i] <= 10" ] }, { "line": 18, "end_line": 18, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 33, "end_line": 33, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 36, "end_line": 36, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 38, "end_line": 38, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 39, "end_line": 39, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 42, "end_line": 42, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 45, "end_line": 45, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 46, "end_line": 46, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 47, "end_line": 47, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 51, "end_line": 51, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 52, "end_line": 52, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 65, "end_line": 65, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 67, "end_line": 67, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 68, "end_line": 68, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 74, "end_line": 74, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 75, "end_line": 75, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 77, "end_line": 77, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 80, "end_line": 80, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 82, "end_line": 82, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 83, "end_line": 83, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 86, "end_line": 86, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 90, "end_line": 90, "violates": [ "-10 <= nums[i] <= 10", "-10 <= nums[i] <= 10" ] }, { "line": 91, "end_line": 91, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 92, "end_line": 92, "violates": [ "-10 <= nums[i] <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 79, "task_id": "word-search", "drop": [], "similar": [ "word-search-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board", "word" ], "tests": { "total": 17, "kept": 17, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "n = board[i].length", "1 <= m, n <= 6" ], "public_tests": 3, "hints": [] }, { "question_id": 80, "task_id": "remove-duplicates-from-sorted-array-ii", "drop": [ "in_place" ], "similar": [ "remove-duplicates-from-sorted-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 128, "kept": 128, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 81, "task_id": "search-in-rotated-sorted-array-ii", "drop": [], "similar": [ "search-in-rotated-sorted-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 77, "kept": 77, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums is guaranteed to be rotated at some pivot." ], "public_tests": 2, "hints": [] }, { "question_id": 82, "task_id": "remove-duplicates-from-sorted-list-ii", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "remove-duplicates-from-sorted-list", "remove-duplicates-from-an-unsorted-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 37, "kept": 0, "dropped": { "unreadable": 37 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is in the range [0, 300].", "-100 <= Node.val <= 100", "The list is guaranteed to be sorted in ascending order." ] }, { "question_id": 83, "task_id": "remove-duplicates-from-sorted-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "remove-duplicates-from-sorted-list-ii", "remove-duplicates-from-an-unsorted-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 1, "kept": 0, "dropped": { "unreadable": 1 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is in the range [0, 300].", "-100 <= Node.val <= 100", "The list is guaranteed to be sorted in ascending order." ] }, { "question_id": 84, "task_id": "largest-rectangle-in-histogram", "drop": [], "similar": [ "maximal-rectangle", "maximum-score-of-a-good-subarray" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "heights" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 85, "task_id": "maximal-rectangle", "drop": [], "similar": [ "largest-rectangle-in-histogram", "maximal-square", "find-sorted-submatrices-with-maximum-element-at-most-k" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 66, "kept": 66, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "matrix[i][j] is '0' or '1'." ], "public_tests": 3, "hints": [], "similar_to_test": [ "3359 find-sorted-submatrices-with-maximum-element-at-most-k" ] }, { "question_id": 86, "task_id": "partition-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "partition-array-according-to-given-pivot" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head", "x" ], "tests": { "total": 2, "kept": 0, "dropped": { "unreadable": 2 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is in the range [0, 200].", "-100 <= Node.val <= 100" ] }, { "question_id": 87, "task_id": "scramble-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "s2" ], "tests": { "total": 109, "kept": 97, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "s1.length == s2.length" ] }, { "line": 32, "end_line": 32, "violates": [ "s1.length == s2.length" ] }, { "line": 36, "end_line": 36, "violates": [ "s1.length == s2.length" ] }, { "line": 46, "end_line": 46, "violates": [ "s1.length == s2.length" ] }, { "line": 61, "end_line": 61, "violates": [ "s1.length == s2.length" ] }, { "line": 69, "end_line": 69, "violates": [ "s1.length == s2.length" ] }, { "line": 70, "end_line": 70, "violates": [ "s1.length == s2.length" ] }, { "line": 72, "end_line": 72, "violates": [ "s1.length == s2.length" ] }, { "line": 101, "end_line": 101, "violates": [ "s1.length == s2.length" ] }, { "line": 103, "end_line": 103, "violates": [ "s1.length == s2.length" ] }, { "line": 105, "end_line": 105, "violates": [ "s1.length == s2.length" ] }, { "line": 109, "end_line": 109, "violates": [ "s1.length == s2.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 88, "task_id": "merge-sorted-array", "drop": [ "in_place", "interface" ], "similar": [ "merge-two-sorted-lists", "squares-of-a-sorted-array", "interval-list-intersections", "take-k-of-each-character-from-left-and-right" ], "interface_problems": [ "rust: unparsed signature" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "m", "nums2", "n" ], "tests": { "total": 80, "kept": 63, "dropped": { "constraint_violation": 17 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "nums1.length == m + n" ] }, { "line": 18, "end_line": 18, "violates": [ "nums1.length == m + n" ] }, { "line": 23, "end_line": 23, "violates": [ "nums1.length == m + n" ] }, { "line": 25, "end_line": 25, "violates": [ "nums1.length == m + n" ] }, { "line": 28, "end_line": 28, "violates": [ "nums1.length == m + n" ] }, { "line": 34, "end_line": 34, "violates": [ "nums1.length == m + n" ] }, { "line": 39, "end_line": 39, "violates": [ "nums1.length == m + n" ] }, { "line": 45, "end_line": 45, "violates": [ "-10**(9) <= nums1[i], nums2[j] <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "nums1.length == m + n" ] }, { "line": 54, "end_line": 54, "violates": [ "nums2.length == n" ] }, { "line": 68, "end_line": 68, "violates": [ "nums1.length == m + n" ] }, { "line": 69, "end_line": 69, "violates": [ "nums1.length == m + n" ] }, { "line": 72, "end_line": 72, "violates": [ "nums1.length == m + n" ] }, { "line": 75, "end_line": 75, "violates": [ "nums1.length == m + n" ] }, { "line": 76, "end_line": 76, "violates": [ "nums1.length == m + n" ] }, { "line": 77, "end_line": 77, "violates": [ "nums1.length == m + n" ] }, { "line": 81, "end_line": 81, "violates": [ "nums1.length == m + n" ] } ], "unchecked_constraints": [] }, { "question_id": 89, "task_id": "gray-code", "drop": [], "similar": [ "1-bit-and-2-bit-characters" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 12, "kept": 12, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 90, "task_id": "subsets-ii", "drop": [], "similar": [ "subsets", "find-array-given-subset-sums" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums" ], "tests": { "total": 103, "kept": 98, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 49, "end_line": 49, "violates": [ "1 <= nums.length <= 10" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums.length <= 10" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums.length <= 10" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums.length <= 10" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums.length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 91, "task_id": "decode-ways", "drop": [], "similar": [ "decode-ways-ii", "number-of-ways-to-separate-numbers", "count-number-of-texts" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 176, "kept": 140, "dropped": { "int_overflow": 36 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 33, "end_line": 33, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 54, "end_line": 54, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 55, "end_line": 55, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 58, "end_line": 58, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 59, "end_line": 59, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 64, "end_line": 64, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 65, "end_line": 65, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 67, "end_line": 67, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 72, "end_line": 72, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 76, "end_line": 76, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 82, "end_line": 82, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 91, "end_line": 91, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 93, "end_line": 93, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 95, "end_line": 95, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 97, "end_line": 97, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 99, "end_line": 99, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 100, "end_line": 100, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 104, "end_line": 104, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 106, "end_line": 106, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 108, "end_line": 108, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 109, "end_line": 109, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 110, "end_line": 110, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 120, "end_line": 120, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 128, "end_line": 128, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 130, "end_line": 130, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 143, "end_line": 143, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 144, "end_line": 144, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 145, "end_line": 145, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 147, "end_line": 147, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 151, "end_line": 151, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 160, "end_line": 160, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 161, "end_line": 161, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 162, "end_line": 162, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 174, "end_line": 174, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 175, "end_line": 175, "unrepresentable_in": [ "cpp", "rust", "java" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 92, "task_id": "reverse-linked-list-ii", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "reverse-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head", "left", "right" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the list is n.", "1 <= n <= 500", "-500 <= Node.val <= 500", "1 <= left <= right <= n" ] }, { "question_id": 93, "task_id": "restore-ip-addresses", "drop": [], "similar": [ "ip-to-cidr" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "s" ], "tests": { "total": 143, "kept": 125, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= s.length <= 20" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= s.length <= 20" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= s.length <= 20" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= s.length <= 20" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= s.length <= 20" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= s.length <= 20" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= s.length <= 20" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= s.length <= 20" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= s.length <= 20" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= s.length <= 20" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= s.length <= 20" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= s.length <= 20" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= s.length <= 20" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= s.length <= 20" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= s.length <= 20" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= s.length <= 20" ] }, { "line": 140, "end_line": 140, "violates": [ "1 <= s.length <= 20" ] }, { "line": 142, "end_line": 142, "violates": [ "1 <= s.length <= 20" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 94, "task_id": "binary-tree-inorder-traversal", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "validate-binary-search-tree", "binary-tree-preorder-traversal", "binary-tree-postorder-traversal", "binary-search-tree-iterator", "kth-smallest-element-in-a-bst", "closest-binary-search-tree-value-ii", "inorder-successor-in-bst", "convert-binary-search-tree-to-sorted-doubly-linked-list", "minimum-distance-between-bst-nodes" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 81, "kept": 0, "dropped": { "unreadable": 81 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 100].", "-100 <= Node.val <= 100" ] }, { "question_id": 96, "task_id": "unique-binary-search-trees", "drop": [], "similar": [ "unique-binary-search-trees-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 14, "kept": 14, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 97, "task_id": "interleaving-string", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "s1", "s2", "s3" ], "tests": { "total": 132, "kept": 131, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 127, "end_line": 127, "violates": [ "s1, s2, and s3 consist of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 98, "task_id": "validate-binary-search-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-inorder-traversal", "find-mode-in-binary-search-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 97, "kept": 0, "dropped": { "unreadable": 97 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "-2**(31) <= Node.val <= 2**(31) - 1" ] }, { "question_id": 99, "task_id": "recover-binary-search-tree", "drop": [ "tree_or_linked_list", "in_place", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 66, "kept": 0, "dropped": { "unreadable": 66 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [2, 1000].", "-2**(31) <= Node.val <= 2**(31) - 1" ] }, { "question_id": 100, "task_id": "same-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "p", "q" ], "tests": { "total": 132, "kept": 0, "dropped": { "unreadable": 132 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 105, "end_line": 105, "unreadable": true }, { "line": 106, "end_line": 106, "unreadable": true }, { "line": 107, "end_line": 107, "unreadable": true }, { "line": 108, "end_line": 108, "unreadable": true }, { "line": 109, "end_line": 109, "unreadable": true }, { "line": 110, "end_line": 110, "unreadable": true }, { "line": 111, "end_line": 111, "unreadable": true }, { "line": 112, "end_line": 112, "unreadable": true }, { "line": 113, "end_line": 113, "unreadable": true }, { "line": 114, "end_line": 114, "unreadable": true }, { "line": 115, "end_line": 115, "unreadable": true }, { "line": 116, "end_line": 116, "unreadable": true }, { "line": 117, "end_line": 117, "unreadable": true }, { "line": 118, "end_line": 118, "unreadable": true }, { "line": 119, "end_line": 119, "unreadable": true }, { "line": 120, "end_line": 120, "unreadable": true }, { "line": 121, "end_line": 121, "unreadable": true }, { "line": 122, "end_line": 122, "unreadable": true }, { "line": 123, "end_line": 123, "unreadable": true }, { "line": 124, "end_line": 124, "unreadable": true }, { "line": 125, "end_line": 125, "unreadable": true }, { "line": 126, "end_line": 126, "unreadable": true }, { "line": 127, "end_line": 127, "unreadable": true }, { "line": 128, "end_line": 128, "unreadable": true }, { "line": 129, "end_line": 129, "unreadable": true }, { "line": 130, "end_line": 130, "unreadable": true }, { "line": 131, "end_line": 131, "unreadable": true }, { "line": 132, "end_line": 132, "unreadable": true }, { "line": 133, "end_line": 133, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in both trees is in the range [0, 100].", "-10**(4) <= Node.val <= 10**(4)" ] }, { "question_id": 101, "task_id": "symmetric-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 111, "kept": 0, "dropped": { "unreadable": 111 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 105, "end_line": 105, "unreadable": true }, { "line": 106, "end_line": 106, "unreadable": true }, { "line": 107, "end_line": 107, "unreadable": true }, { "line": 108, "end_line": 108, "unreadable": true }, { "line": 109, "end_line": 109, "unreadable": true }, { "line": 110, "end_line": 110, "unreadable": true }, { "line": 111, "end_line": 111, "unreadable": true }, { "line": 112, "end_line": 112, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 1000].", "-100 <= Node.val <= 100" ] }, { "question_id": 102, "task_id": "binary-tree-level-order-traversal", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-zigzag-level-order-traversal", "binary-tree-level-order-traversal-ii", "minimum-depth-of-binary-tree", "binary-tree-vertical-order-traversal", "average-of-levels-in-binary-tree", "n-ary-tree-level-order-traversal", "cousins-in-binary-tree", "minimum-number-of-operations-to-sort-a-binary-tree-by-level", "divide-nodes-into-the-maximum-number-of-groups" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 67, "kept": 0, "dropped": { "unreadable": 67 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 2000].", "-1000 <= Node.val <= 1000" ] }, { "question_id": 103, "task_id": "binary-tree-zigzag-level-order-traversal", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-level-order-traversal", "zigzag-grid-traversal-with-skip" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 84, "kept": 0, "dropped": { "unreadable": 84 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 2000].", "-100 <= Node.val <= 100" ], "similar_to_test": [ "3417 zigzag-grid-traversal-with-skip" ] }, { "question_id": 104, "task_id": "maximum-depth-of-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "balanced-binary-tree", "minimum-depth-of-binary-tree", "maximum-depth-of-n-ary-tree", "time-needed-to-inform-all-employees", "amount-of-time-for-binary-tree-to-be-infected", "height-of-binary-tree-after-subtree-removal-queries" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 100, "kept": 0, "dropped": { "unreadable": 100 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 10**(4)].", "-100 <= Node.val <= 100" ] }, { "question_id": 105, "task_id": "construct-binary-tree-from-preorder-and-inorder-traversal", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "construct-binary-tree-from-inorder-and-postorder-traversal" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "preorder", "inorder" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "preorder and inorder consist of unique values.", "Each value of inorder also appears in preorder.", "preorder is guaranteed to be the preorder traversal of the tree.", "inorder is guaranteed to be the inorder traversal of the tree." ] }, { "question_id": 106, "task_id": "construct-binary-tree-from-inorder-and-postorder-traversal", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "construct-binary-tree-from-preorder-and-inorder-traversal" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "inorder", "postorder" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "inorder and postorder consist of unique values.", "Each value of postorder also appears in inorder.", "inorder is guaranteed to be the inorder traversal of the tree.", "postorder is guaranteed to be the postorder traversal of the tree." ] }, { "question_id": 107, "task_id": "binary-tree-level-order-traversal-ii", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-level-order-traversal", "average-of-levels-in-binary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 64, "kept": 0, "dropped": { "unreadable": 64 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 2000].", "-1000 <= Node.val <= 1000" ] }, { "question_id": 108, "task_id": "convert-sorted-array-to-binary-search-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "convert-sorted-list-to-binary-search-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums is sorted in a strictly increasing order." ] }, { "question_id": 109, "task_id": "convert-sorted-list-to-binary-search-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "convert-sorted-array-to-binary-search-tree", "create-binary-tree-from-descriptions" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 1, "kept": 0, "dropped": { "unreadable": 1 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in head is in the range [0, 2 * 10**(4)].", "-10**(5) <= Node.val <= 10**(5)" ] }, { "question_id": 110, "task_id": "balanced-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "maximum-depth-of-binary-tree", "k-th-largest-perfect-subtree-size-in-binary-tree", "check-balanced-string" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 105, "kept": 0, "dropped": { "unreadable": 105 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 105, "end_line": 105, "unreadable": true }, { "line": 106, "end_line": 106, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 5000].", "-10**(4) <= Node.val <= 10**(4)" ], "similar_to_test": [ "3319 k-th-largest-perfect-subtree-size-in-binary-tree", "3340 check-balanced-string" ] }, { "question_id": 111, "task_id": "minimum-depth-of-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-level-order-traversal", "maximum-depth-of-binary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 95, "kept": 0, "dropped": { "unreadable": 95 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 10**(5)].", "-1000 <= Node.val <= 1000" ] }, { "question_id": 112, "task_id": "path-sum", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "path-sum-ii", "binary-tree-maximum-path-sum", "sum-root-to-leaf-numbers", "path-sum-iii", "path-sum-iv" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "targetSum" ], "tests": { "total": 75, "kept": 0, "dropped": { "unreadable": 75 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 5000].", "-1000 <= Node.val <= 1000" ] }, { "question_id": 113, "task_id": "path-sum-ii", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "path-sum", "binary-tree-paths", "path-sum-iii", "path-sum-iv", "step-by-step-directions-from-a-binary-tree-node-to-another" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "targetSum" ], "tests": { "total": 39, "kept": 0, "dropped": { "unreadable": 39 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 5000].", "-1000 <= Node.val <= 1000" ] }, { "question_id": 114, "task_id": "flatten-binary-tree-to-linked-list", "drop": [ "tree_or_linked_list", "in_place", "too_few_tests" ], "similar": [ "flatten-a-multilevel-doubly-linked-list", "correct-a-binary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 84, "kept": 0, "dropped": { "unreadable": 84 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 2000].", "-100 <= Node.val <= 100" ] }, { "question_id": 115, "task_id": "distinct-subsequences", "drop": [], "similar": [ "number-of-unique-good-subsequences" ], "flags": [ "figure_reference" ], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 101, "kept": 97, "dropped": { "constraint_violation": 3, "int_overflow": 1 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= s.length, t.length <= 1000" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= s.length, t.length <= 1000" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= s.length, t.length <= 1000" ] }, { "line": 65, "end_line": 65, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "java" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 118, "task_id": "pascals-triangle", "drop": [], "similar": [ "pascals-triangle-ii", "check-if-digits-are-equal-in-string-after-operations-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "numRows" ], "tests": { "total": 16, "kept": 16, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3463 check-if-digits-are-equal-in-string-after-operations-ii" ] }, { "question_id": 119, "task_id": "pascals-triangle-ii", "drop": [], "similar": [ "pascals-triangle", "find-triangular-sum-of-an-array" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "rowIndex" ], "tests": { "total": 20, "kept": 20, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 120, "task_id": "triangle", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "triangle" ], "tests": { "total": 92, "kept": 87, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "-10**(4) <= triangle[i][j] <= 10**(4)" ] }, { "line": 54, "end_line": 54, "violates": [ "triangle[0].length == 1", "triangle[i].length == triangle[i - 1].length + 1" ] }, { "line": 56, "end_line": 56, "violates": [ "triangle[0].length == 1", "triangle[i].length == triangle[i - 1].length + 1" ] }, { "line": 75, "end_line": 75, "violates": [ "triangle[0].length == 1", "triangle[i].length == triangle[i - 1].length + 1" ] }, { "line": 85, "end_line": 85, "violates": [ "triangle[0].length == 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 121, "task_id": "best-time-to-buy-and-sell-stock", "drop": [], "similar": [ "maximum-subarray", "best-time-to-buy-and-sell-stock-ii", "best-time-to-buy-and-sell-stock-iii", "best-time-to-buy-and-sell-stock-iv", "best-time-to-buy-and-sell-stock-with-cooldown", "sum-of-beauty-in-the-array", "maximum-difference-between-increasing-elements", "maximum-profit-from-trading-stocks", "best-time-to-buy-and-sell-stock-v" ], "flags": [], "comparison": "exact", "parameter_names": [ "prices" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 122, "task_id": "best-time-to-buy-and-sell-stock-ii", "drop": [], "similar": [ "best-time-to-buy-and-sell-stock", "best-time-to-buy-and-sell-stock-iii", "best-time-to-buy-and-sell-stock-iv", "best-time-to-buy-and-sell-stock-with-cooldown", "best-time-to-buy-and-sell-stock-with-transaction-fee", "maximum-profit-from-trading-stocks" ], "flags": [], "comparison": "exact", "parameter_names": [ "prices" ], "tests": { "total": 125, "kept": 125, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 123, "task_id": "best-time-to-buy-and-sell-stock-iii", "drop": [], "similar": [ "best-time-to-buy-and-sell-stock", "best-time-to-buy-and-sell-stock-ii", "best-time-to-buy-and-sell-stock-iv", "maximum-sum-of-3-non-overlapping-subarrays", "maximum-profit-from-trading-stocks", "maximize-win-from-two-segments" ], "flags": [], "comparison": "exact", "parameter_names": [ "prices" ], "tests": { "total": 117, "kept": 117, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 124, "task_id": "binary-tree-maximum-path-sum", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "path-sum", "sum-root-to-leaf-numbers", "path-sum-iv", "longest-univalue-path", "time-needed-to-inform-all-employees", "difference-between-maximum-and-minimum-price-sum" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 96, "kept": 0, "dropped": { "unreadable": 96 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 3 * 10**(4)].", "-1000 <= Node.val <= 1000" ] }, { "question_id": 125, "task_id": "valid-palindrome", "drop": [ "too_few_tests" ], "similar": [ "palindrome-linked-list", "valid-palindrome-ii", "maximum-product-of-the-length-of-two-palindromic-subsequences", "find-first-palindromic-string-in-the-array", "valid-palindrome-iv", "maximum-palindromes-after-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 2, "kept": 2, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s consists only of printable ASCII characters." ] }, { "question_id": 127, "task_id": "word-ladder", "drop": [], "similar": [ "word-ladder-ii", "minimum-genetic-mutation", "words-within-two-edits-of-dictionary" ], "flags": [], "comparison": "exact", "parameter_names": [ "beginWord", "endWord", "wordList" ], "tests": { "total": 13, "kept": 11, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "wordList[i].length == beginWord.length" ] }, { "line": 13, "end_line": 13, "violates": [ "endWord.length == beginWord.length", "wordList[i].length == beginWord.length" ] } ], "unchecked_constraints": [ "All the words in wordList are unique." ], "public_tests": 2, "hints": [] }, { "question_id": 128, "task_id": "longest-consecutive-sequence", "drop": [], "similar": [ "binary-tree-longest-consecutive-sequence", "find-three-consecutive-integers-that-sum-to-a-given-number", "maximum-consecutive-floors-without-special-floors", "length-of-the-longest-alphabetical-continuous-substring", "find-the-maximum-number-of-elements-in-subset" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 138, "kept": 126, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 36, "end_line": 36, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 84, "end_line": 84, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 104, "end_line": 104, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 109, "end_line": 109, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 110, "end_line": 110, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 113, "end_line": 113, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 126, "end_line": 126, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 129, "task_id": "sum-root-to-leaf-numbers", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "path-sum", "binary-tree-maximum-path-sum", "smallest-string-starting-from-leaf" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 93, "kept": 0, "dropped": { "unreadable": 93 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 1000].", "0 <= Node.val <= 9", "The depth of the tree will not exceed 10." ] }, { "question_id": 130, "task_id": "surrounded-regions", "drop": [ "in_place", "interface" ], "similar": [ "number-of-islands", "walls-and-gates" ], "interface_problems": [ "rust: unparsed signature" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board" ], "tests": { "total": 65, "kept": 65, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "board[i][j] is 'X' or 'O'." ] }, { "question_id": 131, "task_id": "palindrome-partitioning", "drop": [], "similar": [ "palindrome-partitioning-ii", "palindrome-partitioning-iv", "maximum-number-of-non-overlapping-palindrome-substrings" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 128, "kept": 109, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "1 <= s.length <= 16" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= s.length <= 16" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= s.length <= 16" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= s.length <= 16" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= s.length <= 16" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= s.length <= 16" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= s.length <= 16" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= s.length <= 16" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= s.length <= 16" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= s.length <= 16" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= s.length <= 16" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= s.length <= 16" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= s.length <= 16" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= s.length <= 16" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= s.length <= 16" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= s.length <= 16" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= s.length <= 16" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= s.length <= 16" ] }, { "line": 129, "end_line": 129, "violates": [ "1 <= s.length <= 16" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 132, "task_id": "palindrome-partitioning-ii", "drop": [], "similar": [ "palindrome-partitioning", "palindrome-partitioning-iv", "maximum-number-of-non-overlapping-palindrome-substrings", "number-of-great-partitions" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 158, "kept": 158, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 134, "task_id": "gas-station", "drop": [], "similar": [ "maximize-the-topmost-element-after-k-moves" ], "flags": [], "comparison": "exact", "parameter_names": [ "gas", "cost" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The input is generated such that the answer is unique." ], "public_tests": 2, "hints": [] }, { "question_id": 135, "task_id": "candy", "drop": [], "similar": [ "minimize-maximum-value-in-a-grid", "minimum-number-of-operations-to-satisfy-conditions", "check-if-grid-satisfies-conditions" ], "flags": [], "comparison": "exact", "parameter_names": [ "ratings" ], "tests": { "total": 112, "kept": 112, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 136, "task_id": "single-number", "drop": [], "similar": [ "single-number-ii", "single-number-iii", "missing-number", "find-the-duplicate-number", "find-the-difference", "find-the-xor-of-numbers-which-appear-twice" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 108, "kept": 85, "dropped": { "constraint_violation": 23 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 12, "end_line": 12, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 14, "end_line": 14, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 15, "end_line": 15, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 29, "end_line": 29, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 30, "end_line": 30, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 34, "end_line": 34, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 44, "end_line": 44, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 47, "end_line": 47, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 50, "end_line": 50, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 62, "end_line": 62, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 72, "end_line": 72, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 73, "end_line": 73, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 74, "end_line": 74, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 76, "end_line": 76, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 79, "end_line": 79, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 82, "end_line": 82, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 85, "end_line": 85, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 92, "end_line": 92, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 93, "end_line": 93, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 104, "end_line": 104, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 106, "end_line": 106, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] }, { "line": 108, "end_line": 108, "violates": [ "-3 * 10**(4) <= nums[i] <= 3 * 10**(4)" ] } ], "unchecked_constraints": [ "Each element in the array appears twice except for one element which appears only once." ], "public_tests": 3, "hints": [ "Think about the XOR (^) operator's property." ] }, { "question_id": 137, "task_id": "single-number-ii", "drop": [], "similar": [ "single-number", "single-number-iii", "find-the-xor-of-numbers-which-appear-twice" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 98, "kept": 97, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "-2**(31) <= nums[i] <= 2**(31) - 1" ] } ], "unchecked_constraints": [ "Each element in nums appears exactly three times except for one element which appears once." ], "public_tests": 2, "hints": [] }, { "question_id": 139, "task_id": "word-break", "drop": [], "similar": [ "word-break-ii", "extra-characters-in-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "wordDict" ], "tests": { "total": 87, "kept": 69, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 12, "end_line": 12, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 13, "end_line": 13, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 20, "end_line": 20, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 22, "end_line": 22, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 23, "end_line": 23, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 25, "end_line": 25, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= wordDict[i].length <= 20" ] }, { "line": 44, "end_line": 44, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 46, "end_line": 46, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 52, "end_line": 52, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 56, "end_line": 56, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 58, "end_line": 58, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 69, "end_line": 69, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 72, "end_line": 72, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= wordDict[i].length <= 20" ] }, { "line": 77, "end_line": 77, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 85, "end_line": 85, "violates": [ "All the strings of wordDict are unique." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 140, "task_id": "word-break-ii", "drop": [], "similar": [ "word-break", "concatenated-words" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "s", "wordDict" ], "tests": { "total": 59, "kept": 23, "dropped": { "constraint_violation": 36 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= s.length <= 20" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= wordDict[i].length <= 10", "All the strings of wordDict are unique." ] }, { "line": 14, "end_line": 14, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= s.length <= 20" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= wordDict[i].length <= 10", "All the strings of wordDict are unique." ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= s.length <= 20", "All the strings of wordDict are unique." ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= s.length <= 20", "All the strings of wordDict are unique." ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= wordDict[i].length <= 10" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= s.length <= 20", "1 <= wordDict[i].length <= 10" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= wordDict[i].length <= 10" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= s.length <= 20", "1 <= wordDict[i].length <= 10" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= s.length <= 20" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= s.length <= 20", "1 <= wordDict[i].length <= 10", "All the strings of wordDict are unique." ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= s.length <= 20" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= s.length <= 20" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= s.length <= 20", "1 <= wordDict[i].length <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= s.length <= 20", "1 <= wordDict[i].length <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= s.length <= 20", "1 <= wordDict[i].length <= 10", "All the strings of wordDict are unique." ] }, { "line": 38, "end_line": 38, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= s.length <= 20" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= wordDict[i].length <= 10" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= s.length <= 20", "1 <= wordDict[i].length <= 10" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= wordDict[i].length <= 10" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= wordDict[i].length <= 10" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= s.length <= 20" ] }, { "line": 49, "end_line": 49, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= s.length <= 20" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= s.length <= 20" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= wordDict[i].length <= 10", "All the strings of wordDict are unique." ] }, { "line": 54, "end_line": 54, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= s.length <= 20" ] }, { "line": 56, "end_line": 56, "violates": [ "All the strings of wordDict are unique." ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= wordDict[i].length <= 10" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= s.length <= 20", "1 <= wordDict[i].length <= 10" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= s.length <= 20", "1 <= wordDict[i].length <= 10" ] } ], "unchecked_constraints": [ "Input is generated in a way that the length of the answer doesn't exceed 10**(5)." ], "public_tests": 3, "hints": [] }, { "question_id": 141, "task_id": "linked-list-cycle", "drop": [ "tree_or_linked_list", "interface", "too_few_tests" ], "similar": [ "linked-list-cycle-ii", "happy-number" ], "interface_problems": [ "cpp: ValueError: Could not parse parameter: 'ListNode *head'", "rust: no code snippet" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 6, "kept": 0, "dropped": { "unreadable": 6 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true } ], "unchecked_constraints": [ "The number of the nodes in the list is in the range [0, 10**(4)].", "-10**(5) <= Node.val <= 10**(5)", "pos is -1 or a valid index in the linked-list." ] }, { "question_id": 143, "task_id": "reorder-list", "drop": [ "tree_or_linked_list", "in_place", "interface", "too_few_tests" ], "similar": [ "delete-the-middle-node-of-a-linked-list", "take-k-of-each-character-from-left-and-right" ], "interface_problems": [ "rust: unparsed signature" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 67, "kept": 0, "dropped": { "unreadable": 67 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is in the range [1, 5 * 10**(4)].", "1 <= Node.val <= 1000" ] }, { "question_id": 144, "task_id": "binary-tree-preorder-traversal", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-inorder-traversal", "verify-preorder-sequence-in-binary-search-tree", "n-ary-tree-preorder-traversal", "kth-largest-sum-in-a-binary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 87, "kept": 0, "dropped": { "unreadable": 87 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 100].", "-100 <= Node.val <= 100" ] }, { "question_id": 145, "task_id": "binary-tree-postorder-traversal", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-inorder-traversal", "n-ary-tree-postorder-traversal", "minimum-fuel-cost-to-report-to-the-capital" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 91, "kept": 0, "dropped": { "unreadable": 91 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true } ], "unchecked_constraints": [ "The number of the nodes in the tree is in the range [0, 100].", "-100 <= Node.val <= 100" ] }, { "question_id": 147, "task_id": "insertion-sort-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "sort-list", "insert-into-a-sorted-circular-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the list is in the range [1, 5000].", "-5000 <= Node.val <= 5000" ] }, { "question_id": 148, "task_id": "sort-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "merge-two-sorted-lists", "sort-colors", "insertion-sort-list", "sort-linked-list-already-sorted-using-absolute-values" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 1, "kept": 0, "dropped": { "unreadable": 1 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is in the range [0, 5 * 10**(4)].", "-10**(5) <= Node.val <= 10**(5)" ] }, { "question_id": 149, "task_id": "max-points-on-a-line", "drop": [], "similar": [ "line-reflection", "minimum-number-of-lines-to-cover-points", "minimum-lines-to-represent-a-line-chart", "count-special-subsequences" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "points" ], "tests": { "total": 108, "kept": 97, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "All the points are unique." ] }, { "line": 16, "end_line": 16, "violates": [ "-10**(4) <= xi, yi <= 10**(4)" ] }, { "line": 18, "end_line": 18, "violates": [ "-10**(4) <= xi, yi <= 10**(4)" ] }, { "line": 19, "end_line": 19, "violates": [ "All the points are unique." ] }, { "line": 22, "end_line": 22, "violates": [ "All the points are unique." ] }, { "line": 47, "end_line": 47, "violates": [ "All the points are unique." ] }, { "line": 72, "end_line": 72, "violates": [ "All the points are unique." ] }, { "line": 74, "end_line": 74, "violates": [ "All the points are unique." ] }, { "line": 97, "end_line": 97, "violates": [ "All the points are unique." ] }, { "line": 100, "end_line": 100, "violates": [ "All the points are unique." ] }, { "line": 104, "end_line": 104, "violates": [ "All the points are unique." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3404 count-special-subsequences" ] }, { "question_id": 150, "task_id": "evaluate-reverse-polish-notation", "drop": [], "similar": [ "basic-calculator", "expression-add-operators" ], "flags": [], "comparison": "exact", "parameter_names": [ "tokens" ], "tests": { "total": 97, "kept": 97, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "tokens[i] is either an operator: \"+\", \"-\", \"*\", or \"/\", or an integer in the range [-200, 200]." ], "public_tests": 3, "hints": [] }, { "question_id": 151, "task_id": "reverse-words-in-a-string", "drop": [ "too_few_tests" ], "similar": [ "reverse-words-in-a-string-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 3, "kept": 1, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "s contains English letters (upper-case and lower-case), digits, and spaces ' '." ] }, { "line": 4, "end_line": 4, "violates": [ "s contains English letters (upper-case and lower-case), digits, and spaces ' '." ] } ], "unchecked_constraints": [ "There is at least one word in s." ] }, { "question_id": 152, "task_id": "maximum-product-subarray", "drop": [], "similar": [ "maximum-subarray", "house-robber", "product-of-array-except-self", "maximum-product-of-three-numbers", "subarray-product-less-than-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 91, "kept": 80, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 20, "end_line": 20, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 24, "end_line": 24, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 40, "end_line": 40, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 43, "end_line": 43, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 67, "end_line": 67, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 72, "end_line": 72, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 79, "end_line": 79, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 83, "end_line": 83, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 87, "end_line": 87, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 89, "end_line": 89, "violates": [ "-10 <= nums[i] <= 10" ] } ], "unchecked_constraints": [ "The product of any subarray of nums is guaranteed to fit in a 32-bit integer." ], "public_tests": 2, "hints": [] }, { "question_id": 153, "task_id": "find-minimum-in-rotated-sorted-array", "drop": [], "similar": [ "search-in-rotated-sorted-array", "find-minimum-in-rotated-sorted-array-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 95, "kept": 94, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 84, "end_line": 84, "violates": [ "All the integers of nums are unique." ] } ], "unchecked_constraints": [ "nums is sorted and rotated between 1 and n times." ], "public_tests": 3, "hints": [ "Array was originally in ascending order. Now that the array is rotated, there would be a point in the array where there is a small deflection from the increasing sequence. eg. The array would be something like [4, 5, 6, 7, 0, 1, 2].", "You can divide the search space into two and see which direction to go. Can you think of an algorithm which has O(logN) search complexity?", "1. All the elements to the left of inflection point > first element of the array.\n2. All the elements to the right of inflection point < first element of the array." ] }, { "question_id": 154, "task_id": "find-minimum-in-rotated-sorted-array-ii", "drop": [], "similar": [ "find-minimum-in-rotated-sorted-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 120, "kept": 120, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums is sorted and rotated between 1 and n times." ], "public_tests": 2, "hints": [] }, { "question_id": 156, "task_id": "binary-tree-upside-down", "drop": [ "premium" ] }, { "question_id": 159, "task_id": "longest-substring-with-at-most-two-distinct-characters", "drop": [ "premium" ] }, { "question_id": 160, "task_id": "intersection-of-two-linked-lists", "drop": [ "tree_or_linked_list", "interface", "too_few_tests" ], "similar": [ "minimum-index-sum-of-two-lists" ], "interface_problems": [ "cpp: unparsed signature", "rust: no code snippet", "go: ValueError: Could not parse Go parameter: 'headA'" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "headA", "headB" ], "tests": { "total": 10, "kept": 0, "dropped": { "unreadable": 10 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes of listA is in the m.", "The number of nodes of listB is in the n.", "1 <= m, n <= 3 * 10**(4)", "1 <= Node.val <= 10**(5)", "0 <= skipA <= m", "0 <= skipB <= n", "intersectVal is 0 if listA and listB do not intersect.", "intersectVal == listA[skipA] == listB[skipB] if listA and listB intersect." ] }, { "question_id": 161, "task_id": "one-edit-distance", "drop": [ "premium" ] }, { "question_id": 162, "task_id": "find-peak-element", "drop": [], "similar": [ "peak-index-in-a-mountain-array", "find-a-peak-element-ii", "pour-water-between-buckets-to-make-water-levels-equal", "count-hills-and-valleys-in-an-array", "find-the-peaks" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 92, "kept": 92, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums[i] != nums[i + 1] for all valid i." ], "public_tests": 2, "hints": [] }, { "question_id": 163, "task_id": "missing-ranges", "drop": [ "premium" ] }, { "question_id": 164, "task_id": "maximum-gap", "drop": [], "similar": [ "widest-vertical-area-between-two-points-containing-no-points", "maximum-consecutive-floors-without-special-floors" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 127, "kept": 123, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 96, "end_line": 96, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 108, "end_line": 108, "violates": [ "0 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 165, "task_id": "compare-version-numbers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "version1", "version2" ], "tests": { "total": 119, "kept": 119, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "version1 and version2 only contain digits and '.'.", "version1 and version2 are valid version numbers.", "All the given revisions in version1 and version2 can be stored in a 32-bit integer." ], "public_tests": 3, "hints": [ "You can use two pointers for each version string to traverse them together while comparing the corresponding segments.", "Utilize the substring method to extract each version segment delimited by '.'. Ensure you're extracting the segments correctly by adjusting the start and end indices accordingly." ] }, { "question_id": 166, "task_id": "fraction-to-recurring-decimal", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "numerator", "denominator" ], "tests": { "total": 83, "kept": 83, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "No scary math, just apply elementary math knowledge. Still remember how to perform a long division?", "Try a long division on 4/9, the repeating part is obvious. Now try 4/333. Do you see a pattern?", "Notice that once the remainder starts repeating, so does the divided result.", "Be wary of edge cases! List out as many test cases as you can think of and test your code thoroughly." ] }, { "question_id": 167, "task_id": "two-sum-ii-input-array-is-sorted", "drop": [], "similar": [ "two-sum", "two-sum-iv-input-is-a-bst", "two-sum-less-than-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "numbers", "target" ], "tests": { "total": 89, "kept": 78, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "-1000 <= numbers[i] <= 1000" ] }, { "line": 34, "end_line": 34, "violates": [ "-1000 <= target <= 1000" ] }, { "line": 35, "end_line": 35, "violates": [ "-1000 <= target <= 1000" ] }, { "line": 37, "end_line": 37, "violates": [ "-1000 <= target <= 1000" ] }, { "line": 40, "end_line": 40, "violates": [ "-1000 <= numbers[i] <= 1000" ] }, { "line": 44, "end_line": 44, "violates": [ "-1000 <= target <= 1000" ] }, { "line": 48, "end_line": 48, "violates": [ "-1000 <= target <= 1000" ] }, { "line": 57, "end_line": 57, "violates": [ "-1000 <= target <= 1000" ] }, { "line": 62, "end_line": 62, "violates": [ "-1000 <= target <= 1000" ] }, { "line": 68, "end_line": 68, "violates": [ "-1000 <= target <= 1000" ] }, { "line": 78, "end_line": 78, "violates": [ "-1000 <= target <= 1000" ] } ], "unchecked_constraints": [ "The tests are generated such that there is exactly one solution." ], "public_tests": 3, "hints": [] }, { "question_id": 168, "task_id": "excel-sheet-column-title", "drop": [], "similar": [ "excel-sheet-column-number", "cells-in-a-range-on-an-excel-sheet", "design-spreadsheet" ], "flags": [], "comparison": "exact", "parameter_names": [ "columnNumber" ], "tests": { "total": 38, "kept": 38, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 169, "task_id": "majority-element", "drop": [], "similar": [ "majority-element-ii", "check-if-a-number-is-majority-element-in-a-sorted-array", "most-frequent-even-element", "minimum-index-of-a-valid-split", "minimum-operations-to-exceed-threshold-value-i", "find-the-most-common-response", "find-valid-pair-of-adjacent-digits-in-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 45, "kept": 45, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The input is generated such that a majority element will exist in the array." ], "public_tests": 2, "hints": [], "similar_to_test": [ "3438 find-valid-pair-of-adjacent-digits-in-string" ] }, { "question_id": 171, "task_id": "excel-sheet-column-number", "drop": [], "similar": [ "excel-sheet-column-title", "cells-in-a-range-on-an-excel-sheet" ], "flags": [], "comparison": "exact", "parameter_names": [ "columnTitle" ], "tests": { "total": 201, "kept": 185, "dropped": { "constraint_violation": 11, "int_overflow": 5 } }, "dropped_tests": [ { "line": 65, "end_line": 65, "violates": [ "1 <= columnTitle.length <= 7" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= columnTitle.length <= 7" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= columnTitle.length <= 7" ] }, { "line": 80, "end_line": 80, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 112, "end_line": 112, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 118, "end_line": 118, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 133, "end_line": 133, "violates": [ "1 <= columnTitle.length <= 7" ] }, { "line": 138, "end_line": 138, "violates": [ "1 <= columnTitle.length <= 7" ] }, { "line": 139, "end_line": 139, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 144, "end_line": 144, "violates": [ "1 <= columnTitle.length <= 7" ] }, { "line": 163, "end_line": 163, "violates": [ "1 <= columnTitle.length <= 7" ] }, { "line": 165, "end_line": 165, "violates": [ "1 <= columnTitle.length <= 7" ] }, { "line": 184, "end_line": 184, "violates": [ "1 <= columnTitle.length <= 7" ] }, { "line": 185, "end_line": 185, "violates": [ "1 <= columnTitle.length <= 7" ] }, { "line": 194, "end_line": 194, "violates": [ "1 <= columnTitle.length <= 7" ] }, { "line": 199, "end_line": 199, "unrepresentable_in": [ "cpp", "rust", "java" ] } ], "unchecked_constraints": [ "columnTitle is in the range [\"A\", \"FXSHRXW\"]." ], "public_tests": 3, "hints": [] }, { "question_id": 172, "task_id": "factorial-trailing-zeroes", "drop": [], "similar": [ "number-of-digit-one", "preimage-size-of-factorial-zeroes-function", "abbreviating-the-product-of-a-range", "maximum-trailing-zeros-in-a-cornered-path" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 71, "kept": 60, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "0 <= n <= 10**(4)" ] }, { "line": 16, "end_line": 16, "violates": [ "0 <= n <= 10**(4)" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= n <= 10**(4)" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= n <= 10**(4)" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= n <= 10**(4)" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= n <= 10**(4)" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= n <= 10**(4)" ] }, { "line": 35, "end_line": 35, "violates": [ "0 <= n <= 10**(4)" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= n <= 10**(4)" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= n <= 10**(4)" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= n <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 174, "task_id": "dungeon-game", "drop": [], "similar": [ "unique-paths", "minimum-path-sum", "cherry-pickup", "minimum-path-cost-in-a-grid", "minimum-health-to-beat-game", "paths-in-matrix-whose-sum-is-divisible-by-k", "check-if-there-is-a-path-with-equal-number-of-0s-and-1s" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "dungeon" ], "tests": { "total": 98, "kept": 98, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 179, "task_id": "largest-number", "drop": [], "similar": [ "smallest-value-of-the-rearranged-number", "find-the-key-of-the-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 150, "kept": 148, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 60, "end_line": 60, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 118, "end_line": 118, "violates": [ "0 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3270 find-the-key-of-the-numbers" ] }, { "question_id": 186, "task_id": "reverse-words-in-a-string-ii", "drop": [ "premium" ] }, { "question_id": 187, "task_id": "repeated-dna-sequences", "drop": [], "similar": [], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "s" ], "tests": { "total": 137, "kept": 137, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 188, "task_id": "best-time-to-buy-and-sell-stock-iv", "drop": [], "similar": [ "best-time-to-buy-and-sell-stock", "best-time-to-buy-and-sell-stock-ii", "best-time-to-buy-and-sell-stock-iii", "maximum-profit-from-trading-stocks" ], "flags": [], "comparison": "exact", "parameter_names": [ "k", "prices" ], "tests": { "total": 97, "kept": 95, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= k <= 100" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= k <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 189, "task_id": "rotate-array", "drop": [ "in_place", "interface" ], "similar": [ "rotate-list", "reverse-words-in-a-string-ii", "make-k-subarray-sums-equal", "maximum-number-of-matching-indices-after-right-shifts" ], "interface_problems": [ "rust: unparsed signature" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 118, "kept": 116, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 90, "end_line": 90, "violates": [ "-2**(31) <= nums[i] <= 2**(31) - 1" ] }, { "line": 96, "end_line": 96, "violates": [ "0 <= k <= 10**(5)" ] } ], "unchecked_constraints": [], "similar_to_test": [ "3400 maximum-number-of-matching-indices-after-right-shifts" ] }, { "question_id": 190, "task_id": "reverse-bits", "drop": [ "too_few_tests" ], "similar": [ "reverse-integer", "number-of-1-bits", "a-number-after-a-double-reversal" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 24, "kept": 3, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "0 <= n <= 2**(31) - 2", "n is even." ] }, { "line": 5, "end_line": 5, "violates": [ "0 <= n <= 2**(31) - 2" ] }, { "line": 6, "end_line": 6, "violates": [ "0 <= n <= 2**(31) - 2" ] }, { "line": 8, "end_line": 8, "violates": [ "0 <= n <= 2**(31) - 2", "n is even." ] }, { "line": 9, "end_line": 9, "violates": [ "n is even." ] }, { "line": 10, "end_line": 10, "violates": [ "0 <= n <= 2**(31) - 2", "n is even." ] }, { "line": 11, "end_line": 11, "violates": [ "0 <= n <= 2**(31) - 2" ] }, { "line": 12, "end_line": 12, "violates": [ "0 <= n <= 2**(31) - 2" ] }, { "line": 13, "end_line": 13, "violates": [ "0 <= n <= 2**(31) - 2", "n is even." ] }, { "line": 14, "end_line": 14, "violates": [ "0 <= n <= 2**(31) - 2" ] }, { "line": 15, "end_line": 15, "violates": [ "0 <= n <= 2**(31) - 2", "n is even." ] }, { "line": 16, "end_line": 16, "violates": [ "0 <= n <= 2**(31) - 2" ] }, { "line": 17, "end_line": 17, "violates": [ "0 <= n <= 2**(31) - 2" ] }, { "line": 18, "end_line": 18, "violates": [ "0 <= n <= 2**(31) - 2", "n is even." ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= n <= 2**(31) - 2" ] }, { "line": 20, "end_line": 20, "violates": [ "0 <= n <= 2**(31) - 2", "n is even." ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= n <= 2**(31) - 2" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= n <= 2**(31) - 2" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= n <= 2**(31) - 2" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= n <= 2**(31) - 2" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= n <= 2**(31) - 2" ] } ], "unchecked_constraints": [] }, { "question_id": 191, "task_id": "number-of-1-bits", "drop": [], "similar": [ "reverse-bits", "power-of-two", "counting-bits", "binary-watch", "hamming-distance", "binary-number-with-alternating-bits", "prime-number-of-set-bits-in-binary-representation", "convert-date-to-binary" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 139, "kept": 127, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= n <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [], "similar_to_test": [ "3280 convert-date-to-binary" ] }, { "question_id": 198, "task_id": "house-robber", "drop": [], "similar": [ "maximum-product-subarray", "house-robber-ii", "paint-house", "paint-fence", "house-robber-iii", "non-negative-integers-without-consecutive-ones", "coin-path", "delete-and-earn", "solving-questions-with-brainpower", "count-number-of-ways-to-place-houses", "house-robber-iv", "mice-and-cheese", "largest-element-in-an-array-after-merge-operations", "house-robber-v" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 117, "kept": 110, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "0 <= nums[i] <= 400" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= nums[i] <= 400", "0 <= nums[i] <= 400" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= nums[i] <= 400" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= nums[i] <= 400" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= nums[i] <= 400" ] }, { "line": 96, "end_line": 96, "violates": [ "0 <= nums[i] <= 400" ] }, { "line": 116, "end_line": 116, "violates": [ "0 <= nums[i] <= 400", "0 <= nums[i] <= 400" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 199, "task_id": "binary-tree-right-side-view", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "populating-next-right-pointers-in-each-node", "boundary-of-binary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 93, "kept": 0, "dropped": { "unreadable": 93 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 100].", "-100 <= Node.val <= 100" ] }, { "question_id": 200, "task_id": "number-of-islands", "drop": [], "similar": [ "surrounded-regions", "walls-and-gates", "number-of-islands-ii", "number-of-connected-components-in-an-undirected-graph", "battleships-in-a-board", "number-of-distinct-islands", "max-area-of-island", "count-sub-islands", "find-all-groups-of-farmland", "count-unreachable-pairs-of-nodes-in-an-undirected-graph", "maximum-number-of-fish-in-a-grid", "count-islands-with-total-value-divisible-by-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 59, "kept": 59, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "grid[i][j] is '0' or '1'." ], "public_tests": 2, "hints": [] }, { "question_id": 201, "task_id": "bitwise-and-of-numbers-range", "drop": [], "similar": [ "longest-nice-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "left", "right" ], "tests": { "total": 97, "kept": 97, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 202, "task_id": "happy-number", "drop": [], "similar": [ "linked-list-cycle", "add-digits", "ugly-number", "sum-of-digits-of-string-after-convert", "minimum-addition-to-make-integer-beautiful", "smallest-value-after-replacing-with-sum-of-prime-factors", "count-the-digits-that-divide-a-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 55, "kept": 53, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= n <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 203, "task_id": "remove-linked-list-elements", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "remove-element", "delete-node-in-a-linked-list", "delete-the-middle-node-of-a-linked-list", "delete-nodes-from-linked-list-present-in-array", "convert-doubly-linked-list-to-array-i", "convert-doubly-linked-list-to-array-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head", "val" ], "tests": { "total": 12, "kept": 0, "dropped": { "unreadable": 12 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 113, "end_line": 113, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is in the range [0, 10**(4)].", "1 <= Node.val <= 50" ] }, { "question_id": 204, "task_id": "count-primes", "drop": [], "similar": [ "ugly-number", "ugly-number-ii", "perfect-squares", "number-of-common-factors", "prime-pairs-with-target-sum", "find-the-count-of-numbers-which-are-not-special" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 33, "kept": 30, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "0 <= n <= 5 * 10**(6)" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= n <= 5 * 10**(6)" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= n <= 5 * 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Checking all the integers in the range [1, n - 1] is not efficient. Think about a better approach.", "Since most of the numbers are not primes, we need a fast approach to exclude the non-prime integers.", "Use Sieve of Eratosthenes." ] }, { "question_id": 205, "task_id": "isomorphic-strings", "drop": [], "similar": [ "word-pattern", "find-and-replace-pattern" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 131, "kept": 94, "dropped": { "constraint_violation": 37 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "t.length == s.length" ] }, { "line": 26, "end_line": 26, "violates": [ "t.length == s.length" ] }, { "line": 34, "end_line": 34, "violates": [ "t.length == s.length" ] }, { "line": 37, "end_line": 37, "violates": [ "t.length == s.length" ] }, { "line": 50, "end_line": 50, "violates": [ "t.length == s.length" ] }, { "line": 53, "end_line": 53, "violates": [ "t.length == s.length" ] }, { "line": 55, "end_line": 55, "violates": [ "t.length == s.length" ] }, { "line": 60, "end_line": 60, "violates": [ "t.length == s.length" ] }, { "line": 63, "end_line": 63, "violates": [ "t.length == s.length" ] }, { "line": 64, "end_line": 64, "violates": [ "t.length == s.length" ] }, { "line": 68, "end_line": 68, "violates": [ "t.length == s.length" ] }, { "line": 70, "end_line": 70, "violates": [ "t.length == s.length" ] }, { "line": 71, "end_line": 71, "violates": [ "t.length == s.length" ] }, { "line": 73, "end_line": 73, "violates": [ "t.length == s.length" ] }, { "line": 74, "end_line": 74, "violates": [ "t.length == s.length" ] }, { "line": 76, "end_line": 76, "violates": [ "t.length == s.length" ] }, { "line": 78, "end_line": 78, "violates": [ "t.length == s.length" ] }, { "line": 79, "end_line": 79, "violates": [ "t.length == s.length" ] }, { "line": 88, "end_line": 88, "violates": [ "t.length == s.length" ] }, { "line": 89, "end_line": 89, "violates": [ "t.length == s.length" ] }, { "line": 90, "end_line": 90, "violates": [ "t.length == s.length" ] }, { "line": 94, "end_line": 94, "violates": [ "t.length == s.length" ] }, { "line": 96, "end_line": 96, "violates": [ "t.length == s.length" ] }, { "line": 99, "end_line": 99, "violates": [ "t.length == s.length" ] }, { "line": 100, "end_line": 100, "violates": [ "t.length == s.length" ] }, { "line": 102, "end_line": 102, "violates": [ "t.length == s.length" ] }, { "line": 103, "end_line": 103, "violates": [ "t.length == s.length" ] }, { "line": 105, "end_line": 105, "violates": [ "t.length == s.length" ] }, { "line": 107, "end_line": 107, "violates": [ "t.length == s.length" ] }, { "line": 110, "end_line": 110, "violates": [ "t.length == s.length" ] }, { "line": 113, "end_line": 113, "violates": [ "t.length == s.length" ] }, { "line": 114, "end_line": 114, "violates": [ "t.length == s.length" ] }, { "line": 116, "end_line": 116, "violates": [ "t.length == s.length" ] }, { "line": 121, "end_line": 121, "violates": [ "t.length == s.length" ] }, { "line": 124, "end_line": 124, "violates": [ "t.length == s.length" ] }, { "line": 128, "end_line": 128, "violates": [ "t.length == s.length" ] }, { "line": 131, "end_line": 131, "violates": [ "t.length == s.length" ] } ], "unchecked_constraints": [ "s and t consist of any valid ascii character." ], "public_tests": 3, "hints": [] }, { "question_id": 206, "task_id": "reverse-linked-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "reverse-linked-list-ii", "binary-tree-upside-down", "palindrome-linked-list", "reverse-nodes-in-even-length-groups", "maximum-twin-sum-of-a-linked-list", "remove-nodes-from-linked-list", "insert-greatest-common-divisors-in-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 1, "kept": 0, "dropped": { "unreadable": 1 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is the range [0, 5000].", "-5000 <= Node.val <= 5000" ] }, { "question_id": 207, "task_id": "course-schedule", "drop": [], "similar": [ "course-schedule-ii", "graph-valid-tree", "minimum-height-trees", "course-schedule-iii", "build-a-matrix-with-conditions" ], "flags": [], "comparison": "exact", "parameter_names": [ "numCourses", "prerequisites" ], "tests": { "total": 79, "kept": 79, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All the pairs prerequisites[i] are unique." ], "public_tests": 2, "hints": [ "This problem is equivalent to finding if a cycle exists in a directed graph. If a cycle exists, no topological ordering exists and therefore it will be impossible to take all courses.", "Topological Sort via DFS - A great tutorial explaining the basic concepts of Topological Sort.", "Topological sort could also be done via BFS." ] }, { "question_id": 209, "task_id": "minimum-size-subarray-sum", "drop": [], "similar": [ "minimum-window-substring", "maximum-size-subarray-sum-equals-k", "maximum-length-of-repeated-subarray", "minimum-operations-to-reduce-x-to-zero", "k-radius-subarray-averages", "maximum-product-after-k-increments", "shortest-subarray-with-or-at-least-k-i", "minimum-positive-sum-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "target", "nums" ], "tests": { "total": 73, "kept": 72, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [], "similar_to_test": [ "3364 minimum-positive-sum-subarray" ] }, { "question_id": 210, "task_id": "course-schedule-ii", "drop": [], "similar": [ "course-schedule", "alien-dictionary", "minimum-height-trees", "sequence-reconstruction", "course-schedule-iii", "parallel-courses", "find-all-possible-recipes-from-given-supplies", "build-a-matrix-with-conditions", "sort-array-by-moving-items-to-empty-space" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "numCourses", "prerequisites" ], "tests": { "total": 91, "kept": 89, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 66, "end_line": 66, "violates": [ "ai != bi" ] }, { "line": 84, "end_line": 84, "violates": [ "ai != bi" ] } ], "unchecked_constraints": [ "All the pairs [ai, bi] are distinct." ], "public_tests": 3, "hints": [ "This problem is equivalent to finding the topological order in a directed graph. If a cycle exists, no topological ordering exists and therefore it will be impossible to take all courses.", "Topological Sort via DFS - A great video tutorial (21 minutes) on Coursera explaining the basic concepts of Topological Sort.", "Topological sort could also be done via BFS." ] }, { "question_id": 212, "task_id": "word-search-ii", "drop": [], "similar": [ "word-search", "unique-paths-iii", "encrypt-and-decrypt-strings" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board", "words" ], "tests": { "total": 83, "kept": 72, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 64, "end_line": 64, "violates": [ "All the strings of words are unique." ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= words[i].length <= 10" ] } ], "unchecked_constraints": [ "board[i][j] is a lowercase English letter." ], "public_tests": 2, "hints": [ "You would need to optimize your backtracking to pass the larger test. Could you stop backtracking earlier?", "If the current candidate does not exist in all words' prefix, you could stop backtracking immediately. What kind of data structure could answer such query efficiently? Does a hash table work? Why or why not? How about a Trie? If you would like to learn how to implement a basic trie, please work on this problem: Implement Trie (Prefix Tree) first." ] }, { "question_id": 213, "task_id": "house-robber-ii", "drop": [], "similar": [ "house-robber", "paint-house", "paint-fence", "house-robber-iii", "non-negative-integers-without-consecutive-ones", "coin-path" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 122, "kept": 122, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Since House[1] and House[n] are adjacent, they cannot be robbed together. Therefore, the problem becomes to rob either House[1]-House[n-1] or House[2]-House[n], depending on which choice offers more money. Now the problem has degenerated to the House Robber, which is already been solved." ] }, { "question_id": 214, "task_id": "shortest-palindrome", "drop": [], "similar": [ "longest-palindromic-substring", "find-the-index-of-the-first-occurrence-in-a-string", "palindrome-pairs", "maximum-deletions-on-a-string", "smallest-palindromic-rearrangement-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 157, "kept": 157, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 215, "task_id": "kth-largest-element-in-an-array", "drop": [], "similar": [ "wiggle-sort-ii", "top-k-frequent-elements", "third-maximum-number", "kth-largest-element-in-a-stream", "k-closest-points-to-origin", "find-the-kth-largest-integer-in-the-array", "find-subsequence-of-length-k-with-the-largest-sum", "k-highest-ranked-items-within-a-price-range" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 78, "kept": 78, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 216, "task_id": "combination-sum-iii", "drop": [], "similar": [ "combination-sum" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "k", "n" ], "tests": { "total": 62, "kept": 57, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= n <= 60" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= n <= 60" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= n <= 60" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= n <= 60" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= n <= 60" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 217, "task_id": "contains-duplicate", "drop": [], "similar": [ "contains-duplicate-ii", "contains-duplicate-iii", "make-array-zero-by-subtracting-equal-amounts", "find-valid-pair-of-adjacent-digits-in-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 94, "kept": 91, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [], "similar_to_test": [ "3438 find-valid-pair-of-adjacent-digits-in-string" ] }, { "question_id": 218, "task_id": "the-skyline-problem", "drop": [], "similar": [ "falling-squares", "shifting-letters-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "buildings" ], "tests": { "total": 101, "kept": 82, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= heighti <= 2**(31) - 1" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= heighti <= 2**(31) - 1" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= lefti < righti <= 2**(31) - 1" ] } ], "unchecked_constraints": [ "buildings is sorted by lefti in non-decreasing order." ], "public_tests": 2, "hints": [] }, { "question_id": 219, "task_id": "contains-duplicate-ii", "drop": [], "similar": [ "contains-duplicate", "contains-duplicate-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 106, "kept": 101, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 71, "end_line": 71, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 102, "end_line": 102, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 220, "task_id": "contains-duplicate-iii", "drop": [], "similar": [ "contains-duplicate", "contains-duplicate-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "indexDiff", "valueDiff" ], "tests": { "total": 238, "kept": 210, "dropped": { "constraint_violation": 28 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "-10**(9) <= nums[i] <= 10**(9)", "0 <= valueDiff <= 10**(9)" ] }, { "line": 16, "end_line": 16, "violates": [ "-10**(9) <= nums[i] <= 10**(9)", "-10**(9) <= nums[i] <= 10**(9)", "0 <= valueDiff <= 10**(9)", "0 <= valueDiff <= 10**(9)" ] }, { "line": 31, "end_line": 31, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= valueDiff <= 10**(9)", "0 <= valueDiff <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= valueDiff <= 10**(9)", "0 <= valueDiff <= 10**(9)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= indexDiff <= nums.length" ] }, { "line": 57, "end_line": 57, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= valueDiff <= 10**(9)" ] }, { "line": 84, "end_line": 84, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 113, "end_line": 113, "violates": [ "0 <= valueDiff <= 10**(9)" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= indexDiff <= nums.length" ] }, { "line": 126, "end_line": 126, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 141, "end_line": 141, "violates": [ "-10**(9) <= nums[i] <= 10**(9)", "0 <= valueDiff <= 10**(9)" ] }, { "line": 142, "end_line": 142, "violates": [ "2 <= nums.length <= 10**(5)" ] }, { "line": 166, "end_line": 166, "violates": [ "-10**(9) <= nums[i] <= 10**(9)", "0 <= valueDiff <= 10**(9)" ] }, { "line": 168, "end_line": 168, "violates": [ "0 <= valueDiff <= 10**(9)", "0 <= valueDiff <= 10**(9)" ] }, { "line": 172, "end_line": 172, "violates": [ "-10**(9) <= nums[i] <= 10**(9)", "0 <= valueDiff <= 10**(9)" ] }, { "line": 178, "end_line": 178, "violates": [ "0 <= valueDiff <= 10**(9)", "0 <= valueDiff <= 10**(9)" ] }, { "line": 190, "end_line": 190, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 191, "end_line": 191, "violates": [ "-10**(9) <= nums[i] <= 10**(9)", "0 <= valueDiff <= 10**(9)" ] }, { "line": 200, "end_line": 200, "violates": [ "1 <= indexDiff <= nums.length" ] }, { "line": 218, "end_line": 218, "violates": [ "-10**(9) <= nums[i] <= 10**(9)", "0 <= valueDiff <= 10**(9)" ] }, { "line": 221, "end_line": 221, "violates": [ "0 <= valueDiff <= 10**(9)" ] }, { "line": 222, "end_line": 222, "violates": [ "1 <= indexDiff <= nums.length" ] }, { "line": 227, "end_line": 227, "violates": [ "-10**(9) <= nums[i] <= 10**(9)", "-10**(9) <= nums[i] <= 10**(9)", "0 <= valueDiff <= 10**(9)", "0 <= valueDiff <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Time complexity O(n logk) - This will give an indication that sorting is involved for k elements.", "Use already existing state to evaluate next state - Like, a set of k sorted numbers are only needed to be tracked. When we are processing the next number in array, then we can utilize the existing sorted state and it is not necessary to sort next overlapping set of k numbers again." ] }, { "question_id": 221, "task_id": "maximal-square", "drop": [], "similar": [ "maximal-rectangle", "largest-plus-sign", "count-artifacts-that-can-be-extracted", "stamping-the-grid", "maximize-area-of-square-hole-in-grid" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 68, "kept": 68, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "matrix[i][j] is '0' or '1'." ], "public_tests": 3, "hints": [] }, { "question_id": 222, "task_id": "count-complete-tree-nodes", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "closest-binary-search-tree-value" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 59, "kept": 0, "dropped": { "unreadable": 59 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 5 * 10**(4)].", "0 <= Node.val <= 5 * 10**(4)", "The tree is guaranteed to be complete." ] }, { "question_id": 223, "task_id": "rectangle-area", "drop": [], "similar": [ "rectangle-overlap", "find-the-number-of-ways-to-place-people-ii", "find-the-number-of-ways-to-place-people-i", "find-the-largest-area-of-square-inside-two-rectangles" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "ax1", "ay1", "ax2", "ay2", "bx1", "by1", "bx2", "by2" ], "tests": { "total": 76, "kept": 74, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "-10**(4) <= bx1 <= bx2 <= 10**(4)", "-10**(4) <= by1 <= by2 <= 10**(4)" ] }, { "line": 42, "end_line": 42, "violates": [ "-10**(4) <= bx1 <= bx2 <= 10**(4)", "-10**(4) <= by1 <= by2 <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 224, "task_id": "basic-calculator", "drop": [], "similar": [ "evaluate-reverse-polish-notation", "basic-calculator-ii", "different-ways-to-add-parentheses", "expression-add-operators", "basic-calculator-iii", "the-score-of-students-solving-math-expression", "minimize-result-by-adding-parentheses-to-expression" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 174, "kept": 83, "dropped": { "constraint_violation": 91 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 15, "end_line": 15, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 26, "end_line": 26, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 35, "end_line": 35, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 37, "end_line": 37, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 40, "end_line": 40, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 41, "end_line": 41, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 42, "end_line": 42, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 44, "end_line": 44, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 45, "end_line": 45, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 49, "end_line": 49, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 50, "end_line": 50, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 51, "end_line": 51, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 52, "end_line": 52, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 53, "end_line": 53, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 54, "end_line": 54, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 57, "end_line": 57, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 58, "end_line": 58, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 61, "end_line": 61, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 62, "end_line": 62, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 67, "end_line": 67, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 68, "end_line": 68, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 70, "end_line": 70, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 71, "end_line": 71, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 73, "end_line": 73, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 74, "end_line": 74, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 75, "end_line": 75, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 76, "end_line": 76, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 78, "end_line": 78, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 80, "end_line": 80, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 81, "end_line": 81, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 83, "end_line": 83, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 84, "end_line": 84, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 86, "end_line": 86, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 87, "end_line": 87, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 89, "end_line": 89, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 93, "end_line": 93, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 97, "end_line": 97, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 98, "end_line": 98, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 99, "end_line": 99, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 100, "end_line": 100, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 102, "end_line": 102, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 104, "end_line": 104, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 105, "end_line": 105, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 106, "end_line": 106, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 107, "end_line": 107, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 110, "end_line": 110, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 111, "end_line": 111, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 112, "end_line": 112, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 113, "end_line": 113, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 115, "end_line": 115, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 117, "end_line": 117, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 118, "end_line": 118, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 121, "end_line": 121, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 122, "end_line": 122, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 123, "end_line": 123, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 124, "end_line": 124, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 125, "end_line": 125, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 126, "end_line": 126, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 128, "end_line": 128, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 131, "end_line": 131, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 135, "end_line": 135, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 138, "end_line": 138, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 139, "end_line": 139, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 140, "end_line": 140, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 141, "end_line": 141, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 142, "end_line": 142, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 143, "end_line": 143, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 144, "end_line": 144, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 145, "end_line": 145, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 147, "end_line": 147, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 149, "end_line": 149, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 150, "end_line": 150, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 151, "end_line": 151, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 153, "end_line": 153, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 154, "end_line": 154, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 157, "end_line": 157, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 159, "end_line": 159, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 160, "end_line": 160, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 162, "end_line": 162, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 163, "end_line": 163, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 164, "end_line": 164, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 165, "end_line": 165, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 166, "end_line": 166, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 167, "end_line": 167, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 168, "end_line": 168, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 170, "end_line": 170, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 171, "end_line": 171, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 172, "end_line": 172, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 173, "end_line": 173, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] }, { "line": 174, "end_line": 174, "violates": [ "s consists of digits, '+', '-', '(', ')', and ' '." ] } ], "unchecked_constraints": [ "s represents a valid expression.", "'+' is not used as a unary operation (i.e., \"+1\" and \"+(2 + 3)\" is invalid).", "'-' could be used as a unary operation (i.e., \"-1\" and \"-(2 + 3)\" is valid).", "There will be no two consecutive operators in the input.", "Every number and running calculation will fit in a signed 32-bit integer." ], "public_tests": 3, "hints": [] }, { "question_id": 226, "task_id": "invert-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "reverse-odd-levels-of-binary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 1, "kept": 0, "dropped": { "unreadable": 1 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 100].", "-100 <= Node.val <= 100" ] }, { "question_id": 227, "task_id": "basic-calculator-ii", "drop": [], "similar": [ "basic-calculator", "expression-add-operators", "basic-calculator-iii", "evaluate-valid-expressions" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 171, "kept": 128, "dropped": { "constraint_violation": 42, "int_overflow": 1 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 5, "end_line": 5, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 8, "end_line": 8, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 18, "end_line": 18, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 24, "end_line": 24, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 35, "end_line": 35, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 36, "end_line": 36, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 38, "end_line": 38, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 39, "end_line": 39, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 48, "end_line": 48, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 53, "end_line": 53, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 57, "end_line": 57, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 62, "end_line": 62, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 66, "end_line": 66, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 71, "end_line": 71, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 78, "end_line": 78, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 81, "end_line": 81, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 86, "end_line": 86, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 91, "end_line": 91, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 97, "end_line": 97, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 104, "end_line": 104, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 105, "end_line": 105, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 107, "end_line": 107, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 111, "end_line": 111, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 113, "end_line": 113, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 115, "end_line": 115, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 119, "end_line": 119, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 122, "end_line": 122, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 123, "end_line": 123, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 126, "end_line": 126, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 138, "end_line": 138, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 140, "end_line": 140, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 142, "end_line": 142, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 147, "end_line": 147, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 149, "end_line": 149, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 153, "end_line": 153, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 154, "end_line": 154, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 156, "end_line": 156, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 158, "end_line": 158, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 159, "end_line": 159, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 164, "end_line": 164, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 168, "end_line": 168, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] }, { "line": 172, "end_line": 172, "violates": [ "s consists of integers and operators ('+', '-', '*', '/') separated by some number of spaces." ] } ], "unchecked_constraints": [ "s represents a valid expression.", "All the integers in the expression are non-negative integers in the range [0, 2**(31) - 1].", "The answer is guaranteed to fit in a 32-bit integer." ], "public_tests": 3, "hints": [] }, { "question_id": 228, "task_id": "summary-ranges", "drop": [], "similar": [ "missing-ranges", "data-stream-as-disjoint-intervals", "find-maximal-uncovered-ranges" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 120, "kept": 94, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "nums is sorted in ascending order." ] }, { "line": 41, "end_line": 41, "violates": [ "nums is sorted in ascending order." ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 72, "end_line": 72, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 105, "end_line": 105, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 106, "end_line": 106, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 107, "end_line": 107, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 109, "end_line": 109, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 111, "end_line": 111, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 113, "end_line": 113, "violates": [ "nums is sorted in ascending order." ] }, { "line": 116, "end_line": 116, "violates": [ "0 <= nums.length <= 20" ] }, { "line": 121, "end_line": 121, "violates": [ "0 <= nums.length <= 20", "nums is sorted in ascending order." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 229, "task_id": "majority-element-ii", "drop": [], "similar": [ "majority-element", "check-if-a-number-is-majority-element-in-a-sorted-array", "most-frequent-even-element" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 77, "kept": 77, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think about the possible number of elements that can appear more than \u230a n/3 \u230b times in the array.", "It can be at most two. Why?", "Consider using Boyer-Moore Voting Algorithm, which is efficient for finding elements that appear more than a certain threshold." ] }, { "question_id": 230, "task_id": "kth-smallest-element-in-a-bst", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-inorder-traversal", "second-minimum-node-in-a-binary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "k" ], "tests": { "total": 78, "kept": 0, "dropped": { "unreadable": 78 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is n.", "1 <= k <= n <= 10**(4)", "0 <= Node.val <= 10**(4)" ] }, { "question_id": 231, "task_id": "power-of-two", "drop": [], "similar": [ "number-of-1-bits", "power-of-three", "power-of-four" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 103, "kept": 93, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 44, "end_line": 44, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 51, "end_line": 51, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 61, "end_line": 61, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 75, "end_line": 75, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 78, "end_line": 78, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 87, "end_line": 87, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 90, "end_line": 90, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 94, "end_line": 94, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 96, "end_line": 96, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 233, "task_id": "number-of-digit-one", "drop": [], "similar": [ "factorial-trailing-zeroes", "digit-count-in-range" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 76, "kept": 67, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Beware of overflow." ] }, { "question_id": 234, "task_id": "palindrome-linked-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "palindrome-number", "valid-palindrome", "reverse-linked-list", "maximum-twin-sum-of-a-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 91, "kept": 0, "dropped": { "unreadable": 91 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is in the range [1, 10**(5)].", "0 <= Node.val <= 9" ] }, { "question_id": 236, "task_id": "lowest-common-ancestor-of-a-binary-tree", "drop": [ "tree_or_linked_list", "interface", "too_few_tests" ], "similar": [ "lowest-common-ancestor-of-a-binary-search-tree", "smallest-common-region", "find-players-with-zero-or-one-losses", "lowest-common-ancestor-of-a-binary-tree-ii", "lowest-common-ancestor-of-a-binary-tree-iii", "lowest-common-ancestor-of-a-binary-tree-iv", "step-by-step-directions-from-a-binary-tree-node-to-another", "cycle-length-queries-in-a-tree" ], "interface_problems": [ "go: ValueError: Could not parse Go parameter: 'root'" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "p", "q" ], "tests": { "total": 20, "kept": 0, "dropped": { "unreadable": 20 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [2, 10**(5)].", "-10**(9) <= Node.val <= 10**(9)", "All Node.val are unique.", "p and q will exist in the tree." ] }, { "question_id": 238, "task_id": "product-of-array-except-self", "drop": [], "similar": [ "trapping-rain-water", "maximum-product-subarray", "paint-house-ii", "minimum-difference-in-sums-after-removal-of-elements", "construct-product-matrix", "find-sum-of-array-product-of-magical-sequences" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 100, "kept": 62, "dropped": { "int_overflow": 21, "constraint_violation": 17 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 16, "end_line": 16, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 20, "end_line": 20, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 22, "end_line": 22, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 23, "end_line": 23, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 24, "end_line": 24, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 25, "end_line": 25, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 26, "end_line": 26, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 28, "end_line": 28, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 32, "end_line": 32, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 33, "end_line": 33, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 34, "end_line": 34, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 36, "end_line": 36, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 37, "end_line": 37, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 40, "end_line": 40, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 41, "end_line": 41, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 42, "end_line": 42, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 46, "end_line": 46, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 47, "end_line": 47, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "java" ] }, { "line": 48, "end_line": 48, "violates": [ "-30 <= nums[i] <= 30", "-30 <= nums[i] <= 30" ] }, { "line": 51, "end_line": 51, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 52, "end_line": 52, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 55, "end_line": 55, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 56, "end_line": 56, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "java" ] }, { "line": 57, "end_line": 57, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 58, "end_line": 58, "violates": [ "-30 <= nums[i] <= 30", "-30 <= nums[i] <= 30" ] }, { "line": 59, "end_line": 59, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 61, "end_line": 61, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 62, "end_line": 62, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 63, "end_line": 63, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 64, "end_line": 64, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 67, "end_line": 67, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 74, "end_line": 74, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 75, "end_line": 75, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 82, "end_line": 82, "violates": [ "-30 <= nums[i] <= 30" ] }, { "line": 94, "end_line": 94, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 95, "end_line": 95, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 100, "end_line": 100, "unrepresentable_in": [ "cpp", "rust", "java" ] } ], "unchecked_constraints": [ "The input is generated such that answer[i] is guaranteed to fit in a 32-bit integer." ], "public_tests": 2, "hints": [ "Think how you can efficiently utilize prefix and suffix products to calculate the product of all elements except self for each index. Can you pre-compute the prefix and suffix products in linear time to avoid redundant calculations?", "Can you minimize additional space usage by reusing memory or modifying the input array to store intermediate results?" ] }, { "question_id": 239, "task_id": "sliding-window-maximum", "drop": [], "similar": [ "minimum-window-substring", "min-stack", "longest-substring-with-at-most-two-distinct-characters", "paint-house-ii", "jump-game-vi", "maximum-number-of-robots-within-budget", "maximum-tastiness-of-candy-basket", "maximal-score-after-applying-k-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 104, "kept": 104, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How about using a data structure such as deque (double-ended queue)?", "The queue size need not be the same as the window\u2019s size.", "Remove redundant elements and the queue should store only elements that need to be considered." ] }, { "question_id": 240, "task_id": "search-a-2d-matrix-ii", "drop": [], "similar": [ "search-a-2d-matrix" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix", "target" ], "tests": { "total": 95, "kept": 92, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "-10**(9) <= matrix[i][j] <= 10**(9)", "-10**(9) <= target <= 10**(9)" ] }, { "line": 23, "end_line": 23, "violates": [ "-10**(9) <= matrix[i][j] <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "-10**(9) <= matrix[i][j] <= 10**(9)", "-10**(9) <= target <= 10**(9)" ] } ], "unchecked_constraints": [ "All the integers in each row are sorted in ascending order.", "All the integers in each column are sorted in ascending order." ], "public_tests": 2, "hints": [] }, { "question_id": 241, "task_id": "different-ways-to-add-parentheses", "drop": [], "similar": [ "unique-binary-search-trees-ii", "basic-calculator", "expression-add-operators", "the-score-of-students-solving-math-expression", "minimize-result-by-adding-parentheses-to-expression" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "expression" ], "tests": { "total": 189, "kept": 114, "dropped": { "constraint_violation": 75 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 15, "end_line": 15, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 22, "end_line": 22, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 33, "end_line": 33, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= expression.length <= 20", "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 39, "end_line": 39, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 41, "end_line": 41, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= expression.length <= 20" ] }, { "line": 43, "end_line": 43, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 45, "end_line": 45, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 46, "end_line": 46, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 48, "end_line": 48, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 49, "end_line": 49, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 51, "end_line": 51, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 53, "end_line": 53, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 57, "end_line": 57, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 59, "end_line": 59, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 61, "end_line": 61, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 63, "end_line": 63, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 64, "end_line": 64, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 65, "end_line": 65, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 66, "end_line": 66, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= expression.length <= 20" ] }, { "line": 75, "end_line": 75, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 77, "end_line": 77, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 78, "end_line": 78, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 79, "end_line": 79, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 82, "end_line": 82, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 83, "end_line": 83, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 87, "end_line": 87, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 89, "end_line": 89, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 92, "end_line": 92, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 93, "end_line": 93, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 95, "end_line": 95, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 97, "end_line": 97, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 100, "end_line": 100, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 101, "end_line": 101, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 105, "end_line": 105, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= expression.length <= 20" ] }, { "line": 113, "end_line": 113, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 115, "end_line": 115, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 119, "end_line": 119, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 122, "end_line": 122, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 123, "end_line": 123, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 125, "end_line": 125, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 127, "end_line": 127, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 129, "end_line": 129, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 130, "end_line": 130, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 131, "end_line": 131, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 132, "end_line": 132, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 136, "end_line": 136, "violates": [ "1 <= expression.length <= 20" ] }, { "line": 139, "end_line": 139, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 140, "end_line": 140, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 142, "end_line": 142, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 144, "end_line": 144, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 145, "end_line": 145, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 146, "end_line": 146, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 150, "end_line": 150, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 152, "end_line": 152, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 154, "end_line": 154, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 155, "end_line": 155, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 156, "end_line": 156, "violates": [ "1 <= expression.length <= 20", "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 157, "end_line": 157, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 162, "end_line": 162, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 164, "end_line": 164, "violates": [ "1 <= expression.length <= 20" ] }, { "line": 171, "end_line": 171, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 172, "end_line": 172, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 173, "end_line": 173, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 175, "end_line": 175, "violates": [ "1 <= expression.length <= 20" ] }, { "line": 178, "end_line": 178, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 180, "end_line": 180, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 183, "end_line": 183, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 184, "end_line": 184, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 185, "end_line": 185, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] }, { "line": 189, "end_line": 189, "violates": [ "expression consists of digits and the operator '+', '-', and '*'." ] } ], "unchecked_constraints": [ "All the integer values in the input expression are in the range [0, 99].", "The integer values in the input expression do not have a leading '-' or '+' denoting the sign." ], "public_tests": 2, "hints": [] }, { "question_id": 242, "task_id": "valid-anagram", "drop": [], "similar": [ "group-anagrams", "palindrome-permutation", "find-all-anagrams-in-a-string", "find-resultant-array-after-removing-anagrams" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 107, "kept": 86, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= s.length, t.length <= 5 * 10**(4)" ] }, { "line": 21, "end_line": 21, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 26, "end_line": 26, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 29, "end_line": 29, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 31, "end_line": 31, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 35, "end_line": 35, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= s.length, t.length <= 5 * 10**(4)" ] }, { "line": 39, "end_line": 39, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 40, "end_line": 40, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 43, "end_line": 43, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 47, "end_line": 47, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 58, "end_line": 58, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 59, "end_line": 59, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 66, "end_line": 66, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 67, "end_line": 67, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 68, "end_line": 68, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 69, "end_line": 69, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 73, "end_line": 73, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 86, "end_line": 86, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= s.length, t.length <= 5 * 10**(4)" ] }, { "line": 102, "end_line": 102, "violates": [ "s and t consist of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 243, "task_id": "shortest-word-distance", "drop": [ "premium" ] }, { "question_id": 245, "task_id": "shortest-word-distance-iii", "drop": [ "premium" ] }, { "question_id": 246, "task_id": "strobogrammatic-number", "drop": [ "premium" ] }, { "question_id": 247, "task_id": "strobogrammatic-number-ii", "drop": [ "premium" ] }, { "question_id": 248, "task_id": "strobogrammatic-number-iii", "drop": [ "premium" ] }, { "question_id": 249, "task_id": "group-shifted-strings", "drop": [ "premium" ] }, { "question_id": 250, "task_id": "count-univalue-subtrees", "drop": [ "premium" ] }, { "question_id": 252, "task_id": "meeting-rooms", "drop": [ "premium" ] }, { "question_id": 253, "task_id": "meeting-rooms-ii", "drop": [ "premium" ] }, { "question_id": 254, "task_id": "factor-combinations", "drop": [ "premium" ] }, { "question_id": 255, "task_id": "verify-preorder-sequence-in-binary-search-tree", "drop": [ "premium" ] }, { "question_id": 256, "task_id": "paint-house", "drop": [ "premium" ] }, { "question_id": 257, "task_id": "binary-tree-paths", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "path-sum-ii", "smallest-string-starting-from-leaf", "step-by-step-directions-from-a-binary-tree-node-to-another" ], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "root" ], "tests": { "total": 79, "kept": 0, "dropped": { "unreadable": 79 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 100].", "-100 <= Node.val <= 100" ] }, { "question_id": 258, "task_id": "add-digits", "drop": [], "similar": [ "happy-number", "sum-of-digits-in-the-minimum-number", "sum-of-digits-of-string-after-convert", "minimum-sum-of-four-digit-number-after-splitting-digits", "calculate-digit-sum-of-a-string", "difference-between-element-sum-and-digit-sum-of-an-array", "alternating-digit-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 75, "kept": 37, "dropped": { "constraint_violation": 38 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 35, "end_line": 35, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 72, "end_line": 72, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 73, "end_line": 73, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= num <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "A naive implementation of the above process is trivial. Could you come up with other methods?", "What are all the possible results?", "How do they occur, periodically or randomly?", "You may find this Wikipedia article useful." ] }, { "question_id": 259, "task_id": "3sum-smaller", "drop": [ "premium" ] }, { "question_id": 260, "task_id": "single-number-iii", "drop": [], "similar": [ "single-number", "single-number-ii", "find-the-original-array-of-prefix-xor", "find-the-xor-of-numbers-which-appear-twice" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums" ], "tests": { "total": 102, "kept": 97, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "-2**(31) <= nums[i] <= 2**(31) - 1" ] }, { "line": 20, "end_line": 20, "violates": [ "-2**(31) <= nums[i] <= 2**(31) - 1" ] }, { "line": 31, "end_line": 31, "violates": [ "-2**(31) <= nums[i] <= 2**(31) - 1" ] }, { "line": 55, "end_line": 55, "violates": [ "-2**(31) <= nums[i] <= 2**(31) - 1" ] }, { "line": 92, "end_line": 92, "violates": [ "-2**(31) <= nums[i] <= 2**(31) - 1" ] } ], "unchecked_constraints": [ "Each integer in nums will appear twice, only two integers will appear once." ], "public_tests": 3, "hints": [] }, { "question_id": 261, "task_id": "graph-valid-tree", "drop": [ "premium" ] }, { "question_id": 263, "task_id": "ugly-number", "drop": [], "similar": [ "happy-number", "count-primes", "ugly-number-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 74, "kept": 61, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 19, "end_line": 19, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 24, "end_line": 24, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 25, "end_line": 25, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 32, "end_line": 32, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 36, "end_line": 36, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 37, "end_line": 37, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 50, "end_line": 50, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 54, "end_line": 54, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 61, "end_line": 61, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 64, "end_line": 64, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 67, "end_line": 67, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 70, "end_line": 70, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 264, "task_id": "ugly-number-ii", "drop": [], "similar": [ "merge-k-sorted-lists", "count-primes", "ugly-number", "perfect-squares", "super-ugly-number", "ugly-number-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 38, "kept": 38, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The naive approach is to call isUgly for every number until you reach the n^th one. Most numbers are not ugly. Try to focus your effort on generating only the ugly ones.", "An ugly number must be multiplied by either 2, 3, or 5 from a smaller ugly number.", "The key is how to maintain the order of the ugly numbers. Try a similar approach of merging from three sorted lists: L_1, L_2, and L_3.", "Assume you have U_k, the k^th ugly number. Then U_{k+1} must be Min(L_1 * 2, L_2 * 3, L_3 * 5)." ] }, { "question_id": 265, "task_id": "paint-house-ii", "drop": [ "premium" ] }, { "question_id": 266, "task_id": "palindrome-permutation", "drop": [ "premium" ] }, { "question_id": 267, "task_id": "palindrome-permutation-ii", "drop": [ "premium" ] }, { "question_id": 268, "task_id": "missing-number", "drop": [], "similar": [ "first-missing-positive", "single-number", "find-the-duplicate-number", "couples-holding-hands", "find-unique-binary-string", "find-the-largest-almost-missing-integer" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 47, "kept": 40, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "0 <= nums[i] <= n" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= nums[i] <= n" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= nums[i] <= n" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= nums[i] <= n" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= nums[i] <= n" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= nums[i] <= n" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= nums[i] <= n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [], "similar_to_test": [ "3471 find-the-largest-almost-missing-integer" ] }, { "question_id": 269, "task_id": "alien-dictionary", "drop": [ "premium" ] }, { "question_id": 270, "task_id": "closest-binary-search-tree-value", "drop": [ "premium" ] }, { "question_id": 272, "task_id": "closest-binary-search-tree-value-ii", "drop": [ "premium" ] }, { "question_id": 273, "task_id": "integer-to-english-words", "drop": [], "similar": [ "integer-to-roman" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 74, "kept": 70, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= num <= 2**(31) - 1" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= num <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Did you see a pattern in dividing the number into chunk of words? For example, 123 and 123000.", "Group the number by thousands (3 digits). You can write a helper function that takes a number less than 1000 and convert just that chunk to words.", "There are many edge cases. What are some good test cases? Does your code work with input such as 0? Or 1000010? (middle chunk is zero and should not be printed out)" ] }, { "question_id": 274, "task_id": "h-index", "drop": [], "similar": [ "h-index-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "citations" ], "tests": { "total": 79, "kept": 78, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 40, "end_line": 40, "violates": [ "0 <= citations[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "An easy approach is to sort the array first.", "What are the possible values of h-index?", "A faster approach is to use extra space." ] }, { "question_id": 275, "task_id": "h-index-ii", "drop": [], "similar": [ "h-index" ], "flags": [], "comparison": "exact", "parameter_names": [ "citations" ], "tests": { "total": 80, "kept": 78, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 51, "end_line": 51, "violates": [ "citations is sorted in ascending order." ] }, { "line": 55, "end_line": 55, "violates": [ "citations is sorted in ascending order." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Expected runtime complexity is in O(log n) and the input is sorted." ] }, { "question_id": 276, "task_id": "paint-fence", "drop": [ "premium" ] }, { "question_id": 278, "task_id": "first-bad-version", "drop": [ "interface", "too_few_tests" ], "similar": [ "find-first-and-last-position-of-element-in-sorted-array", "search-insert-position", "guess-number-higher-or-lower" ], "interface_problems": [ "cpp: ValueError: Could not parse parameter: 'int version);\\n\\nclass Solution {\\npublic:\\n int firstBadVersion(int n'", "rust: ValueError: Could not parse Rust parameter: '&self'", "typescript: unparsed signature", "go: ValueError: Could not parse Go parameter: 'version int) bool;\\n */\\n\\nfunc firstBadVersion(n int'" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 1, "kept": 1, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= bad <= n <= 2**(31) - 1" ] }, { "question_id": 279, "task_id": "perfect-squares", "drop": [], "similar": [ "count-primes", "ugly-number-ii", "ways-to-express-an-integer-as-sum-of-powers" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 75, "kept": 74, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= n <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 280, "task_id": "wiggle-sort", "drop": [ "premium" ] }, { "question_id": 282, "task_id": "expression-add-operators", "drop": [], "similar": [ "evaluate-reverse-polish-notation", "basic-calculator", "basic-calculator-ii", "different-ways-to-add-parentheses", "target-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "num", "target" ], "tests": { "total": 67, "kept": 66, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "-2**(31) <= target <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Note that a number can contain multiple digits.", "Since the question asks us to find all of the valid expressions, we need a way to iterate over all of them. (Hint: Recursion!)", "We can keep track of the expression string and evaluate it at the very end. But that would take a lot of time. Can we keep track of the expression's value as well so as to avoid the evaluation at the very end of recursion?", "Think carefully about the multiply operator. It has a higher precedence than the addition and subtraction operators.\n1 + 2 = 3\n1 + 2 - 4 --> 3 - 4 --> -1\n1 + 2 - 4 * 12 --> -1 * 12 --> -12 (WRONG!)\n1 + 2 - 4 * 12 --> -1 - (-4) + (-4 * 12) --> 3 + (-48) --> -45 (CORRECT!)", "We simply need to keep track of the last operand in our expression and reverse it's effect on the expression's value while considering the multiply operator." ] }, { "question_id": 283, "task_id": "move-zeroes", "drop": [ "in_place", "interface" ], "similar": [ "remove-element", "apply-operations-to-an-array" ], "interface_problems": [ "rust: unparsed signature" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 126, "kept": 126, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 286, "task_id": "walls-and-gates", "drop": [ "premium" ] }, { "question_id": 287, "task_id": "find-the-duplicate-number", "drop": [], "similar": [ "first-missing-positive", "single-number", "linked-list-cycle-ii", "missing-number", "set-mismatch" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 87, "kept": 77, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= n" ] } ], "unchecked_constraints": [ "All the integers in nums appear only once except for precisely one integer which appears two or more times." ], "public_tests": 3, "hints": [] }, { "question_id": 289, "task_id": "game-of-life", "drop": [ "in_place", "interface" ], "similar": [ "set-matrix-zeroes" ], "interface_problems": [ "rust: unparsed signature" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board" ], "tests": { "total": 76, "kept": 76, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "board[i][j] is 0 or 1." ] }, { "question_id": 290, "task_id": "word-pattern", "drop": [], "similar": [ "isomorphic-strings", "word-pattern-ii", "find-and-replace-pattern" ], "flags": [], "comparison": "exact", "parameter_names": [ "pattern", "s" ], "tests": { "total": 147, "kept": 147, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s does not contain any leading or trailing spaces.", "All the words in s are separated by a single space." ], "public_tests": 3, "hints": [] }, { "question_id": 291, "task_id": "word-pattern-ii", "drop": [ "premium" ] }, { "question_id": 292, "task_id": "nim-game", "drop": [], "similar": [ "flip-game-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 114, "kept": 114, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If there are 5 stones in the heap, could you figure out a way to remove the stones such that you will always be the winner?" ] }, { "question_id": 293, "task_id": "flip-game", "drop": [ "premium" ] }, { "question_id": 294, "task_id": "flip-game-ii", "drop": [ "premium" ] }, { "question_id": 296, "task_id": "best-meeting-point", "drop": [ "premium" ] }, { "question_id": 298, "task_id": "binary-tree-longest-consecutive-sequence", "drop": [ "premium" ] }, { "question_id": 299, "task_id": "bulls-and-cows", "drop": [], "similar": [ "make-number-of-distinct-characters-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "secret", "guess" ], "tests": { "total": 115, "kept": 115, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 300, "task_id": "longest-increasing-subsequence", "drop": [], "similar": [ "increasing-triplet-subsequence", "russian-doll-envelopes", "maximum-length-of-pair-chain", "number-of-longest-increasing-subsequence", "minimum-ascii-delete-sum-for-two-strings", "minimum-number-of-removals-to-make-mountain-array", "find-the-longest-valid-obstacle-course-at-each-position", "minimum-operations-to-make-the-array-k-increasing", "longest-ideal-subsequence", "maximum-number-of-books-you-can-take", "longest-increasing-subsequence-ii", "find-the-maximum-length-of-a-good-subsequence-ii", "find-the-maximum-length-of-a-good-subsequence-i", "find-the-maximum-length-of-valid-subsequence-i", "find-the-maximum-length-of-valid-subsequence-ii", "longest-subsequence-with-decreasing-adjacent-difference" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 134, "kept": 133, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "-10**(4) <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [], "similar_to_test": [ "3409 longest-subsequence-with-decreasing-adjacent-difference" ] }, { "question_id": 302, "task_id": "smallest-rectangle-enclosing-black-pixels", "drop": [ "premium" ] }, { "question_id": 305, "task_id": "number-of-islands-ii", "drop": [ "premium" ] }, { "question_id": 306, "task_id": "additive-number", "drop": [], "similar": [ "split-array-into-fibonacci-sequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 93, "kept": 37, "dropped": { "constraint_violation": 56 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= num.length <= 35" ] }, { "line": 4, "end_line": 4, "violates": [ "1 <= num.length <= 35" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= num.length <= 35" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= num.length <= 35" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= num.length <= 35" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= num.length <= 35" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= num.length <= 35" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= num.length <= 35" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= num.length <= 35" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= num.length <= 35" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= num.length <= 35" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= num.length <= 35" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= num.length <= 35" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= num.length <= 35" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= num.length <= 35" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= num.length <= 35" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= num.length <= 35" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= num.length <= 35" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= num.length <= 35" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= num.length <= 35" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= num.length <= 35" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= num.length <= 35" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= num.length <= 35" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= num.length <= 35" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= num.length <= 35" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= num.length <= 35" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= num.length <= 35" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= num.length <= 35" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= num.length <= 35" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= num.length <= 35" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= num.length <= 35" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= num.length <= 35" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= num.length <= 35" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= num.length <= 35" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= num.length <= 35" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= num.length <= 35" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= num.length <= 35" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= num.length <= 35" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= num.length <= 35" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= num.length <= 35" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= num.length <= 35" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= num.length <= 35" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= num.length <= 35" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= num.length <= 35" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= num.length <= 35" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= num.length <= 35" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= num.length <= 35" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= num.length <= 35" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= num.length <= 35" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= num.length <= 35" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= num.length <= 35" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= num.length <= 35" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= num.length <= 35" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= num.length <= 35" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= num.length <= 35" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= num.length <= 35" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 309, "task_id": "best-time-to-buy-and-sell-stock-with-cooldown", "drop": [], "similar": [ "best-time-to-buy-and-sell-stock", "best-time-to-buy-and-sell-stock-ii", "best-time-to-buy-and-sell-stock-with-cooldown-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "prices" ], "tests": { "total": 108, "kept": 107, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 62, "end_line": 62, "violates": [ "0 <= prices[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 310, "task_id": "minimum-height-trees", "drop": [], "similar": [ "course-schedule", "course-schedule-ii", "collect-coins-in-a-tree", "count-pairs-of-connectable-servers-in-a-weighted-tree-network", "find-minimum-diameter-after-merging-two-trees" ], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "n", "edges" ], "tests": { "total": 65, "kept": 61, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "edges.length == n - 1" ] }, { "line": 26, "end_line": 26, "violates": [ "edges.length == n - 1" ] }, { "line": 49, "end_line": 49, "violates": [ "edges.length == n - 1" ] }, { "line": 65, "end_line": 65, "violates": [ "edges.length == n - 1" ] } ], "unchecked_constraints": [ "All the pairs (ai, bi) are distinct.", "The given input is guaranteed to be a tree and there will be no repeated edges." ], "public_tests": 2, "hints": [ "How many MHTs can a graph have at most?" ] }, { "question_id": 311, "task_id": "sparse-matrix-multiplication", "drop": [ "premium" ] }, { "question_id": 312, "task_id": "burst-balloons", "drop": [], "similar": [ "minimum-cost-to-merge-stones" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 96, "kept": 90, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 313, "task_id": "super-ugly-number", "drop": [], "similar": [ "ugly-number-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "primes" ], "tests": { "total": 95, "kept": 94, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= primes.length <= 100" ] } ], "unchecked_constraints": [ "primes[i] is guaranteed to be a prime number.", "All the values of primes are unique and sorted in ascending order." ], "public_tests": 2, "hints": [] }, { "question_id": 314, "task_id": "binary-tree-vertical-order-traversal", "drop": [ "premium" ] }, { "question_id": 315, "task_id": "count-of-smaller-numbers-after-self", "drop": [], "similar": [ "count-of-range-sum", "queue-reconstruction-by-height", "reverse-pairs", "how-many-numbers-are-smaller-than-the-current-number", "count-good-triplets-in-an-array", "count-the-number-of-k-big-indices" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 135, "kept": 135, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 316, "task_id": "remove-duplicate-letters", "drop": [], "similar": [ "smallest-k-length-subsequence-with-occurrences-of-a-letter", "lexicographically-smallest-string-after-deleting-duplicate-characters" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Greedily try to add one missing character. How to check if adding some character will not cause problems ? Use bit-masks to check whether you will be able to complete the sub-sequence if you add the character at some index i." ] }, { "question_id": 317, "task_id": "shortest-distance-from-all-buildings", "drop": [ "premium" ] }, { "question_id": 318, "task_id": "maximum-product-of-word-lengths", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 67, "kept": 67, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 319, "task_id": "bulb-switcher", "drop": [], "similar": [ "bulb-switcher-ii", "minimum-number-of-k-consecutive-bit-flips", "number-of-times-binary-string-is-prefix-aligned", "find-the-pivot-integer" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 85, "kept": 85, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 320, "task_id": "generalized-abbreviation", "drop": [ "premium" ] }, { "question_id": 321, "task_id": "create-maximum-number", "drop": [], "similar": [ "remove-k-digits", "maximum-swap" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "k" ], "tests": { "total": 120, "kept": 116, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 63, "end_line": 63, "violates": [ "0 <= nums1[i], nums2[i] <= 9" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= nums1[i], nums2[i] <= 9" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= nums1[i], nums2[i] <= 9" ] }, { "line": 98, "end_line": 98, "violates": [ "0 <= nums1[i], nums2[i] <= 9" ] } ], "unchecked_constraints": [ "nums1 and nums2 do not have leading zeros." ], "public_tests": 3, "hints": [] }, { "question_id": 322, "task_id": "coin-change", "drop": [], "similar": [ "minimum-cost-for-tickets", "maximum-value-of-k-coins-from-piles", "minimum-number-of-operations-to-convert-time", "minimum-cost-to-split-an-array", "count-of-sub-multisets-with-bounded-sum", "length-of-the-longest-subsequence-that-sums-to-target", "minimum-number-of-coins-to-be-added", "most-expensive-item-that-can-not-be-bought", "inverse-coin-change", "minimum-days-to-score-exactly-n-points" ], "flags": [], "comparison": "exact", "parameter_names": [ "coins", "amount" ], "tests": { "total": 127, "kept": 118, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "0 <= amount <= 10**(4)" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= amount <= 10**(4)" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= amount <= 10**(4)" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= amount <= 10**(4)" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= amount <= 10**(4)" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= amount <= 10**(4)" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= amount <= 10**(4)" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= amount <= 10**(4)" ] }, { "line": 107, "end_line": 107, "violates": [ "0 <= amount <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 323, "task_id": "number-of-connected-components-in-an-undirected-graph", "drop": [ "premium" ] }, { "question_id": 324, "task_id": "wiggle-sort-ii", "drop": [ "in_place", "interface" ], "similar": [ "sort-colors", "kth-largest-element-in-an-array", "wiggle-sort", "array-with-elements-not-equal-to-average-of-neighbors" ], "interface_problems": [ "rust: unparsed signature" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 113, "kept": 109, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 44, "end_line": 44, "violates": [ "0 <= nums[i] <= 5000" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= nums[i] <= 5000" ] }, { "line": 107, "end_line": 107, "violates": [ "0 <= nums[i] <= 5000" ] }, { "line": 112, "end_line": 112, "violates": [ "0 <= nums[i] <= 5000" ] } ], "unchecked_constraints": [ "It is guaranteed that there will be an answer for the given input nums." ] }, { "question_id": 325, "task_id": "maximum-size-subarray-sum-equals-k", "drop": [ "premium" ] }, { "question_id": 326, "task_id": "power-of-three", "drop": [], "similar": [ "power-of-two", "power-of-four", "check-if-number-is-a-sum-of-powers-of-three" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 76, "kept": 69, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 30, "end_line": 30, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 31, "end_line": 31, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 40, "end_line": 40, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 51, "end_line": 51, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 54, "end_line": 54, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 73, "end_line": 73, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 327, "task_id": "count-of-range-sum", "drop": [], "similar": [ "count-of-smaller-numbers-after-self", "reverse-pairs", "count-the-number-of-fair-pairs", "find-the-number-of-copy-arrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "lower", "upper" ], "tests": { "total": 101, "kept": 86, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 16, "end_line": 16, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 29, "end_line": 29, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 45, "end_line": 45, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 49, "end_line": 49, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 52, "end_line": 52, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 63, "end_line": 63, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 69, "end_line": 69, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 78, "end_line": 78, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 84, "end_line": 84, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 85, "end_line": 85, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 90, "end_line": 90, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 92, "end_line": 92, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 93, "end_line": 93, "violates": [ "-2**(31) <= nums[i] <= 2**(31) - 1", "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 99, "end_line": 99, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] } ], "unchecked_constraints": [ "The answer is guaranteed to fit in a 32-bit integer." ], "public_tests": 2, "hints": [], "similar_to_test": [ "3468 find-the-number-of-copy-arrays" ] }, { "question_id": 328, "task_id": "odd-even-linked-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "split-linked-list-in-parts", "transform-array-by-parity" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 1, "kept": 0, "dropped": { "unreadable": 1 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the linked list is in the range [0, 10**(4)].", "-10**(6) <= Node.val <= 10**(6)" ], "similar_to_test": [ "3467 transform-array-by-parity" ] }, { "question_id": 329, "task_id": "longest-increasing-path-in-a-matrix", "drop": [], "similar": [ "number-of-increasing-paths-in-a-grid" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 88, "kept": 88, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 330, "task_id": "patching-array", "drop": [], "similar": [ "maximum-number-of-consecutive-values-you-can-make" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "n" ], "tests": { "total": 105, "kept": 95, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= nums.length <= 1000" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= nums.length <= 1000" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 331, "task_id": "verify-preorder-serialization-of-a-binary-tree", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "preorder" ], "tests": { "total": 145, "kept": 145, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 332, "task_id": "reconstruct-itinerary", "drop": [], "similar": [ "longest-common-subpath", "valid-arrangement-of-pairs" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "tickets" ], "tests": { "total": 69, "kept": 63, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "fromi.length == 3", "toi.length == 3" ] }, { "line": 25, "end_line": 25, "violates": [ "fromi.length == 3", "toi.length == 3" ] }, { "line": 58, "end_line": 58, "violates": [ "fromi.length == 3", "toi.length == 3" ] }, { "line": 61, "end_line": 61, "violates": [ "fromi.length == 3", "toi.length == 3" ] }, { "line": 65, "end_line": 65, "violates": [ "fromi.length == 3", "toi.length == 3" ] }, { "line": 68, "end_line": 68, "violates": [ "fromi.length == 3", "toi.length == 3" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 333, "task_id": "largest-bst-subtree", "drop": [ "premium" ] }, { "question_id": 334, "task_id": "increasing-triplet-subsequence", "drop": [], "similar": [ "longest-increasing-subsequence", "count-special-quadruplets", "count-good-triplets-in-an-array", "count-increasing-quadruplets" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 124, "kept": 124, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 335, "task_id": "self-crossing", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "distance" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 336, "task_id": "palindrome-pairs", "drop": [], "similar": [ "longest-palindromic-substring", "shortest-palindrome", "longest-palindrome-by-concatenating-two-letter-words", "find-maximum-number-of-string-pairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 91, "kept": 88, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "words[i] consists of lowercase English letters." ] }, { "line": 74, "end_line": 74, "violates": [ "words[i] consists of lowercase English letters." ] }, { "line": 92, "end_line": 92, "violates": [ "words[i] consists of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Checking every two pairs will exceed the time limit. It will be O(n^2 * k). We need a faster way.", "If we hash every string in the array, how can we check if two pairs form a palindrome after the concatenation?", "We can check every string in words and consider it as words[j] (i.e., the suffix of the target palindrome). We can check if there is a hash of string that can be the prefix to make it a palindrome." ] }, { "question_id": 337, "task_id": "house-robber-iii", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "house-robber", "house-robber-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 91, "kept": 0, "dropped": { "unreadable": 91 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "0 <= Node.val <= 10**(4)" ] }, { "question_id": 338, "task_id": "counting-bits", "drop": [], "similar": [ "number-of-1-bits", "sum-of-values-at-indices-with-k-set-bits", "find-the-k-or-of-an-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 33, "kept": 33, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "You should make use of what you have produced already.", "Divide the numbers in ranges like [2-3], [4-7], [8-15] and so on. And try to generate new range from previous.", "Or does the odd/even status of the number help you in calculating the number of 1s?" ] }, { "question_id": 340, "task_id": "longest-substring-with-at-most-k-distinct-characters", "drop": [ "premium" ] }, { "question_id": 342, "task_id": "power-of-four", "drop": [], "similar": [ "power-of-two", "power-of-three" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 58, "kept": 41, "dropped": { "constraint_violation": 17 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 24, "end_line": 24, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 27, "end_line": 27, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 28, "end_line": 28, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 30, "end_line": 30, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 34, "end_line": 34, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 36, "end_line": 36, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 39, "end_line": 39, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 41, "end_line": 41, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 42, "end_line": 42, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 44, "end_line": 44, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 46, "end_line": 46, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 47, "end_line": 47, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 48, "end_line": 48, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 54, "end_line": 54, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 55, "end_line": 55, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] }, { "line": 59, "end_line": 59, "violates": [ "-2**(31) <= n <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 343, "task_id": "integer-break", "drop": [], "similar": [ "maximize-number-of-nice-divisors" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 30, "kept": 30, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "There is a simple O(n) solution to this problem.", "You may check the breaking results of n ranging from 7 to 10 to discover the regularities." ] }, { "question_id": 344, "task_id": "reverse-string", "drop": [ "in_place", "interface" ], "similar": [ "reverse-vowels-of-a-string", "reverse-string-ii" ], "interface_problems": [ "rust: unparsed signature" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 39, "kept": 39, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s[i] is a printable ascii character." ] }, { "question_id": 345, "task_id": "reverse-vowels-of-a-string", "drop": [ "too_few_tests" ], "similar": [ "reverse-string", "remove-vowels-from-a-string", "faulty-keyboard", "sort-vowels-in-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 2, "kept": 2, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s consist of printable ASCII characters." ] }, { "question_id": 347, "task_id": "top-k-frequent-elements", "drop": [], "similar": [ "word-frequency", "kth-largest-element-in-an-array", "sort-characters-by-frequency", "split-array-into-consecutive-subsequences", "top-k-frequent-words", "k-closest-points-to-origin", "sort-features-by-popularity", "sender-with-largest-word-count", "most-frequent-even-element", "linked-list-frequency" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums", "k" ], "tests": { "total": 34, "kept": 34, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "k is in the range [1, the number of unique elements in the array].", "It is guaranteed that the answer is unique." ], "public_tests": 3, "hints": [] }, { "question_id": 349, "task_id": "intersection-of-two-arrays", "drop": [], "similar": [ "intersection-of-two-arrays-ii", "intersection-of-three-sorted-arrays", "find-the-difference-of-two-arrays", "count-common-words-with-one-occurrence", "choose-numbers-from-two-arrays-in-range", "intersection-of-multiple-arrays", "minimum-common-value", "maximum-size-of-a-set-after-removals" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 124, "kept": 120, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 46, "end_line": 46, "violates": [ "0 <= nums1[i], nums2[i] <= 1000" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= nums1[i], nums2[i] <= 1000" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= nums1[i], nums2[i] <= 1000" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= nums1[i], nums2[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 350, "task_id": "intersection-of-two-arrays-ii", "drop": [], "similar": [ "intersection-of-two-arrays", "find-common-characters", "find-the-difference-of-two-arrays", "choose-numbers-from-two-arrays-in-range", "intersection-of-multiple-arrays", "minimum-common-value" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 137, "kept": 135, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= nums1.length, nums2.length <= 1000" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= nums1[i], nums2[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 351, "task_id": "android-unlock-patterns", "drop": [ "premium" ] }, { "question_id": 354, "task_id": "russian-doll-envelopes", "drop": [], "similar": [ "longest-increasing-subsequence", "the-number-of-weak-characters-in-the-game", "longest-non-decreasing-subarray-from-two-arrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "envelopes" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 356, "task_id": "line-reflection", "drop": [ "premium" ] }, { "question_id": 357, "task_id": "count-numbers-with-unique-digits", "drop": [ "too_few_tests" ], "similar": [ "count-special-integers", "count-numbers-with-unique-digits-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 11, "kept": 9, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "0 <= n <= 8" ] }, { "line": 12, "end_line": 12, "violates": [ "0 <= n <= 8" ] } ], "unchecked_constraints": [] }, { "question_id": 358, "task_id": "rearrange-string-k-distance-apart", "drop": [ "premium" ] }, { "question_id": 360, "task_id": "sort-transformed-array", "drop": [ "premium" ] }, { "question_id": 361, "task_id": "bomb-enemy", "drop": [ "premium" ] }, { "question_id": 363, "task_id": "max-sum-of-rectangle-no-larger-than-k", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix", "k" ], "tests": { "total": 205, "kept": 198, "dropped": { "constraint_violation": 6, "non_finite": 1 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "-100 <= matrix[i][j] <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "-100 <= matrix[i][j] <= 100" ] }, { "line": 89, "end_line": 89, "violates": [ "-100 <= matrix[i][j] <= 100" ] }, { "line": 114, "end_line": 114, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 145, "end_line": 145, "violates": [ "n == matrix[i].length" ] }, { "line": 168, "end_line": 168, "violates": [ "-100 <= matrix[i][j] <= 100" ] }, { "line": 189, "end_line": 189, "violates": [ "-100 <= matrix[i][j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 365, "task_id": "water-and-jug-problem", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "x", "y", "target" ], "tests": { "total": 192, "kept": 185, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= x, y, target <= 10**(3)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= x, y, target <= 10**(3)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= x, y, target <= 10**(3)" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= x, y, target <= 10**(3)" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= x, y, target <= 10**(3)" ] }, { "line": 156, "end_line": 156, "violates": [ "1 <= x, y, target <= 10**(3)" ] }, { "line": 161, "end_line": 161, "violates": [ "1 <= x, y, target <= 10**(3)" ] } ], "unchecked_constraints": [], "public_tests": 1, "hints": [] }, { "question_id": 366, "task_id": "find-leaves-of-binary-tree", "drop": [ "premium" ] }, { "question_id": 367, "task_id": "valid-perfect-square", "drop": [], "similar": [ "sqrtx", "sum-of-square-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 50, "kept": 38, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= num <= 2**(31) - 1" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= num <= 2**(31) - 1" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= num <= 2**(31) - 1" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= num <= 2**(31) - 1" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= num <= 2**(31) - 1" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= num <= 2**(31) - 1" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= num <= 2**(31) - 1" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= num <= 2**(31) - 1" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= num <= 2**(31) - 1" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= num <= 2**(31) - 1" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= num <= 2**(31) - 1" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= num <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 368, "task_id": "largest-divisible-subset", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 109, "kept": 103, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "All the integers in nums are unique." ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 2 * 10**(9)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 2 * 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 2 * 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 2 * 10**(9)" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 2 * 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 369, "task_id": "plus-one-linked-list", "drop": [ "premium" ] }, { "question_id": 370, "task_id": "range-addition", "drop": [ "premium" ] }, { "question_id": 371, "task_id": "sum-of-two-integers", "drop": [], "similar": [ "add-two-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "a", "b" ], "tests": { "total": 80, "kept": 76, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "-1000 <= a, b <= 1000" ] }, { "line": 28, "end_line": 28, "violates": [ "-1000 <= a, b <= 1000" ] }, { "line": 45, "end_line": 45, "violates": [ "-1000 <= a, b <= 1000" ] }, { "line": 80, "end_line": 80, "violates": [ "-1000 <= a, b <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 373, "task_id": "find-k-pairs-with-smallest-sums", "drop": [], "similar": [ "kth-smallest-element-in-a-sorted-matrix", "find-k-th-smallest-pair-distance", "kth-smallest-product-of-two-sorted-arrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "k" ], "tests": { "total": 102, "kept": 92, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "k <= nums1.length * nums2.length" ] }, { "line": 10, "end_line": 10, "violates": [ "k <= nums1.length * nums2.length" ] }, { "line": 24, "end_line": 24, "violates": [ "-10**(9) <= nums1[i], nums2[i] <= 10**(9)" ] }, { "line": 26, "end_line": 26, "violates": [ "-10**(9) <= nums1[i], nums2[i] <= 10**(9)" ] }, { "line": 31, "end_line": 31, "violates": [ "-10**(9) <= nums1[i], nums2[i] <= 10**(9)" ] }, { "line": 51, "end_line": 51, "violates": [ "k <= nums1.length * nums2.length" ] }, { "line": 58, "end_line": 58, "violates": [ "k <= nums1.length * nums2.length" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 88, "end_line": 88, "violates": [ "k <= nums1.length * nums2.length" ] }, { "line": 90, "end_line": 90, "violates": [ "-10**(9) <= nums1[i], nums2[i] <= 10**(9)" ] } ], "unchecked_constraints": [ "nums1 and nums2 both are sorted in non-decreasing order." ], "public_tests": 2, "hints": [] }, { "question_id": 375, "task_id": "guess-number-higher-or-lower-ii", "drop": [], "similar": [ "flip-game-ii", "guess-number-higher-or-lower", "can-i-win", "find-k-closest-elements" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 28, "kept": 28, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The best strategy to play the game is to minimize the maximum loss you could possibly face. Another strategy is to minimize the expected loss. Here, we are interested in the first scenario.", "Take a small example (n = 3). What do you end up paying in the worst case?", "Check out this article if you're still stuck.", "The purely recursive implementation of minimax would be worthless for even a small n. You MUST use dynamic programming.", "As a follow-up, how would you modify your code to solve the problem of minimizing the expected loss, instead of the worst-case loss?" ] }, { "question_id": 376, "task_id": "wiggle-subsequence", "drop": [], "similar": [ "rearrange-array-elements-by-sign" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 134, "kept": 133, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 53, "end_line": 53, "violates": [ "0 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 377, "task_id": "combination-sum-iv", "drop": [], "similar": [ "combination-sum", "ways-to-express-an-integer-as-sum-of-powers" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 116, "kept": 72, "dropped": { "int_overflow": 38, "constraint_violation": 6 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 13, "end_line": 13, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= target <= 1000" ] }, { "line": 18, "end_line": 18, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 20, "end_line": 20, "violates": [ "All the elements of nums are unique." ] }, { "line": 21, "end_line": 21, "violates": [ "All the elements of nums are unique." ] }, { "line": 22, "end_line": 22, "violates": [ "All the elements of nums are unique." ] }, { "line": 26, "end_line": 26, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 27, "end_line": 27, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 28, "end_line": 28, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 30, "end_line": 30, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 31, "end_line": 31, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= target <= 1000" ] }, { "line": 40, "end_line": 40, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 42, "end_line": 42, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 43, "end_line": 43, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 44, "end_line": 44, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "java" ] }, { "line": 46, "end_line": 46, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 48, "end_line": 48, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 49, "end_line": 49, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 54, "end_line": 54, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 56, "end_line": 56, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= target <= 1000" ] }, { "line": 62, "end_line": 62, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 64, "end_line": 64, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 65, "end_line": 65, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 66, "end_line": 66, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 67, "end_line": 67, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 69, "end_line": 69, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 76, "end_line": 76, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 78, "end_line": 78, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 82, "end_line": 82, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 83, "end_line": 83, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 87, "end_line": 87, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 89, "end_line": 89, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 92, "end_line": 92, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 94, "end_line": 94, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 102, "end_line": 102, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 107, "end_line": 107, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 108, "end_line": 108, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 110, "end_line": 110, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 111, "end_line": 111, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 112, "end_line": 112, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 113, "end_line": 113, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "java" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 378, "task_id": "kth-smallest-element-in-a-sorted-matrix", "drop": [], "similar": [ "find-k-pairs-with-smallest-sums", "kth-smallest-number-in-multiplication-table", "find-k-th-smallest-pair-distance", "k-th-smallest-prime-fraction" ], "flags": [], "comparison": "exact", "parameter_names": [ "matrix", "k" ], "tests": { "total": 88, "kept": 86, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 74, "end_line": 74, "violates": [ "n == matrix.length == matrix[i].length", "1 <= k <= n**(2)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= k <= n**(2)" ] } ], "unchecked_constraints": [ "All the rows and columns of matrix are guaranteed to be sorted in non-decreasing order." ], "public_tests": 2, "hints": [] }, { "question_id": 383, "task_id": "ransom-note", "drop": [], "similar": [ "stickers-to-spell-word", "find-words-that-can-be-formed-by-characters" ], "flags": [], "comparison": "exact", "parameter_names": [ "ransomNote", "magazine" ], "tests": { "total": 141, "kept": 136, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= ransomNote.length, magazine.length <= 10**(5)" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= ransomNote.length, magazine.length <= 10**(5)" ] }, { "line": 16, "end_line": 16, "violates": [ "ransomNote and magazine consist of lowercase English letters." ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= ransomNote.length, magazine.length <= 10**(5)" ] }, { "line": 126, "end_line": 126, "violates": [ "ransomNote and magazine consist of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 386, "task_id": "lexicographical-numbers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 37, "kept": 37, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 387, "task_id": "first-unique-character-in-a-string", "drop": [], "similar": [ "sort-characters-by-frequency", "first-letter-to-appear-twice" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 91, "kept": 90, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= s.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 388, "task_id": "longest-absolute-file-path", "drop": [ "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "input" ], "tests": { "total": 4, "kept": 4, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "input may contain lowercase or uppercase English letters, a new line character '\\n', a tab character '\\t', a dot '.', a space ' ', and digits.", "All file and directory names have positive length." ] }, { "question_id": 389, "task_id": "find-the-difference", "drop": [], "similar": [ "single-number", "permutation-difference-between-two-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 96, "kept": 85, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "t.length == s.length + 1" ] }, { "line": 13, "end_line": 13, "violates": [ "t.length == s.length + 1" ] }, { "line": 20, "end_line": 20, "violates": [ "t.length == s.length + 1" ] }, { "line": 46, "end_line": 46, "violates": [ "t.length == s.length + 1" ] }, { "line": 50, "end_line": 50, "violates": [ "t.length == s.length + 1" ] }, { "line": 54, "end_line": 54, "violates": [ "t.length == s.length + 1" ] }, { "line": 61, "end_line": 61, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 62, "end_line": 62, "violates": [ "t.length == s.length + 1" ] }, { "line": 65, "end_line": 65, "violates": [ "t.length == s.length + 1" ] }, { "line": 67, "end_line": 67, "violates": [ "t.length == s.length + 1" ] }, { "line": 80, "end_line": 80, "violates": [ "t.length == s.length + 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 390, "task_id": "elimination-game", "drop": [], "similar": [ "min-max-game" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 78, "kept": 77, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 63, "end_line": 63, "violates": [ "1 <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 391, "task_id": "perfect-rectangle", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "rectangles" ], "tests": { "total": 98, "kept": 89, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "-10**(5) <= xi < ai <= 10**(5)", "-10**(5) <= yi < bi <= 10**(5)" ] }, { "line": 36, "end_line": 36, "violates": [ "-10**(5) <= xi < ai <= 10**(5)", "-10**(5) <= yi < bi <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "-10**(5) <= yi < bi <= 10**(5)" ] }, { "line": 57, "end_line": 57, "violates": [ "-10**(5) <= xi < ai <= 10**(5)", "-10**(5) <= yi < bi <= 10**(5)" ] }, { "line": 63, "end_line": 63, "violates": [ "-10**(5) <= xi < ai <= 10**(5)" ] }, { "line": 74, "end_line": 74, "violates": [ "-10**(5) <= xi < ai <= 10**(5)", "-10**(5) <= yi < bi <= 10**(5)" ] }, { "line": 79, "end_line": 79, "violates": [ "-10**(5) <= xi < ai <= 10**(5)", "-10**(5) <= yi < bi <= 10**(5)" ] }, { "line": 89, "end_line": 89, "violates": [ "-10**(5) <= xi < ai <= 10**(5)", "-10**(5) <= yi < bi <= 10**(5)" ] }, { "line": 98, "end_line": 98, "violates": [ "-10**(5) <= xi < ai <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 392, "task_id": "is-subsequence", "drop": [], "similar": [ "number-of-matching-subsequences", "shortest-way-to-form-string", "append-characters-to-string-to-make-subsequence", "make-string-a-subsequence-using-cyclic-increments" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 69, "kept": 68, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "s and t consist only of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 393, "task_id": "utf-8-validation", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "data" ], "tests": { "total": 135, "kept": 134, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 112, "end_line": 112, "violates": [ "0 <= data[i] <= 255" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Read the data integer by integer. When you read it, process the least significant 8 bits of it.", "Assume the next encoding is 1-byte data. If it is not 1-byte data, read the next integer and assume it is 2-bytes data.", "Similarly, if it is not 2-bytes data, try 3-bytes then 4-bytes. If you read four integers and it still does not match any pattern, return false." ] }, { "question_id": 394, "task_id": "decode-string", "drop": [], "similar": [ "encode-string-with-shortest-length", "number-of-atoms", "brace-expansion" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 133, "kept": 128, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 44, "end_line": 44, "violates": [ "1 <= s.length <= 30" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= s.length <= 30" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= s.length <= 30" ] }, { "line": 125, "end_line": 125, "violates": [ "1 <= s.length <= 30" ] }, { "line": 130, "end_line": 130, "violates": [ "1 <= s.length <= 30" ] } ], "unchecked_constraints": [ "s is guaranteed to be a valid input.", "All the integers in s are in the range [1, 300]." ], "public_tests": 3, "hints": [] }, { "question_id": 395, "task_id": "longest-substring-with-at-least-k-repeating-characters", "drop": [], "similar": [ "longest-subsequence-repeated-k-times", "number-of-equal-count-substrings", "optimal-partition-of-string", "length-of-longest-subarray-with-at-most-k-frequency", "find-longest-special-substring-that-occurs-thrice-ii", "find-longest-special-substring-that-occurs-thrice-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 109, "kept": 108, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= s.length <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 396, "task_id": "rotate-function", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 89, "kept": 80, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 34, "end_line": 34, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 46, "end_line": 46, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 56, "end_line": 56, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 69, "end_line": 69, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 78, "end_line": 78, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 83, "end_line": 83, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 87, "end_line": 87, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 88, "end_line": 88, "violates": [ "-100 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 397, "task_id": "integer-replacement", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 37, "kept": 37, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 399, "task_id": "evaluate-division", "drop": [], "similar": [ "check-for-contradictions-in-equations", "maximize-amount-after-two-days-of-conversions" ], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "equations", "values", "queries" ], "tests": { "total": 57, "kept": 51, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= Ai.length, Bi.length <= 5" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= Ai.length, Bi.length <= 5" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= Ai.length, Bi.length <= 5" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= Ai.length, Bi.length <= 5" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= Ai.length, Bi.length <= 5" ] }, { "line": 45, "end_line": 45, "violates": [ "0.0 < values[i] <= 20.0" ] } ], "unchecked_constraints": [ "1 <= Cj.length, Dj.length <= 5", "Ai, Bi, Cj, Dj consist of lower case English letters and digits." ], "public_tests": 3, "hints": [ "Do you recognize this as a graph problem?" ], "similar_to_test": [ "3387 maximize-amount-after-two-days-of-conversions" ] }, { "question_id": 400, "task_id": "nth-digit", "drop": [], "similar": [ "k-th-digit-in-infinite-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 50, "kept": 50, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 401, "task_id": "binary-watch", "drop": [], "similar": [ "letter-combinations-of-a-phone-number", "number-of-1-bits" ], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "turnedOn" ], "tests": { "total": 12, "kept": 11, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "0 <= turnedOn <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simplify by seeking for solutions that involve comparing set bit counts.", "Consider precomputing all possible times for comparison." ] }, { "question_id": 402, "task_id": "remove-k-digits", "drop": [], "similar": [ "create-maximum-number", "monotone-increasing-digits", "find-the-most-competitive-subsequence", "append-k-integers-with-minimal-sum", "remove-digit-from-number-to-maximize-result", "minimum-operations-to-make-a-special-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "num", "k" ], "tests": { "total": 111, "kept": 109, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 69, "end_line": 69, "violates": [ "1 <= k <= num.length <= 10**(5)" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= k <= num.length <= 10**(5)" ] } ], "unchecked_constraints": [ "num does not have any leading zeros except for the zero itself." ], "public_tests": 3, "hints": [] }, { "question_id": 403, "task_id": "frog-jump", "drop": [], "similar": [ "minimum-sideway-jumps", "solving-questions-with-brainpower", "maximum-number-of-jumps-to-reach-the-last-index" ], "flags": [], "comparison": "exact", "parameter_names": [ "stones" ], "tests": { "total": 82, "kept": 82, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "stones is sorted in a strictly increasing order." ], "public_tests": 2, "hints": [] }, { "question_id": 404, "task_id": "sum-of-left-leaves", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 94, "kept": 0, "dropped": { "unreadable": 94 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 1000].", "-1000 <= Node.val <= 1000" ] }, { "question_id": 405, "task_id": "convert-a-number-to-hexadecimal", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 60, "kept": 52, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "-2**(31) <= num <= 2**(31) - 1" ] }, { "line": 8, "end_line": 8, "violates": [ "-2**(31) <= num <= 2**(31) - 1" ] }, { "line": 24, "end_line": 24, "violates": [ "-2**(31) <= num <= 2**(31) - 1" ] }, { "line": 26, "end_line": 26, "violates": [ "-2**(31) <= num <= 2**(31) - 1" ] }, { "line": 30, "end_line": 30, "violates": [ "-2**(31) <= num <= 2**(31) - 1" ] }, { "line": 43, "end_line": 43, "violates": [ "-2**(31) <= num <= 2**(31) - 1" ] }, { "line": 50, "end_line": 50, "violates": [ "-2**(31) <= num <= 2**(31) - 1" ] }, { "line": 59, "end_line": 59, "violates": [ "-2**(31) <= num <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 406, "task_id": "queue-reconstruction-by-height", "drop": [], "similar": [ "count-of-smaller-numbers-after-self", "reward-top-k-students" ], "flags": [], "comparison": "exact", "parameter_names": [ "people" ], "tests": { "total": 101, "kept": 100, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "0 <= ki < people.length" ] } ], "unchecked_constraints": [ "It is guaranteed that the queue can be reconstructed." ], "public_tests": 2, "hints": [ "What can you say about the position of the shortest person? If the position of the shortest person is i, how many people would be in front of the shortest person?", "Once you fix the position of the shortest person, what can you say about the position of the second shortest person?" ] }, { "question_id": 407, "task_id": "trapping-rain-water-ii", "drop": [], "similar": [ "trapping-rain-water", "maximum-number-of-points-from-grid-queries" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "heightMap" ], "tests": { "total": 78, "kept": 78, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 408, "task_id": "valid-word-abbreviation", "drop": [ "premium" ] }, { "question_id": 409, "task_id": "longest-palindrome", "drop": [], "similar": [ "palindrome-permutation", "longest-palindrome-by-concatenating-two-letter-words", "largest-palindromic-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 68, "kept": 67, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= s.length <= 2000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 410, "task_id": "split-array-largest-sum", "drop": [], "similar": [ "capacity-to-ship-packages-within-d-days", "divide-chocolate", "fair-distribution-of-cookies", "subsequence-of-size-k-with-the-largest-even-sum", "maximum-total-beauty-of-the-gardens", "number-of-ways-to-split-array", "minimum-cost-to-split-an-array", "distribute-elements-into-two-arrays-i", "distribute-elements-into-two-arrays-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 83, "kept": 82, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 79, "end_line": 79, "violates": [ "1 <= k <= min(50, nums.length)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 411, "task_id": "minimum-unique-word-abbreviation", "drop": [ "premium" ] }, { "question_id": 412, "task_id": "fizz-buzz", "drop": [], "similar": [ "fizz-buzz-multithreaded", "categorize-box-according-to-criteria" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 44, "kept": 44, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 413, "task_id": "arithmetic-slices", "drop": [], "similar": [ "arithmetic-slices-ii-subsequence", "arithmetic-subarrays", "number-of-zero-filled-subarrays", "length-of-the-longest-alphabetical-continuous-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 171, "kept": 170, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 78, "end_line": 78, "violates": [ "-1000 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 414, "task_id": "third-maximum-number", "drop": [], "similar": [ "kth-largest-element-in-an-array", "neither-minimum-nor-maximum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 127, "kept": 127, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 415, "task_id": "add-strings", "drop": [], "similar": [ "add-two-numbers", "multiply-strings", "add-to-array-form-of-integer" ], "flags": [], "comparison": "exact", "parameter_names": [ "num1", "num2" ], "tests": { "total": 92, "kept": 92, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "num1 and num2 don't have any leading zeros except for the zero itself." ], "public_tests": 3, "hints": [] }, { "question_id": 416, "task_id": "partition-equal-subset-sum", "drop": [], "similar": [ "partition-to-k-equal-sum-subsets", "minimize-the-difference-between-target-and-chosen-elements", "maximum-number-of-ways-to-partition-an-array", "partition-array-into-two-arrays-to-minimize-sum-difference", "find-subarrays-with-equal-sum", "number-of-great-partitions", "split-with-minimum-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 86, "kept": 66, "dropped": { "constraint_violation": 20 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= nums[i] <= 100", "1 <= nums[i] <= 100" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= nums[i] <= 100", "1 <= nums[i] <= 100" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 100", "1 <= nums[i] <= 100" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 100", "1 <= nums[i] <= 100" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 100", "1 <= nums[i] <= 100" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 100", "1 <= nums[i] <= 100" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 417, "task_id": "pacific-atlantic-water-flow", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "heights" ], "tests": { "total": 62, "kept": 62, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 418, "task_id": "sentence-screen-fitting", "drop": [ "premium" ] }, { "question_id": 419, "task_id": "battleships-in-a-board", "drop": [], "similar": [ "number-of-islands", "walls-and-gates", "max-area-of-island", "rotting-oranges" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board" ], "tests": { "total": 101, "kept": 101, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 420, "task_id": "strong-password-checker", "drop": [], "similar": [ "strong-password-checker-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "password" ], "tests": { "total": 174, "kept": 137, "dropped": { "constraint_violation": 37 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 13, "end_line": 13, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 30, "end_line": 30, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 37, "end_line": 37, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 48, "end_line": 48, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 55, "end_line": 55, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 56, "end_line": 56, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 69, "end_line": 69, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= password.length <= 50" ] }, { "line": 72, "end_line": 72, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= password.length <= 50" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= password.length <= 50" ] }, { "line": 86, "end_line": 86, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= password.length <= 50" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= password.length <= 50" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= password.length <= 50" ] }, { "line": 100, "end_line": 100, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= password.length <= 50" ] }, { "line": 111, "end_line": 111, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 116, "end_line": 116, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 119, "end_line": 119, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= password.length <= 50" ] }, { "line": 127, "end_line": 127, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 130, "end_line": 130, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 131, "end_line": 131, "violates": [ "1 <= password.length <= 50", "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 135, "end_line": 135, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 148, "end_line": 148, "violates": [ "1 <= password.length <= 50" ] }, { "line": 150, "end_line": 150, "violates": [ "1 <= password.length <= 50" ] }, { "line": 153, "end_line": 153, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 155, "end_line": 155, "violates": [ "1 <= password.length <= 50" ] }, { "line": 156, "end_line": 156, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 160, "end_line": 160, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 162, "end_line": 162, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 163, "end_line": 163, "violates": [ "1 <= password.length <= 50", "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 164, "end_line": 164, "violates": [ "password consists of letters, digits, dot '.' or exclamation mark '!'." ] }, { "line": 168, "end_line": 168, "violates": [ "1 <= password.length <= 50" ] }, { "line": 173, "end_line": 173, "violates": [ "1 <= password.length <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 421, "task_id": "maximum-xor-of-two-numbers-in-an-array", "drop": [], "similar": [ "maximum-xor-with-an-element-from-array", "maximum-xor-after-operations", "sum-of-prefix-scores-of-strings", "minimize-xor", "maximum-strong-pair-xor-i", "maximum-strong-pair-xor-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 102, "kept": 96, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "0 <= nums[i] <= 2**(31) - 1" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= nums[i] <= 2**(31) - 1" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= nums[i] <= 2**(31) - 1" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= nums[i] <= 2**(31) - 1" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= nums[i] <= 2**(31) - 1" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= nums[i] <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 422, "task_id": "valid-word-square", "drop": [ "premium" ] }, { "question_id": 423, "task_id": "reconstruct-original-digits-from-english", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 185, "kept": 185, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s[i] is one of the characters [\"e\",\"g\",\"f\",\"i\",\"h\",\"o\",\"n\",\"s\",\"r\",\"u\",\"t\",\"w\",\"v\",\"x\",\"z\"].", "s is guaranteed to be valid." ], "public_tests": 2, "hints": [] }, { "question_id": 424, "task_id": "longest-repeating-character-replacement", "drop": [], "similar": [ "longest-substring-with-at-most-k-distinct-characters", "max-consecutive-ones-iii", "minimum-number-of-operations-to-make-array-continuous", "maximize-the-confusion-of-an-exam", "longest-substring-of-one-repeating-character" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 105, "kept": 100, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= s.length <= 10**(5)" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= k <= s.length" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= k <= s.length" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= k <= s.length" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= k <= s.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 425, "task_id": "word-squares", "drop": [ "premium" ] }, { "question_id": 433, "task_id": "minimum-genetic-mutation", "drop": [], "similar": [ "word-ladder" ], "flags": [], "comparison": "exact", "parameter_names": [ "startGene", "endGene", "bank" ], "tests": { "total": 81, "kept": 58, "dropped": { "constraint_violation": 23 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 13, "end_line": 13, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 14, "end_line": 14, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 55, "end_line": 55, "violates": [ "0 <= bank.length <= 10", "startGene, endGene, and bank[i] consist of only the characters ['A', 'C', 'G', 'T']." ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= bank.length <= 10" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= bank.length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 434, "task_id": "number-of-segments-in-a-string", "drop": [ "too_few_tests" ], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 2, "kept": 2, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The only space character in s is ' '.", "s consists of lowercase and uppercase English letters, digits, or one of the following characters \"!@#$%^&*()_+-=',.:\"." ] }, { "question_id": 435, "task_id": "non-overlapping-intervals", "drop": [], "similar": [ "minimum-number-of-arrows-to-burst-balloons", "determine-if-two-events-have-conflict" ], "flags": [], "comparison": "exact", "parameter_names": [ "intervals" ], "tests": { "total": 107, "kept": 102, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 34, "end_line": 34, "violates": [ "-5 * 10**(4) <= starti < endi <= 5 * 10**(4)" ] }, { "line": 43, "end_line": 43, "violates": [ "-5 * 10**(4) <= starti < endi <= 5 * 10**(4)" ] }, { "line": 46, "end_line": 46, "violates": [ "-5 * 10**(4) <= starti < endi <= 5 * 10**(4)" ] }, { "line": 55, "end_line": 55, "violates": [ "-5 * 10**(4) <= starti < endi <= 5 * 10**(4)" ] }, { "line": 73, "end_line": 73, "violates": [ "-5 * 10**(4) <= starti < endi <= 5 * 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 436, "task_id": "find-right-interval", "drop": [], "similar": [ "data-stream-as-disjoint-intervals" ], "flags": [], "comparison": "exact", "parameter_names": [ "intervals" ], "tests": { "total": 113, "kept": 105, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "-10**(6) <= starti <= endi <= 10**(6)" ] }, { "line": 35, "end_line": 35, "violates": [ "-10**(6) <= starti <= endi <= 10**(6)" ] }, { "line": 40, "end_line": 40, "violates": [ "-10**(6) <= starti <= endi <= 10**(6)" ] }, { "line": 59, "end_line": 59, "violates": [ "-10**(6) <= starti <= endi <= 10**(6)" ] }, { "line": 61, "end_line": 61, "violates": [ "-10**(6) <= starti <= endi <= 10**(6)" ] }, { "line": 87, "end_line": 87, "violates": [ "-10**(6) <= starti <= endi <= 10**(6)" ] }, { "line": 101, "end_line": 101, "violates": [ "-10**(6) <= starti <= endi <= 10**(6)" ] }, { "line": 103, "end_line": 103, "violates": [ "-10**(6) <= starti <= endi <= 10**(6)" ] } ], "unchecked_constraints": [ "The start point of each interval is unique." ], "public_tests": 3, "hints": [] }, { "question_id": 437, "task_id": "path-sum-iii", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "path-sum", "path-sum-ii", "path-sum-iv", "longest-univalue-path" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "targetSum" ], "tests": { "total": 68, "kept": 0, "dropped": { "unreadable": 68 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 1000].", "-10**(9) <= Node.val <= 10**(9)" ] }, { "question_id": 438, "task_id": "find-all-anagrams-in-a-string", "drop": [], "similar": [ "valid-anagram", "permutation-in-string" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "s", "p" ], "tests": { "total": 102, "kept": 102, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 439, "task_id": "ternary-expression-parser", "drop": [ "premium" ] }, { "question_id": 440, "task_id": "k-th-smallest-in-lexicographical-order", "drop": [], "similar": [ "count-special-integers" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 94, "kept": 91, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 48, "end_line": 48, "violates": [ "1 <= k <= n <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= k <= n <= 10**(9)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= k <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 441, "task_id": "arranging-coins", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 54, "kept": 54, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 442, "task_id": "find-all-duplicates-in-an-array", "drop": [], "similar": [ "find-all-numbers-disappeared-in-an-array", "sum-of-distances", "the-two-sneaky-numbers-of-digitville" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 61, "kept": 61, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Each element in nums appears once or twice." ], "public_tests": 3, "hints": [], "similar_to_test": [ "3289 the-two-sneaky-numbers-of-digitville" ] }, { "question_id": 443, "task_id": "string-compression", "drop": [ "in_place" ], "similar": [ "count-and-say", "encode-and-decode-strings", "design-compressed-string-iterator", "decompress-run-length-encoded-list", "string-compression-iii", "better-compression-of-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "chars" ], "tests": { "total": 25, "kept": 25, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "chars[i] is a lowercase English letter, uppercase English letter, digit, or symbol." ] }, { "question_id": 444, "task_id": "sequence-reconstruction", "drop": [ "premium" ] }, { "question_id": 445, "task_id": "add-two-numbers-ii", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "add-two-numbers", "add-two-polynomials-represented-as-linked-lists" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "l1", "l2" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in each linked list is in the range [1, 100].", "0 <= Node.val <= 9", "It is guaranteed that the list represents a number that does not have leading zeros." ] }, { "question_id": 446, "task_id": "arithmetic-slices-ii-subsequence", "drop": [], "similar": [ "arithmetic-slices", "destroy-sequential-targets", "count-palindromic-subsequences" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 164, "kept": 163, "dropped": { "int_overflow": 1 } }, "dropped_tests": [ { "line": 61, "end_line": 61, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "java" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 447, "task_id": "number-of-boomerangs", "drop": [], "similar": [ "line-reflection" ], "flags": [], "comparison": "exact", "parameter_names": [ "points" ], "tests": { "total": 105, "kept": 102, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "All the points are unique." ] }, { "line": 26, "end_line": 26, "violates": [ "All the points are unique." ] }, { "line": 46, "end_line": 46, "violates": [ "-10**(4) <= xi, yi <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 448, "task_id": "find-all-numbers-disappeared-in-an-array", "drop": [], "similar": [ "first-missing-positive", "find-all-duplicates-in-an-array", "find-unique-binary-string", "append-k-integers-with-minimal-sum", "replace-elements-in-an-array", "maximum-number-of-integers-to-choose-from-a-range-i", "maximum-number-of-integers-to-choose-from-a-range-ii", "find-all-numbers-disappeared-in-an-array-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 68, "kept": 55, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= n" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= n" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "This is a really easy problem if you decide to use additional memory. For those trying to write an initial solution using additional memory, think counters!", "However, the trick really is to not use any additional space than what is already available to use. Sometimes, multiple passes over the input array help find the solution. However, there's an interesting piece of information in this problem that makes it easy to re-use the input array itself for the solution.", "The problem specifies that the numbers in the array will be in the range [1, n] where n is the number of elements in the array. Can we use this information and modify the array in-place somehow to find what we need?" ] }, { "question_id": 450, "task_id": "delete-node-in-a-bst", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "split-bst" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "root", "key" ], "tests": { "total": 2, "kept": 0, "dropped": { "unreadable": 2 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 10**(4)].", "-10**(5) <= Node.val <= 10**(5)", "Each node has a unique value.", "root is a valid binary search tree." ] }, { "question_id": 451, "task_id": "sort-characters-by-frequency", "drop": [], "similar": [ "top-k-frequent-elements", "first-unique-character-in-a-string", "sort-array-by-increasing-frequency", "percentage-of-letter-in-string", "maximum-number-of-pairs-in-array", "node-with-highest-edge-score", "most-frequent-even-element", "count-pairs-of-similar-strings" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 54, "kept": 49, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= s.length <= 5 * 10**(5)" ] }, { "line": 28, "end_line": 28, "violates": [ "s consists of uppercase and lowercase English letters and digits." ] }, { "line": 37, "end_line": 37, "violates": [ "s consists of uppercase and lowercase English letters and digits." ] }, { "line": 38, "end_line": 38, "violates": [ "s consists of uppercase and lowercase English letters and digits." ] }, { "line": 40, "end_line": 40, "violates": [ "s consists of uppercase and lowercase English letters and digits." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 452, "task_id": "minimum-number-of-arrows-to-burst-balloons", "drop": [], "similar": [ "meeting-rooms-ii", "non-overlapping-intervals" ], "flags": [], "comparison": "exact", "parameter_names": [ "points" ], "tests": { "total": 110, "kept": 89, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 10, "end_line": 10, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 12, "end_line": 12, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 14, "end_line": 14, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 15, "end_line": 15, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 16, "end_line": 16, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 18, "end_line": 18, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 28, "end_line": 28, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 29, "end_line": 29, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 36, "end_line": 36, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 37, "end_line": 37, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 39, "end_line": 39, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 40, "end_line": 40, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 60, "end_line": 60, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 61, "end_line": 61, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 62, "end_line": 62, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 67, "end_line": 67, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 78, "end_line": 78, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 92, "end_line": 92, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 93, "end_line": 93, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] }, { "line": 99, "end_line": 99, "violates": [ "-2**(31) <= xstart < xend <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 453, "task_id": "minimum-moves-to-equal-array-elements", "drop": [], "similar": [ "minimum-moves-to-equal-array-elements-ii", "maximum-running-time-of-n-computers", "pour-water-between-buckets-to-make-water-levels-equal", "divide-players-into-teams-of-equal-skill", "find-minimum-operations-to-make-all-elements-divisible-by-three" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 77, "kept": 73, "dropped": { "int_overflow": 3, "constraint_violation": 1 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 52, "end_line": 52, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 73, "end_line": 73, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 78, "end_line": 78, "unrepresentable_in": [ "cpp", "rust", "java" ] } ], "unchecked_constraints": [ "The answer is guaranteed to fit in a 32-bit integer." ], "public_tests": 2, "hints": [] }, { "question_id": 454, "task_id": "4sum-ii", "drop": [], "similar": [ "4sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "nums3", "nums4" ], "tests": { "total": 97, "kept": 96, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "-2**(28) <= nums1[i], nums2[i], nums3[i], nums4[i] <= 2**(28)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 455, "task_id": "assign-cookies", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "g", "s" ], "tests": { "total": 129, "kept": 124, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= g.length <= 3 * 10**(4)", "1 <= g.length <= 3 * 10**(4)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= g.length <= 3 * 10**(4)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= g[i], s[j] <= 2**(31) - 1" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= g[i], s[j] <= 2**(31) - 1" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= g.length <= 3 * 10**(4)", "1 <= g.length <= 3 * 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 456, "task_id": "132-pattern", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 143, "kept": 143, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 457, "task_id": "circular-array-loop", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 116, "kept": 111, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "nums[i] != 0" ] }, { "line": 50, "end_line": 50, "violates": [ "nums[i] != 0" ] }, { "line": 96, "end_line": 96, "violates": [ "nums[i] != 0" ] }, { "line": 98, "end_line": 98, "violates": [ "nums[i] != 0" ] }, { "line": 116, "end_line": 116, "violates": [ "nums[i] != 0" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 458, "task_id": "poor-pigs", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "buckets", "minutesToDie", "minutesToTest" ], "tests": { "total": 99, "kept": 90, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= buckets <= 1000" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= buckets <= 1000" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= buckets <= 1000" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= minutesToDie <= minutesToTest <= 100" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= buckets <= 1000" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= buckets <= 1000" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= buckets <= 1000" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= buckets <= 1000" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= buckets <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What if you only have one shot? Eg. 4 buckets, 15 mins to die, and 15 mins to test.", "How many states can we generate with x pigs and T tests?", "Find minimum x such that (T+1)^x >= N" ] }, { "question_id": 459, "task_id": "repeated-substring-pattern", "drop": [], "similar": [ "find-the-index-of-the-first-occurrence-in-a-string", "repeated-string-match" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 87, "kept": 87, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 461, "task_id": "hamming-distance", "drop": [], "similar": [ "number-of-1-bits", "total-hamming-distance" ], "flags": [], "comparison": "exact", "parameter_names": [ "x", "y" ], "tests": { "total": 88, "kept": 83, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "0 <= x, y <= 2**(31) - 1" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= x, y <= 2**(31) - 1" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= x, y <= 2**(31) - 1" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= x, y <= 2**(31) - 1" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= x, y <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 462, "task_id": "minimum-moves-to-equal-array-elements-ii", "drop": [], "similar": [ "best-meeting-point", "minimum-moves-to-equal-array-elements", "minimum-operations-to-make-a-uni-value-grid", "removing-minimum-number-of-magic-beans", "minimum-cost-to-make-array-equal", "minimum-operations-to-make-all-array-elements-equal", "minimum-cost-to-make-array-equalindromic", "minimum-operations-to-make-subarray-elements-equal", "minimum-operations-to-make-elements-within-k-subarrays-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 79, "kept": 73, "dropped": { "int_overflow": 3, "constraint_violation": 3 } }, "dropped_tests": [ { "line": 46, "end_line": 46, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 48, "end_line": 48, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 49, "end_line": 49, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 53, "end_line": 53, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 69, "end_line": 69, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3422 minimum-operations-to-make-subarray-elements-equal", "3505 minimum-operations-to-make-elements-within-k-subarrays-equal" ] }, { "question_id": 463, "task_id": "island-perimeter", "drop": [], "similar": [ "max-area-of-island", "flood-fill", "coloring-a-border" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 72, "kept": 72, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "grid[i][j] is 0 or 1.", "There is exactly one island in grid." ], "public_tests": 3, "hints": [] }, { "question_id": 464, "task_id": "can-i-win", "drop": [], "similar": [ "flip-game-ii", "guess-number-higher-or-lower-ii", "predict-the-winner", "find-the-winning-player-in-coin-game", "find-the-number-of-winning-players" ], "flags": [], "comparison": "exact", "parameter_names": [ "maxChoosableInteger", "desiredTotal" ], "tests": { "total": 75, "kept": 75, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 465, "task_id": "optimal-account-balancing", "drop": [ "premium" ] }, { "question_id": 466, "task_id": "count-the-repetitions", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "n1", "s2", "n2" ], "tests": { "total": 108, "kept": 108, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 467, "task_id": "unique-substrings-in-wraparound-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 66, "kept": 66, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "One possible solution might be to consider allocating an array size of 26 for each character in the alphabet. (Credits to @r2ysxu)" ] }, { "question_id": 468, "task_id": "validate-ip-address", "drop": [], "similar": [ "ip-to-cidr", "strong-password-checker-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "queryIP" ], "tests": { "total": 243, "kept": 236, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "queryIP consists only of English letters, digits and the characters '.' and ':'." ] }, { "line": 27, "end_line": 27, "violates": [ "queryIP consists only of English letters, digits and the characters '.' and ':'." ] }, { "line": 74, "end_line": 74, "violates": [ "queryIP consists only of English letters, digits and the characters '.' and ':'." ] }, { "line": 91, "end_line": 91, "violates": [ "queryIP consists only of English letters, digits and the characters '.' and ':'." ] }, { "line": 99, "end_line": 99, "violates": [ "queryIP consists only of English letters, digits and the characters '.' and ':'." ] }, { "line": 103, "end_line": 103, "violates": [ "queryIP consists only of English letters, digits and the characters '.' and ':'." ] }, { "line": 107, "end_line": 107, "violates": [ "queryIP consists only of English letters, digits and the characters '.' and ':'." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 469, "task_id": "convex-polygon", "drop": [ "premium" ] }, { "question_id": 471, "task_id": "encode-string-with-shortest-length", "drop": [ "premium" ] }, { "question_id": 472, "task_id": "concatenated-words", "drop": [], "similar": [ "word-break-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 96, "kept": 94, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= words[i].length <= 30" ] }, { "line": 36, "end_line": 36, "violates": [ "All the strings of words are unique." ] } ], "unchecked_constraints": [ "1 <= sum(words[i].length) <= 10**(5)" ], "public_tests": 2, "hints": [] }, { "question_id": 473, "task_id": "matchsticks-to-square", "drop": [], "similar": [ "maximum-rows-covered-by-columns" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matchsticks" ], "tests": { "total": 85, "kept": 81, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= matchsticks.length <= 15" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= matchsticks.length <= 15" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= matchsticks.length <= 15", "1 <= matchsticks.length <= 15" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= matchsticks.length <= 15", "1 <= matchsticks.length <= 15" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Treat the matchsticks as an array. Can we split the array into 4 equal parts?", "Every matchstick can belong to either of the 4 sides. We don't know which one. Maybe try out all options!", "For every matchstick, we have to try out each of the 4 options i.e. which side it can belong to. We can make use of recursion for this.", "We don't really need to keep track of which matchsticks belong to a particular side during recursion. We just need to keep track of the length of each of the 4 sides.", "When all matchsticks have been used we simply need to see the length of all 4 sides. If they're equal, we have a square on our hands!" ] }, { "question_id": 474, "task_id": "ones-and-zeroes", "drop": [], "similar": [ "count-subarrays-with-more-ones-than-zeros", "non-negative-integers-without-consecutive-ones", "all-divisions-with-the-highest-score-of-a-binary-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "strs", "m", "n" ], "tests": { "total": 110, "kept": 108, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= m, n <= 100" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= m, n <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 475, "task_id": "heaters", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "houses", "heaters" ], "tests": { "total": 108, "kept": 107, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 96, "end_line": 96, "violates": [ "1 <= houses[i], heaters[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 476, "task_id": "number-complement", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 44, "kept": 42, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= num < 2**(31)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= num < 2**(31)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 477, "task_id": "total-hamming-distance", "drop": [], "similar": [ "hamming-distance", "sum-of-digit-differences-of-all-pairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 98, "kept": 83, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 72, "end_line": 72, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [ "The answer for the given input will fit in a 32-bit integer." ], "public_tests": 2, "hints": [] }, { "question_id": 479, "task_id": "largest-palindrome-product", "drop": [ "too_few_tests" ], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 8, "kept": 8, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 480, "task_id": "sliding-window-median", "drop": [], "similar": [ "find-median-from-data-stream", "minimum-operations-to-make-median-of-array-equal-to-k" ], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "nums", "k" ], "tests": { "total": 115, "kept": 115, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The simplest of solutions comes from the basic idea of finding the median given a set of numbers. We know that by definition, a median is the center element (or an average of the two center elements). Given an unsorted list of numbers, how do we find the median element? If you know the answer to this question, can we extend this idea to every sliding window that we come across in the array?", "Is there a better way to do what we are doing in the above hint? Don't you think there is duplication of calculation being done there? Is there some sort of optimization that we can do to achieve the same result? This approach is merely a modification of the basic approach except that it simply reduces duplication of calculations once done.", "The third line of thought is also based on this same idea but achieving the result in a different way. We obviously need the window to be sorted for us to be able to find the median. Is there a data-structure out there that we can use (in one or more quantities) to obtain the median element extremely fast, say O(1) time while having the ability to perform the other operations fairly efficiently as well?" ] }, { "question_id": 481, "task_id": "magical-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 41, "kept": 41, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 482, "task_id": "license-key-formatting", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 105, "kept": 103, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= s.length <= 10**(5)" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= s.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 483, "task_id": "smallest-good-base", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 104, "kept": 104, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "n is an integer in the range [3, 10**(18)].", "n does not contain any leading zeros." ], "public_tests": 3, "hints": [] }, { "question_id": 484, "task_id": "find-permutation", "drop": [ "premium" ] }, { "question_id": 485, "task_id": "max-consecutive-ones", "drop": [], "similar": [ "max-consecutive-ones-ii", "max-consecutive-ones-iii", "consecutive-characters", "longer-contiguous-segments-of-ones-than-zeros", "length-of-the-longest-alphabetical-continuous-substring", "maximum-enemy-forts-that-can-be-captured" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 97, "kept": 97, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "You need to think about two things as far as any window is concerned. One is the starting point for the window. How do you detect that a new window of 1s has started? The next part is detecting the ending point for this window. How do you detect the ending point for an existing window? If you figure these two things out, you will be able to detect the windows of consecutive ones. All that remains afterward is to find the longest such window and return the size." ] }, { "question_id": 486, "task_id": "predict-the-winner", "drop": [], "similar": [ "can-i-win", "find-the-winning-player-in-coin-game", "find-the-number-of-winning-players", "count-the-number-of-winning-sequences" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3320 count-the-number-of-winning-sequences" ] }, { "question_id": 487, "task_id": "max-consecutive-ones-ii", "drop": [ "premium" ] }, { "question_id": 488, "task_id": "zuma-game", "drop": [ "too_few_tests" ], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "board", "hand" ], "tests": { "total": 1, "kept": 0, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= hand.length <= 5" ] } ], "unchecked_constraints": [ "The initial row of balls on the board will not have any groups of three or more consecutive balls of the same color." ] }, { "question_id": 490, "task_id": "the-maze", "drop": [ "premium" ] }, { "question_id": 491, "task_id": "non-decreasing-subsequences", "drop": [], "similar": [ "maximum-length-of-pair-chain" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums" ], "tests": { "total": 103, "kept": 98, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums.length <= 15" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums.length <= 15" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums.length <= 15" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums.length <= 15" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 492, "task_id": "construct-the-rectangle", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "area" ], "tests": { "total": 74, "kept": 59, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= area <= 10**(7)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= area <= 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The W is always less than or equal to the square root of the area, so we start searching at sqrt(area) till we find the result." ] }, { "question_id": 493, "task_id": "reverse-pairs", "drop": [], "similar": [ "count-of-smaller-numbers-after-self", "count-of-range-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 126, "kept": 126, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use the merge-sort technique.", "Divide the array into two parts and sort them.", "For each integer in the first part, count the number of integers that satisfy the condition from the second part. Use the pointer to help you in the counting process." ] }, { "question_id": 494, "task_id": "target-sum", "drop": [], "similar": [ "expression-add-operators", "ways-to-express-an-integer-as-sum-of-powers" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 85, "kept": 78, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "-1000 <= target <= 1000" ] }, { "line": 21, "end_line": 21, "violates": [ "-1000 <= target <= 1000" ] }, { "line": 36, "end_line": 36, "violates": [ "-1000 <= target <= 1000", "-1000 <= target <= 1000" ] }, { "line": 55, "end_line": 55, "violates": [ "-1000 <= target <= 1000" ] }, { "line": 65, "end_line": 65, "violates": [ "-1000 <= target <= 1000" ] }, { "line": 72, "end_line": 72, "violates": [ "-1000 <= target <= 1000", "-1000 <= target <= 1000" ] }, { "line": 74, "end_line": 74, "violates": [ "-1000 <= target <= 1000" ] } ], "unchecked_constraints": [ "0 <= sum(nums[i]) <= 1000" ], "public_tests": 2, "hints": [] }, { "question_id": 495, "task_id": "teemo-attacking", "drop": [], "similar": [ "merge-intervals", "can-place-flowers", "dota2-senate" ], "flags": [], "comparison": "exact", "parameter_names": [ "timeSeries", "duration" ], "tests": { "total": 120, "kept": 120, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 496, "task_id": "next-greater-element-i", "drop": [], "similar": [ "next-greater-element-ii", "next-greater-element-iii", "daily-temperatures", "sum-of-subarray-ranges", "sum-of-total-strength-of-wizards", "next-greater-element-iv", "remove-nodes-from-linked-list", "smallest-missing-integer-greater-than-sequential-prefix-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 118, "kept": 118, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All integers in nums1 and nums2 are unique.", "All the integers of nums1 also appear in nums2." ], "public_tests": 2, "hints": [] }, { "question_id": 498, "task_id": "diagonal-traverse", "drop": [], "similar": [ "decode-the-slanted-ciphertext" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat" ], "tests": { "total": 62, "kept": 62, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 499, "task_id": "the-maze-iii", "drop": [ "premium" ] }, { "question_id": 500, "task_id": "keyboard-row", "drop": [], "similar": [ "find-the-sequence-of-strings-appeared-on-the-screen", "find-the-original-typed-string-i", "find-the-original-typed-string-ii" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 81, "kept": 67, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= words.length <= 20" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= words.length <= 20" ] }, { "line": 28, "end_line": 28, "violates": [ "words[i] consists of English letters (both lowercase and uppercase)." ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= words.length <= 20", "1 <= words.length <= 20" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= words.length <= 20" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= words.length <= 20" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= words.length <= 20" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= words.length <= 20" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= words.length <= 20" ] }, { "line": 61, "end_line": 61, "violates": [ "words[i] consists of English letters (both lowercase and uppercase)." ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= words.length <= 20", "words[i] consists of English letters (both lowercase and uppercase)." ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= words.length <= 20", "1 <= words.length <= 20" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= words.length <= 20" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= words.length <= 20" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [], "similar_to_test": [ "3324 find-the-sequence-of-strings-appeared-on-the-screen", "3330 find-the-original-typed-string-i", "3333 find-the-original-typed-string-ii" ] }, { "question_id": 501, "task_id": "find-mode-in-binary-search-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "validate-binary-search-tree" ], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "root" ], "tests": { "total": 89, "kept": 0, "dropped": { "unreadable": 89 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "-10**(5) <= Node.val <= 10**(5)" ] }, { "question_id": 502, "task_id": "ipo", "drop": [], "similar": [ "maximum-subsequence-score", "maximum-elegance-of-a-k-length-subsequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "k", "w", "profits", "capital" ], "tests": { "total": 131, "kept": 129, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "0 <= profits[i] <= 10**(4)" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= profits[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 503, "task_id": "next-greater-element-ii", "drop": [], "similar": [ "next-greater-element-i", "next-greater-element-iii", "maximum-and-minimum-sums-of-at-most-size-k-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 122, "kept": 122, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 504, "task_id": "base-7", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 47, "kept": 43, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "-10**(7) <= num <= 10**(7)" ] }, { "line": 24, "end_line": 24, "violates": [ "-10**(7) <= num <= 10**(7)" ] }, { "line": 40, "end_line": 40, "violates": [ "-10**(7) <= num <= 10**(7)" ] }, { "line": 44, "end_line": 44, "violates": [ "-10**(7) <= num <= 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 505, "task_id": "the-maze-ii", "drop": [ "premium" ] }, { "question_id": 506, "task_id": "relative-ranks", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "score" ], "tests": { "total": 89, "kept": 85, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "All the values in score are unique." ] }, { "line": 57, "end_line": 57, "violates": [ "All the values in score are unique." ] }, { "line": 65, "end_line": 65, "violates": [ "All the values in score are unique." ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= score[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 507, "task_id": "perfect-number", "drop": [], "similar": [ "self-dividing-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 49, "kept": 42, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= num <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 508, "task_id": "most-frequent-subtree-sum", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "subtree-of-another-tree", "count-nodes-equal-to-sum-of-descendants" ], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "root" ], "tests": { "total": 84, "kept": 0, "dropped": { "unreadable": 84 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "-10**(5) <= Node.val <= 10**(5)" ] }, { "question_id": 509, "task_id": "fibonacci-number", "drop": [], "similar": [ "climbing-stairs", "split-array-into-fibonacci-sequence", "length-of-longest-fibonacci-subsequence", "n-th-tribonacci-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 17, "kept": 17, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 513, "task_id": "find-bottom-left-tree-value", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 84, "kept": 0, "dropped": { "unreadable": 84 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "-2**(31) <= Node.val <= 2**(31) - 1" ] }, { "question_id": 514, "task_id": "freedom-trail", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "ring", "key" ], "tests": { "total": 70, "kept": 68, "dropped": { "non_finite": 1, "constraint_violation": 1 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= ring.length, key.length <= 100" ] } ], "unchecked_constraints": [ "It is guaranteed that key could always be spelled by rotating ring." ], "public_tests": 2, "hints": [] }, { "question_id": 515, "task_id": "find-largest-value-in-each-tree-row", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 77, "kept": 0, "dropped": { "unreadable": 77 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree will be in the range [0, 10**(4)].", "-2**(31) <= Node.val <= 2**(31) - 1" ] }, { "question_id": 516, "task_id": "longest-palindromic-subsequence", "drop": [], "similar": [ "longest-palindromic-substring", "palindromic-substrings", "count-different-palindromic-subsequences", "longest-common-subsequence", "longest-palindromic-subsequence-ii", "maximize-palindrome-length-from-subsequences", "maximum-product-of-the-length-of-two-palindromic-subsequences" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 100, "kept": 99, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 40, "end_line": 40, "violates": [ "s consists only of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 517, "task_id": "super-washing-machines", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "machines" ], "tests": { "total": 53, "kept": 53, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 518, "task_id": "coin-change-ii", "drop": [], "similar": [ "maximum-value-of-k-coins-from-piles", "number-of-ways-to-earn-points", "count-of-sub-multisets-with-bounded-sum", "length-of-the-longest-subsequence-that-sums-to-target", "the-number-of-ways-to-make-the-sum", "inverse-coin-change" ], "flags": [], "comparison": "exact", "parameter_names": [ "amount", "coins" ], "tests": { "total": 124, "kept": 71, "dropped": { "constraint_violation": 16, "int_overflow": 37 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "0 <= amount <= 5000" ] }, { "line": 12, "end_line": 12, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 20, "end_line": 20, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= amount <= 5000" ] }, { "line": 28, "end_line": 28, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 33, "end_line": 33, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 34, "end_line": 34, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 35, "end_line": 35, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= amount <= 5000" ] }, { "line": 38, "end_line": 38, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= amount <= 5000" ] }, { "line": 40, "end_line": 40, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= amount <= 5000" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= amount <= 5000" ] }, { "line": 44, "end_line": 44, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 45, "end_line": 45, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 46, "end_line": 46, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 47, "end_line": 47, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 49, "end_line": 49, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 50, "end_line": 50, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 52, "end_line": 52, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= amount <= 5000" ] }, { "line": 55, "end_line": 55, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 57, "end_line": 57, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 62, "end_line": 62, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 67, "end_line": 67, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "java" ] }, { "line": 69, "end_line": 69, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 73, "end_line": 73, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= amount <= 5000" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= coins[i] <= 5000" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= amount <= 5000" ] }, { "line": 83, "end_line": 83, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 85, "end_line": 85, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 86, "end_line": 86, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 88, "end_line": 88, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 90, "end_line": 90, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "java" ] }, { "line": 95, "end_line": 95, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 96, "end_line": 96, "violates": [ "0 <= amount <= 5000" ] }, { "line": 97, "end_line": 97, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 101, "end_line": 101, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 104, "end_line": 104, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 105, "end_line": 105, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 108, "end_line": 108, "violates": [ "0 <= amount <= 5000" ] }, { "line": 109, "end_line": 109, "violates": [ "0 <= amount <= 5000" ] }, { "line": 111, "end_line": 111, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] }, { "line": 113, "end_line": 113, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 115, "end_line": 115, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 116, "end_line": 116, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 118, "end_line": 118, "violates": [ "0 <= amount <= 5000" ] }, { "line": 120, "end_line": 120, "violates": [ "0 <= amount <= 5000" ] }, { "line": 121, "end_line": 121, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 124, "end_line": 124, "violates": [ "0 <= amount <= 5000" ] }, { "line": 125, "end_line": 125, "unrepresentable_in": [ "cpp", "rust", "javascript", "typescript", "go", "java", "php" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 520, "task_id": "detect-capital", "drop": [], "similar": [ "capitalize-the-title", "count-the-number-of-special-characters-ii", "count-the-number-of-special-characters-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 401, "kept": 400, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 219, "end_line": 219, "violates": [ "word consists of lowercase and uppercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 521, "task_id": "longest-uncommon-subsequence-i", "drop": [], "similar": [ "longest-uncommon-subsequence-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "a", "b" ], "tests": { "total": 125, "kept": 121, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= a.length, b.length <= 100" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= a.length, b.length <= 100" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= a.length, b.length <= 100" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= a.length, b.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think very simple.", "If a == b, the answer is -1.", "Otherwise, the answer is the string a or the string b." ] }, { "question_id": 522, "task_id": "longest-uncommon-subsequence-ii", "drop": [], "similar": [ "longest-uncommon-subsequence-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "strs" ], "tests": { "total": 106, "kept": 99, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= strs[i].length <= 10" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= strs[i].length <= 10" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= strs[i].length <= 10" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= strs[i].length <= 10" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= strs[i].length <= 10" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= strs[i].length <= 10" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= strs[i].length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 523, "task_id": "continuous-subarray-sum", "drop": [], "similar": [ "subarray-sum-equals-k", "minimum-number-of-operations-to-make-array-continuous", "intervals-between-identical-elements", "apply-operations-to-make-all-array-elements-equal-to-zero" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 121, "kept": 121, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= sum(nums[i]) <= 2**(31) - 1" ], "public_tests": 3, "hints": [] }, { "question_id": 524, "task_id": "longest-word-in-dictionary-through-deleting", "drop": [], "similar": [ "longest-word-in-dictionary" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "dictionary" ], "tests": { "total": 94, "kept": 90, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= s.length <= 1000", "1 <= s.length <= 1000" ] }, { "line": 6, "end_line": 6, "violates": [ "1 <= dictionary[i].length <= 1000" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= s.length <= 1000", "1 <= s.length <= 1000" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= dictionary.length <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 525, "task_id": "contiguous-array", "drop": [], "similar": [ "maximum-size-subarray-sum-equals-k", "find-all-possible-stable-binary-arrays-i", "find-all-possible-stable-binary-arrays-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 111, "kept": 111, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 526, "task_id": "beautiful-arrangement", "drop": [], "similar": [ "beautiful-arrangement-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 15, "kept": 15, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 527, "task_id": "word-abbreviation", "drop": [ "premium" ] }, { "question_id": 529, "task_id": "minesweeper", "drop": [], "similar": [ "detonate-the-maximum-bombs" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board", "click" ], "tests": { "total": 119, "kept": 119, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "board[i][j] is either 'M', 'E', 'B', or a digit from '1' to '8'.", "0 <= clickr < m", "0 <= clickc < n", "board[clickr][clickc] is either 'M' or 'E'." ], "public_tests": 2, "hints": [] }, { "question_id": 530, "task_id": "minimum-absolute-difference-in-bst", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "k-diff-pairs-in-an-array" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 87, "kept": 0, "dropped": { "unreadable": 87 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [2, 10**(4)].", "0 <= Node.val <= 10**(5)" ] }, { "question_id": 531, "task_id": "lonely-pixel-i", "drop": [ "premium" ] }, { "question_id": 532, "task_id": "k-diff-pairs-in-an-array", "drop": [], "similar": [ "minimum-absolute-difference-in-bst", "count-number-of-pairs-with-absolute-difference-k", "kth-smallest-product-of-two-sorted-arrays", "count-number-of-bad-pairs", "number-of-pairs-satisfying-inequality", "minimum-absolute-difference-between-elements-with-constraint" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 126, "kept": 122, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "0 <= k <= 10**(7)" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= k <= 10**(7)" ] }, { "line": 89, "end_line": 89, "violates": [ "0 <= k <= 10**(7)" ] }, { "line": 123, "end_line": 123, "violates": [ "-10**(7) <= nums[i] <= 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 533, "task_id": "lonely-pixel-ii", "drop": [ "premium" ] }, { "question_id": 536, "task_id": "construct-binary-tree-from-string", "drop": [ "premium" ] }, { "question_id": 537, "task_id": "complex-number-multiplication", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "num1", "num2" ], "tests": { "total": 62, "kept": 62, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "num1 and num2 are valid complex numbers." ], "public_tests": 2, "hints": [] }, { "question_id": 538, "task_id": "convert-bst-to-greater-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 1, "kept": 0, "dropped": { "unreadable": 1 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 10**(4)].", "-10**(4) <= Node.val <= 10**(4)", "All the values in the tree are unique.", "root is guaranteed to be a valid binary search tree." ] }, { "question_id": 539, "task_id": "minimum-time-difference", "drop": [], "similar": [ "minimum-cost-to-set-cooking-time" ], "flags": [], "comparison": "exact", "parameter_names": [ "timePoints" ], "tests": { "total": 84, "kept": 84, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "timePoints[i] is in the format \"HH:MM\"." ], "public_tests": 2, "hints": [] }, { "question_id": 540, "task_id": "single-element-in-a-sorted-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 133, "kept": 132, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 108, "end_line": 108, "violates": [ "0 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 541, "task_id": "reverse-string-ii", "drop": [], "similar": [ "reverse-string", "reverse-words-in-a-string-iii", "faulty-keyboard" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 104, "kept": 102, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= s.length <= 10**(4)" ] }, { "line": 35, "end_line": 35, "violates": [ "s consists of only lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 542, "task_id": "01-matrix", "drop": [], "similar": [ "shortest-path-to-get-food", "minimum-operations-to-remove-adjacent-ones-in-matrix", "difference-between-ones-and-zeros-in-row-and-column" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat" ], "tests": { "total": 67, "kept": 67, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There is at least one 0 in mat." ], "public_tests": 2, "hints": [] }, { "question_id": 543, "task_id": "diameter-of-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "diameter-of-n-ary-tree", "longest-path-with-different-adjacent-characters" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 93, "kept": 0, "dropped": { "unreadable": 93 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "-100 <= Node.val <= 100" ] }, { "question_id": 544, "task_id": "output-contest-matches", "drop": [ "premium" ] }, { "question_id": 545, "task_id": "boundary-of-binary-tree", "drop": [ "premium" ] }, { "question_id": 546, "task_id": "remove-boxes", "drop": [], "similar": [ "strange-printer", "number-of-unique-flavors-after-sharing-k-candies" ], "flags": [], "comparison": "exact", "parameter_names": [ "boxes" ], "tests": { "total": 122, "kept": 122, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 547, "task_id": "number-of-provinces", "drop": [], "similar": [ "number-of-connected-components-in-an-undirected-graph", "robot-return-to-origin", "sentence-similarity", "sentence-similarity-ii", "the-earliest-moment-when-everyone-become-friends", "detonate-the-maximum-bombs" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "isConnected" ], "tests": { "total": 57, "kept": 57, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "isConnected[i][j] is 1 or 0." ], "public_tests": 2, "hints": [] }, { "question_id": 548, "task_id": "split-array-with-equal-sum", "drop": [ "premium" ] }, { "question_id": 549, "task_id": "binary-tree-longest-consecutive-sequence-ii", "drop": [ "premium" ] }, { "question_id": 551, "task_id": "student-attendance-record-i", "drop": [], "similar": [ "student-attendance-record-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 181, "kept": 181, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 552, "task_id": "student-attendance-record-ii", "drop": [], "similar": [ "student-attendance-record-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 11, "kept": 11, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 553, "task_id": "optimal-division", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 114, "kept": 95, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 8, "end_line": 8, "violates": [ "2 <= nums[i] <= 1000", "2 <= nums[i] <= 1000" ] }, { "line": 21, "end_line": 21, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 34, "end_line": 34, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 37, "end_line": 37, "violates": [ "2 <= nums[i] <= 1000", "2 <= nums[i] <= 1000" ] }, { "line": 42, "end_line": 42, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums.length <= 10" ] }, { "line": 53, "end_line": 53, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 56, "end_line": 56, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums.length <= 10" ] }, { "line": 66, "end_line": 66, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 71, "end_line": 71, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 88, "end_line": 88, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 89, "end_line": 89, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 100, "end_line": 100, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 104, "end_line": 104, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 105, "end_line": 105, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums.length <= 10" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= nums.length <= 10" ] } ], "unchecked_constraints": [ "There is only one optimal division for the given input." ], "public_tests": 2, "hints": [] }, { "question_id": 554, "task_id": "brick-wall", "drop": [], "similar": [ "number-of-ways-to-build-sturdy-brick-wall" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "wall" ], "tests": { "total": 63, "kept": 63, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "sum(wall[i]) is the same for each row i.", "1 <= sum(wall[i].length) <= 2 * 10**(4)" ], "public_tests": 2, "hints": [] }, { "question_id": 555, "task_id": "split-concatenated-strings", "drop": [ "premium" ] }, { "question_id": 556, "task_id": "next-greater-element-iii", "drop": [], "similar": [ "next-greater-element-i", "next-greater-element-ii", "next-palindrome-using-same-digits" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 80, "kept": 50, "dropped": { "constraint_violation": 30 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= n <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 557, "task_id": "reverse-words-in-a-string-iii", "drop": [], "similar": [ "reverse-string-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s contains printable ASCII characters.", "s does not contain any leading or trailing spaces.", "There is at least one word in s.", "All the words in s are separated by a single space." ], "public_tests": 2, "hints": [] }, { "question_id": 560, "task_id": "subarray-sum-equals-k", "drop": [], "similar": [ "two-sum", "continuous-subarray-sum", "subarray-product-less-than-k", "find-pivot-index", "subarray-sums-divisible-by-k", "minimum-operations-to-reduce-x-to-zero", "k-radius-subarray-averages", "maximum-sum-score-of-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 102, "kept": 100, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 29, "end_line": 29, "violates": [ "-1000 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Will Brute force work here? Try to optimize it.", "Can we optimize it by using some extra space?", "What about storing sum frequencies in a hash table? Will it be useful?", "sum(i,j)=sum(0,j)-sum(0,i), where sum(i,j) represents the sum of all the elements from index i to j-1. Can we use this property to optimize it." ] }, { "question_id": 561, "task_id": "array-partition", "drop": [], "similar": [ "minimum-difference-between-highest-and-lowest-of-k-scores", "minimum-cost-of-buying-candies-with-discount", "all-divisions-with-the-highest-score-of-a-binary-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 112, "kept": 110, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 85, "end_line": 85, "violates": [ "-10**(4) <= nums[i] <= 10**(4)" ] }, { "line": 95, "end_line": 95, "violates": [ "-10**(4) <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [ "1 <= n <= 10**(4)", "nums.length == 2 * n" ], "public_tests": 2, "hints": [ "Obviously, brute force won't help here. Think of something else, take some example like 1,2,3,4.", "How will you make pairs to get the result? There must be some pattern.", "Did you observe that- Minimum element gets add into the result in sacrifice of maximum element.", "Still won't able to find pairs? Sort the array and try to find the pattern." ] }, { "question_id": 562, "task_id": "longest-line-of-consecutive-one-in-matrix", "drop": [ "premium" ] }, { "question_id": 563, "task_id": "binary-tree-tilt", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "find-all-the-lonely-nodes" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 89, "kept": 0, "dropped": { "unreadable": 89 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 10**(4)].", "-1000 <= Node.val <= 1000" ] }, { "question_id": 564, "task_id": "find-the-closest-palindrome", "drop": [], "similar": [ "find-palindrome-with-fixed-length", "next-palindrome-using-same-digits", "find-the-count-of-good-integers", "find-the-largest-palindrome-divisible-by-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 114, "kept": 80, "dropped": { "constraint_violation": 34 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= n.length <= 18" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= n.length <= 18" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= n.length <= 18" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= n.length <= 18" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= n.length <= 18" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= n.length <= 18" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= n.length <= 18" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= n.length <= 18" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= n.length <= 18" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= n.length <= 18" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= n.length <= 18" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= n.length <= 18" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= n.length <= 18" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= n.length <= 18" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= n.length <= 18" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= n.length <= 18" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= n.length <= 18" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= n.length <= 18" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= n.length <= 18" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= n.length <= 18" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= n.length <= 18" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= n.length <= 18" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= n.length <= 18" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= n.length <= 18" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= n.length <= 18" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= n.length <= 18" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= n.length <= 18" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= n.length <= 18" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= n.length <= 18" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= n.length <= 18" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= n.length <= 18" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= n.length <= 18" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= n.length <= 18" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= n.length <= 18" ] } ], "unchecked_constraints": [ "n does not have leading zeros.", "n is representing an integer in the range [1, 10**(18) - 1]." ], "public_tests": 2, "hints": [ "Will brute force work for this problem? Think of something else.", "Take some examples like 1234, 999,1000, etc and check their closest palindromes. How many different cases are possible?", "Do we have to consider only left half or right half of the string or both?", "Try to find the closest palindrome of these numbers- 12932, 99800, 12120. Did you observe something?" ], "similar_to_test": [ "3260 find-the-largest-palindrome-divisible-by-k", "3272 find-the-count-of-good-integers" ] }, { "question_id": 565, "task_id": "array-nesting", "drop": [], "similar": [ "nested-list-weight-sum", "flatten-nested-list-iterator", "nested-list-weight-sum-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 97, "kept": 97, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 566, "task_id": "reshape-the-matrix", "drop": [], "similar": [ "convert-1d-array-into-2d-array" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat", "r", "c" ], "tests": { "total": 97, "kept": 97, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Do you know how 2d matrix is stored in 1d memory? Try to map 2-dimensions into one.", "M[i][j]=M[n*i+j] , where n is the number of cols. This is the one way of converting 2-d indices into one 1-d index. Now, how will you convert 1-d index into 2-d indices?", "Try to use division and modulus to convert 1-d index into 2-d indices.", "M[i] => M[i/n][i%n] Will it result in right mapping? Take some example and check this formula." ] }, { "question_id": 567, "task_id": "permutation-in-string", "drop": [], "similar": [ "minimum-window-substring", "find-all-anagrams-in-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "s2" ], "tests": { "total": 95, "kept": 95, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Obviously, brute force will result in TLE. Think of something else.", "How will you check whether one string is a permutation of another string?", "One way is to sort the string and then compare. But, Is there a better way?", "If one string is a permutation of another string then they must have one common metric. What is that?", "Both strings must have same character frequencies, if one is permutation of another. Which data structure should be used to store frequencies?", "What about hash table? An array of size 26?" ] }, { "question_id": 568, "task_id": "maximum-vacation-days", "drop": [ "premium" ] }, { "question_id": 572, "task_id": "subtree-of-another-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "count-univalue-subtrees", "most-frequent-subtree-sum" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "subRoot" ], "tests": { "total": 127, "kept": 0, "dropped": { "unreadable": 127 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 105, "end_line": 105, "unreadable": true }, { "line": 106, "end_line": 106, "unreadable": true }, { "line": 107, "end_line": 107, "unreadable": true }, { "line": 108, "end_line": 108, "unreadable": true }, { "line": 109, "end_line": 109, "unreadable": true }, { "line": 110, "end_line": 110, "unreadable": true }, { "line": 111, "end_line": 111, "unreadable": true }, { "line": 112, "end_line": 112, "unreadable": true }, { "line": 113, "end_line": 113, "unreadable": true }, { "line": 114, "end_line": 114, "unreadable": true }, { "line": 115, "end_line": 115, "unreadable": true }, { "line": 116, "end_line": 116, "unreadable": true }, { "line": 117, "end_line": 117, "unreadable": true }, { "line": 118, "end_line": 118, "unreadable": true }, { "line": 119, "end_line": 119, "unreadable": true }, { "line": 120, "end_line": 120, "unreadable": true }, { "line": 121, "end_line": 121, "unreadable": true }, { "line": 122, "end_line": 122, "unreadable": true }, { "line": 123, "end_line": 123, "unreadable": true }, { "line": 124, "end_line": 124, "unreadable": true }, { "line": 125, "end_line": 125, "unreadable": true }, { "line": 126, "end_line": 126, "unreadable": true }, { "line": 127, "end_line": 127, "unreadable": true }, { "line": 128, "end_line": 128, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the root tree is in the range [1, 2000].", "The number of nodes in the subRoot tree is in the range [1, 1000].", "-10**(4) <= root.val <= 10**(4)", "-10**(4) <= subRoot.val <= 10**(4)" ] }, { "question_id": 573, "task_id": "squirrel-simulation", "drop": [ "premium" ] }, { "question_id": 575, "task_id": "distribute-candies", "drop": [], "similar": [ "minimum-number-of-operations-to-satisfy-conditions", "check-if-grid-satisfies-conditions" ], "flags": [], "comparison": "exact", "parameter_names": [ "candyType" ], "tests": { "total": 106, "kept": 97, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "n is even." ] }, { "line": 31, "end_line": 31, "violates": [ "n is even." ] }, { "line": 33, "end_line": 33, "violates": [ "n is even." ] }, { "line": 44, "end_line": 44, "violates": [ "n is even." ] }, { "line": 52, "end_line": 52, "violates": [ "n is even." ] }, { "line": 55, "end_line": 55, "violates": [ "n is even." ] }, { "line": 64, "end_line": 64, "violates": [ "n is even." ] }, { "line": 67, "end_line": 67, "violates": [ "n is even." ] }, { "line": 105, "end_line": 105, "violates": [ "n is even." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "To maximize the number of kinds of candies, we should try to distribute candies such that Alice will gain all kinds.", "What is the upper limit of the number of kinds of candies Alice will gain? Remember candies are to distributed equally.", "Which data structure is the most suitable for finding the number of kinds of candies?", "Will hashset solves the problem? Inserting all candies kind in the hashset and then checking its size with upper limit." ] }, { "question_id": 576, "task_id": "out-of-boundary-paths", "drop": [], "similar": [ "knight-probability-in-chessboard", "execution-of-all-suffix-instructions-staying-in-a-grid" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n", "maxMove", "startRow", "startColumn" ], "tests": { "total": 117, "kept": 117, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Is traversing every path feasible? There are many possible paths for a small matrix. Try to optimize it.", "Can we use some space to store the number of paths and update them after every move?", "One obvious thing: the ball will go out of the boundary only by crossing it. Also, there is only one possible way the ball can go out of the boundary from the boundary cell except for corner cells. From the corner cell, the ball can go out in two different ways. Can you use this thing to solve the problem?" ] }, { "question_id": 581, "task_id": "shortest-unsorted-continuous-subarray", "drop": [], "similar": [ "smallest-subarray-to-sort-in-every-sliding-window" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 158, "kept": 158, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 582, "task_id": "kill-process", "drop": [ "premium" ] }, { "question_id": 583, "task_id": "delete-operation-for-two-strings", "drop": [], "similar": [ "edit-distance", "minimum-ascii-delete-sum-for-two-strings", "longest-common-subsequence", "make-three-strings-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "word1", "word2" ], "tests": { "total": 104, "kept": 104, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 587, "task_id": "erect-the-fence", "drop": [], "similar": [ "erect-the-fence-ii", "sort-the-students-by-their-kth-score" ], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "trees" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All the given positions are unique." ], "public_tests": 2, "hints": [] }, { "question_id": 591, "task_id": "tag-validator", "drop": [], "similar": [ "add-bold-tag-in-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "code" ], "tests": { "total": 231, "kept": 217, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] }, { "line": 10, "end_line": 10, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] }, { "line": 18, "end_line": 18, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] }, { "line": 20, "end_line": 20, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] }, { "line": 26, "end_line": 26, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] }, { "line": 35, "end_line": 35, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] }, { "line": 138, "end_line": 138, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] }, { "line": 148, "end_line": 148, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] }, { "line": 174, "end_line": 174, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] }, { "line": 187, "end_line": 187, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] }, { "line": 191, "end_line": 191, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] }, { "line": 196, "end_line": 196, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] }, { "line": 202, "end_line": 202, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] }, { "line": 209, "end_line": 209, "violates": [ "code consists of English letters, digits, '<', '>', '/', '!', '[', ']', '.', and ' '." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 592, "task_id": "fraction-addition-and-subtraction", "drop": [], "similar": [ "solve-the-equation" ], "flags": [], "comparison": "exact", "parameter_names": [ "expression" ], "tests": { "total": 126, "kept": 126, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The input string only contains '0' to '9', '/', '+' and '-'. So does the output.", "Each fraction (input and output) has the format \u00b1numerator/denominator. If the first input fraction or the output is positive, then '+' will be omitted.", "The input only contains valid irreducible fractions, where the numerator and denominator of each fraction will always be in the range [1, 10]. If the denominator is 1, it means this fraction is actually an integer in a fraction format defined above.", "The number of given fractions will be in the range [1, 10].", "The numerator and denominator of the final result are guaranteed to be valid and in the range of 32-bit int." ], "public_tests": 3, "hints": [] }, { "question_id": 593, "task_id": "valid-square", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "p1", "p2", "p3", "p4" ], "tests": { "total": 89, "kept": 89, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "-10**(4) <= xi, yi <= 10**(4)" ], "public_tests": 3, "hints": [] }, { "question_id": 594, "task_id": "longest-harmonious-subsequence", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 116, "kept": 112, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 34, "end_line": 34, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 89, "end_line": 89, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 106, "end_line": 106, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 598, "task_id": "range-addition-ii", "drop": [], "similar": [ "range-addition", "sum-of-matrix-after-queries" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n", "ops" ], "tests": { "total": 112, "kept": 111, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 99, "end_line": 99, "violates": [ "1 <= bi <= n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 599, "task_id": "minimum-index-sum-of-two-lists", "drop": [], "similar": [ "intersection-of-two-linked-lists" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "list1", "list2" ], "tests": { "total": 93, "kept": 87, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "list1[i] and list2[i] consist of spaces ' ' and English letters." ] }, { "line": 78, "end_line": 78, "violates": [ "list1[i] and list2[i] consist of spaces ' ' and English letters." ] }, { "line": 82, "end_line": 82, "violates": [ "list1[i] and list2[i] consist of spaces ' ' and English letters." ] }, { "line": 84, "end_line": 84, "violates": [ "list1[i] and list2[i] consist of spaces ' ' and English letters." ] }, { "line": 85, "end_line": 85, "violates": [ "list1[i] and list2[i] consist of spaces ' ' and English letters." ] }, { "line": 89, "end_line": 89, "violates": [ "All the strings of list2 are unique." ] } ], "unchecked_constraints": [ "There is at least a common string between list1 and list2." ], "public_tests": 3, "hints": [] }, { "question_id": 600, "task_id": "non-negative-integers-without-consecutive-ones", "drop": [], "similar": [ "house-robber", "house-robber-ii", "ones-and-zeroes", "generate-binary-strings-without-adjacent-zeros" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 26, "kept": 24, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 605, "task_id": "can-place-flowers", "drop": [], "similar": [ "teemo-attacking", "asteroid-collision" ], "flags": [], "comparison": "exact", "parameter_names": [ "flowerbed", "n" ], "tests": { "total": 107, "kept": 107, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "flowerbed[i] is 0 or 1.", "There are no two adjacent flowers in flowerbed." ], "public_tests": 2, "hints": [] }, { "question_id": 606, "task_id": "construct-string-from-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "construct-binary-tree-from-string", "find-duplicate-subtrees" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 107, "kept": 0, "dropped": { "unreadable": 107 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 105, "end_line": 105, "unreadable": true }, { "line": 106, "end_line": 106, "unreadable": true }, { "line": 107, "end_line": 107, "unreadable": true }, { "line": 108, "end_line": 108, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "-1000 <= Node.val <= 1000" ] }, { "question_id": 609, "task_id": "find-duplicate-file-in-system", "drop": [], "similar": [ "delete-duplicate-folders-in-system" ], "flags": [ "unordered_groups" ], "comparison": "unordered_groups", "parameter_names": [ "paths" ], "tests": { "total": 83, "kept": 83, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "You may assume no files or directories share the same name in the same directory.", "You may assume each given directory info represents a unique directory. A single blank space separates the directory path and file info.", "1 <= sum(paths[i].length) <= 5 * 10**(5)" ], "public_tests": 2, "hints": [] }, { "question_id": 611, "task_id": "valid-triangle-number", "drop": [], "similar": [ "3sum-smaller", "find-polygon-with-the-largest-perimeter" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 115, "kept": 113, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "0 <= nums[i] <= 1000" ] }, { "line": 108, "end_line": 108, "violates": [ "0 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 616, "task_id": "add-bold-tag-in-string", "drop": [ "premium" ] }, { "question_id": 617, "task_id": "merge-two-binary-trees", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root1", "root2" ], "tests": { "total": 1, "kept": 0, "dropped": { "unreadable": 1 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in both trees is in the range [0, 2000].", "-10**(4) <= Node.val <= 10**(4)" ] }, { "question_id": 621, "task_id": "task-scheduler", "drop": [], "similar": [ "rearrange-string-k-distance-apart", "reorganize-string", "maximum-number-of-weeks-for-which-you-can-work", "find-minimum-time-to-finish-all-jobs-ii", "task-scheduler-ii", "generate-schedule" ], "flags": [], "comparison": "exact", "parameter_names": [ "tasks", "n" ], "tests": { "total": 86, "kept": 86, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "tasks[i] is an uppercase English letter." ], "public_tests": 3, "hints": [ "There are many different solutions for this problem, including a greedy algorithm.", "For every cycle, find the most frequent letter that can be placed in this cycle. After placing, decrease the frequency of that letter by one.", "Use Priority Queue." ] }, { "question_id": 623, "task_id": "add-one-row-to-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "val", "depth" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "The depth of the tree is in the range [1, 10**(4)].", "-100 <= Node.val <= 100", "1 <= depth <= the depth of tree + 1" ] }, { "question_id": 624, "task_id": "maximum-distance-in-arrays", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arrays" ], "tests": { "total": 100, "kept": 95, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "-10**(4) <= arrays[i][j] <= 10**(4)" ] }, { "line": 16, "end_line": 16, "violates": [ "arrays[i] is sorted in ascending order." ] }, { "line": 23, "end_line": 23, "violates": [ "-10**(4) <= arrays[i][j] <= 10**(4)" ] }, { "line": 81, "end_line": 81, "violates": [ "arrays[i] is sorted in ascending order." ] }, { "line": 97, "end_line": 97, "violates": [ "arrays[i] is sorted in ascending order." ] } ], "unchecked_constraints": [ "There will be at most 10**(5) integers in all the arrays." ], "public_tests": 2, "hints": [] }, { "question_id": 625, "task_id": "minimum-factorization", "drop": [ "premium" ] }, { "question_id": 628, "task_id": "maximum-product-of-three-numbers", "drop": [], "similar": [ "maximum-product-subarray", "maximum-product-of-three-elements-after-one-replacement" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 111, "kept": 111, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 629, "task_id": "k-inverse-pairs-array", "drop": [], "similar": [ "count-the-number-of-inversions" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 80, "kept": 80, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 630, "task_id": "course-schedule-iii", "drop": [], "similar": [ "course-schedule", "course-schedule-ii", "parallel-courses-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "courses" ], "tests": { "total": 130, "kept": 129, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "1 <= durationi, lastDayi <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "During iteration, say I want to add the current course, currentTotalTime being total time of all courses taken till now, but adding the current course might exceed my deadline or it doesn\u2019t. 1. If it doesn\u2019t, then I have added one new course. Increment the currentTotalTime with duration of current course.", "2. If it exceeds deadline, I can swap current course with current courses that has biggest duration. * No harm done and I might have just reduced the currentTotalTime, right? * What preprocessing do I need to do on my course processing order so that this swap is always legal?" ] }, { "question_id": 632, "task_id": "smallest-range-covering-elements-from-k-lists", "drop": [], "similar": [ "minimum-window-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 97, "kept": 91, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "nums[i] is sorted in non-decreasing order." ] }, { "line": 28, "end_line": 28, "violates": [ "nums[i] is sorted in non-decreasing order." ] }, { "line": 45, "end_line": 45, "violates": [ "nums[i] is sorted in non-decreasing order." ] }, { "line": 56, "end_line": 56, "violates": [ "nums[i] is sorted in non-decreasing order." ] }, { "line": 80, "end_line": 80, "violates": [ "nums[i] is sorted in non-decreasing order." ] }, { "line": 83, "end_line": 83, "violates": [ "nums[i] is sorted in non-decreasing order." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 633, "task_id": "sum-of-square-numbers", "drop": [], "similar": [ "valid-perfect-square", "sum-of-squares-of-special-elements" ], "flags": [], "comparison": "exact", "parameter_names": [ "c" ], "tests": { "total": 52, "kept": 41, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "0 <= c <= 2**(31) - 1" ] }, { "line": 18, "end_line": 18, "violates": [ "0 <= c <= 2**(31) - 1" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= c <= 2**(31) - 1" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= c <= 2**(31) - 1" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= c <= 2**(31) - 1" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= c <= 2**(31) - 1" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= c <= 2**(31) - 1" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= c <= 2**(31) - 1" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= c <= 2**(31) - 1" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= c <= 2**(31) - 1" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= c <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 634, "task_id": "find-the-derangement-of-an-array", "drop": [ "premium" ] }, { "question_id": 636, "task_id": "exclusive-time-of-functions", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "logs" ], "tests": { "total": 69, "kept": 69, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= function_id < n", "0 <= timestamp <= 10**(9)", "No two start events will happen at the same timestamp.", "No two end events will happen at the same timestamp.", "Each function has an \"end\" log for each \"start\" log." ], "public_tests": 3, "hints": [] }, { "question_id": 637, "task_id": "average-of-levels-in-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-level-order-traversal", "binary-tree-level-order-traversal-ii" ], "flags": [ "decimal_answer", "has_images" ], "comparison": "float", "parameter_names": [ "root" ], "tests": { "total": 93, "kept": 0, "dropped": { "unreadable": 93 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "-2**(31) <= Node.val <= 2**(31) - 1" ] }, { "question_id": 638, "task_id": "shopping-offers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "price", "special", "needs" ], "tests": { "total": 90, "kept": 54, "dropped": { "constraint_violation": 36 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "0 <= price[i], needs[i] <= 10" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= price[i], needs[i] <= 10", "0 <= special[i][j] <= 50" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= price[i], needs[i] <= 10", "0 <= special[i][j] <= 50" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= price[i], needs[i] <= 10" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= price[i], needs[i] <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "0 <= price[i], needs[i] <= 10", "0 <= special[i][j] <= 50" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= special[i][j] <= 50" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= price[i], needs[i] <= 10", "0 <= special[i][j] <= 50" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= price[i], needs[i] <= 10" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= price[i], needs[i] <= 10" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= price[i], needs[i] <= 10" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= price[i], needs[i] <= 10" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= price[i], needs[i] <= 10", "0 <= special[i][j] <= 50" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= n <= 6" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= n <= 6" ] }, { "line": 55, "end_line": 55, "violates": [ "0 <= price[i], needs[i] <= 10", "0 <= special[i][j] <= 50" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= price[i], needs[i] <= 10" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= price[i], needs[i] <= 10" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= price[i], needs[i] <= 10" ] }, { "line": 61, "end_line": 61, "violates": [ "n == price.length == needs.length", "0 <= special[i][j] <= 50" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= price[i], needs[i] <= 10" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= price[i], needs[i] <= 10", "0 <= special[i][j] <= 50" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= special[i][j] <= 50" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= n <= 6", "0 <= special[i][j] <= 50" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= price[i], needs[i] <= 10", "0 <= special[i][j] <= 50" ] }, { "line": 72, "end_line": 72, "violates": [ "0 <= price[i], needs[i] <= 10" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= n <= 6", "0 <= price[i], needs[i] <= 10", "0 <= special[i][j] <= 50" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= price[i], needs[i] <= 10", "0 <= special[i][j] <= 50" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= n <= 6" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= n <= 6", "0 <= price[i], needs[i] <= 10" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= price[i], needs[i] <= 10", "0 <= special[i][j] <= 50" ] }, { "line": 83, "end_line": 83, "violates": [ "0 <= price[i], needs[i] <= 10", "0 <= special[i][j] <= 50" ] }, { "line": 87, "end_line": 87, "violates": [ "0 <= special[i][j] <= 50" ] }, { "line": 89, "end_line": 89, "violates": [ "0 <= price[i], needs[i] <= 10" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= special[i][j] <= 50" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= price[i], needs[i] <= 10", "0 <= special[i][j] <= 50" ] } ], "unchecked_constraints": [ "The input is generated that at least one of special[i][j] is non-zero for 0 <= j <= n - 1." ], "public_tests": 2, "hints": [] }, { "question_id": 639, "task_id": "decode-ways-ii", "drop": [], "similar": [ "decode-ways", "number-of-ways-to-separate-numbers", "number-of-ways-to-divide-a-long-corridor" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 157, "kept": 157, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s[i] is a digit or '*'." ], "public_tests": 3, "hints": [] }, { "question_id": 640, "task_id": "solve-the-equation", "drop": [], "similar": [ "fraction-addition-and-subtraction", "minimize-result-by-adding-parentheses-to-expression" ], "flags": [], "comparison": "exact", "parameter_names": [ "equation" ], "tests": { "total": 253, "kept": 253, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "equation has exactly one '='.", "The input is generated that if there is a single solution, it will be an integer.", "equation consists of integers with an absolute value in the range [0, 100] without any leading zeros, and the variable 'x'." ], "public_tests": 3, "hints": [] }, { "question_id": 643, "task_id": "maximum-average-subarray-i", "drop": [], "similar": [ "maximum-average-subarray-ii", "k-radius-subarray-averages" ], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "nums", "k" ], "tests": { "total": 95, "kept": 94, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "-10**(4) <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 644, "task_id": "maximum-average-subarray-ii", "drop": [ "premium" ] }, { "question_id": 645, "task_id": "set-mismatch", "drop": [], "similar": [ "find-the-duplicate-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 89, "kept": 89, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 646, "task_id": "maximum-length-of-pair-chain", "drop": [], "similar": [ "longest-increasing-subsequence", "non-decreasing-subsequences", "longest-non-decreasing-subarray-from-two-arrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "pairs" ], "tests": { "total": 106, "kept": 98, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "-1000 <= lefti < righti <= 1000" ] }, { "line": 16, "end_line": 16, "violates": [ "-1000 <= lefti < righti <= 1000" ] }, { "line": 22, "end_line": 22, "violates": [ "-1000 <= lefti < righti <= 1000" ] }, { "line": 40, "end_line": 40, "violates": [ "-1000 <= lefti < righti <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "-1000 <= lefti < righti <= 1000" ] }, { "line": 88, "end_line": 88, "violates": [ "-1000 <= lefti < righti <= 1000", "-1000 <= lefti < righti <= 1000" ] }, { "line": 89, "end_line": 89, "violates": [ "-1000 <= lefti < righti <= 1000" ] }, { "line": 100, "end_line": 100, "violates": [ "-1000 <= lefti < righti <= 1000", "-1000 <= lefti < righti <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 647, "task_id": "palindromic-substrings", "drop": [], "similar": [ "longest-palindromic-substring", "longest-palindromic-subsequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 140, "kept": 139, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= s.length <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How can we reuse a previously computed palindrome to compute a larger palindrome?", "If \u201caba\u201d is a palindrome, is \u201cxabax\u201d a palindrome? Similarly is \u201cxabay\u201d a palindrome?", "Complexity based hint: If we use brute force and check whether for every start and end position a substring is a palindrome we have O(n^2) start - end pairs and O(n) palindromic checks. Can we reduce the time for palindromic checks to O(1) by reusing some previous computation?" ] }, { "question_id": 648, "task_id": "replace-words", "drop": [], "similar": [ "implement-trie-prefix-tree" ], "flags": [], "comparison": "exact", "parameter_names": [ "dictionary", "sentence" ], "tests": { "total": 184, "kept": 182, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 69, "end_line": 69, "violates": [ "sentence consists of only lower-case letters and spaces." ] }, { "line": 92, "end_line": 92, "violates": [ "sentence consists of only lower-case letters and spaces." ] } ], "unchecked_constraints": [ "The number of words in sentence is in the range [1, 1000]", "The length of each word in sentence is in the range [1, 1000]", "Every two consecutive words in sentence will be separated by exactly one space.", "sentence does not have leading or trailing spaces." ], "public_tests": 2, "hints": [] }, { "question_id": 649, "task_id": "dota2-senate", "drop": [], "similar": [ "teemo-attacking" ], "flags": [], "comparison": "exact", "parameter_names": [ "senate" ], "tests": { "total": 177, "kept": 166, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "senate[i] is either 'R' or 'D'." ] }, { "line": 34, "end_line": 34, "violates": [ "senate[i] is either 'R' or 'D'." ] }, { "line": 40, "end_line": 40, "violates": [ "senate[i] is either 'R' or 'D'." ] }, { "line": 66, "end_line": 66, "violates": [ "senate[i] is either 'R' or 'D'." ] }, { "line": 71, "end_line": 71, "violates": [ "senate[i] is either 'R' or 'D'." ] }, { "line": 77, "end_line": 77, "violates": [ "senate[i] is either 'R' or 'D'." ] }, { "line": 107, "end_line": 107, "violates": [ "senate[i] is either 'R' or 'D'." ] }, { "line": 109, "end_line": 109, "violates": [ "senate[i] is either 'R' or 'D'." ] }, { "line": 114, "end_line": 114, "violates": [ "senate[i] is either 'R' or 'D'." ] }, { "line": 118, "end_line": 118, "violates": [ "senate[i] is either 'R' or 'D'." ] }, { "line": 147, "end_line": 147, "violates": [ "senate[i] is either 'R' or 'D'." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 650, "task_id": "2-keys-keyboard", "drop": [], "similar": [ "4-keys-keyboard", "broken-calculator", "smallest-value-after-replacing-with-sum-of-prime-factors", "distinct-prime-factors-of-product-of-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 65, "kept": 63, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= n <= 1000" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= n <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How many characters may be there in the clipboard at the last step if n = 3? n = 7? n = 10? n = 24?" ] }, { "question_id": 651, "task_id": "4-keys-keyboard", "drop": [ "premium" ] }, { "question_id": 653, "task_id": "two-sum-iv-input-is-a-bst", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "two-sum", "two-sum-ii-input-array-is-sorted", "two-sum-iii-data-structure-design", "two-sum-bsts" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "k" ], "tests": { "total": 89, "kept": 0, "dropped": { "unreadable": 89 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "-10**(4) <= Node.val <= 10**(4)", "root is guaranteed to be a valid binary search tree." ] }, { "question_id": 654, "task_id": "maximum-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "maximum-binary-tree-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 655, "task_id": "print-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 63, "kept": 0, "dropped": { "unreadable": 63 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 2**(10)].", "-99 <= Node.val <= 99", "The depth of the tree will be in the range [1, 10]." ] }, { "question_id": 656, "task_id": "coin-path", "drop": [ "premium" ] }, { "question_id": 657, "task_id": "robot-return-to-origin", "drop": [], "similar": [ "number-of-provinces", "execution-of-all-suffix-instructions-staying-in-a-grid", "furthest-point-from-origin" ], "flags": [], "comparison": "exact", "parameter_names": [ "moves" ], "tests": { "total": 112, "kept": 112, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "moves only contains the characters 'U', 'D', 'L' and 'R'." ], "public_tests": 2, "hints": [] }, { "question_id": 658, "task_id": "find-k-closest-elements", "drop": [], "similar": [ "guess-number-higher-or-lower", "guess-number-higher-or-lower-ii", "find-k-th-smallest-pair-distance", "find-closest-number-to-zero" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "k", "x" ], "tests": { "total": 129, "kept": 128, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 83, "end_line": 83, "violates": [ "-10**(4) <= arr[i], x <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 659, "task_id": "split-array-into-consecutive-subsequences", "drop": [], "similar": [ "top-k-frequent-elements", "divide-array-in-sets-of-k-consecutive-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 123, "kept": 123, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 660, "task_id": "remove-9", "drop": [ "premium" ] }, { "question_id": 661, "task_id": "image-smoother", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "img" ], "tests": { "total": 81, "kept": 78, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "0 <= img[i][j] <= 255" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= img[i][j] <= 255" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= img[i][j] <= 255" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 662, "task_id": "maximum-width-of-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 95, "kept": 0, "dropped": { "unreadable": 95 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 3000].", "-100 <= Node.val <= 100" ] }, { "question_id": 663, "task_id": "equal-tree-partition", "drop": [ "premium" ] }, { "question_id": 664, "task_id": "strange-printer", "drop": [], "similar": [ "remove-boxes", "strange-printer-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 102, "kept": 101, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 70, "end_line": 70, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 665, "task_id": "non-decreasing-array", "drop": [], "similar": [ "make-array-non-decreasing-or-non-increasing", "find-good-days-to-rob-the-bank", "count-non-decreasing-subarrays-after-k-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 165, "kept": 165, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3420 count-non-decreasing-subarrays-after-k-operations" ] }, { "question_id": 666, "task_id": "path-sum-iv", "drop": [ "premium" ] }, { "question_id": 667, "task_id": "beautiful-arrangement-ii", "drop": [], "similar": [ "beautiful-arrangement" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 71, "kept": 71, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 668, "task_id": "kth-smallest-number-in-multiplication-table", "drop": [], "similar": [ "kth-smallest-element-in-a-sorted-matrix", "find-k-th-smallest-pair-distance", "k-th-smallest-prime-fraction", "minimum-time-to-eat-all-grains", "kth-smallest-amount-with-single-denomination-combination" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n", "k" ], "tests": { "total": 95, "kept": 94, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= m, n <= 3 * 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 669, "task_id": "trim-a-binary-search-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "low", "high" ], "tests": { "total": 3, "kept": 0, "dropped": { "unreadable": 3 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "0 <= Node.val <= 10**(4)", "The value of each node in the tree is unique.", "root is guaranteed to be a valid binary search tree." ] }, { "question_id": 670, "task_id": "maximum-swap", "drop": [], "similar": [ "create-maximum-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 119, "kept": 60, "dropped": { "constraint_violation": 59 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 4, "end_line": 4, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 9, "end_line": 9, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 13, "end_line": 13, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 17, "end_line": 17, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 18, "end_line": 18, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 55, "end_line": 55, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 72, "end_line": 72, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 73, "end_line": 73, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 85, "end_line": 85, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 87, "end_line": 87, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 89, "end_line": 89, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 96, "end_line": 96, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 98, "end_line": 98, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 99, "end_line": 99, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 106, "end_line": 106, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 110, "end_line": 110, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 113, "end_line": 113, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 114, "end_line": 114, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 115, "end_line": 115, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 118, "end_line": 118, "violates": [ "0 <= num <= 10**(8)" ] }, { "line": 119, "end_line": 119, "violates": [ "0 <= num <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 671, "task_id": "second-minimum-node-in-a-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "kth-smallest-element-in-a-bst" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 114, "kept": 0, "dropped": { "unreadable": 114 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 105, "end_line": 105, "unreadable": true }, { "line": 106, "end_line": 106, "unreadable": true }, { "line": 107, "end_line": 107, "unreadable": true }, { "line": 108, "end_line": 108, "unreadable": true }, { "line": 109, "end_line": 109, "unreadable": true }, { "line": 110, "end_line": 110, "unreadable": true }, { "line": 111, "end_line": 111, "unreadable": true }, { "line": 112, "end_line": 112, "unreadable": true }, { "line": 113, "end_line": 113, "unreadable": true }, { "line": 114, "end_line": 114, "unreadable": true }, { "line": 115, "end_line": 115, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 25].", "1 <= Node.val <= 2**(31) - 1", "root.val == min(root.left.val, root.right.val) for each internal node of the tree." ] }, { "question_id": 672, "task_id": "bulb-switcher-ii", "drop": [], "similar": [ "bulb-switcher", "number-of-times-binary-string-is-prefix-aligned" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "presses" ], "tests": { "total": 90, "kept": 90, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 673, "task_id": "number-of-longest-increasing-subsequence", "drop": [], "similar": [ "longest-increasing-subsequence", "longest-continuous-increasing-subsequence", "longest-increasing-subsequence-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The answer is guaranteed to fit inside a 32-bit integer." ], "public_tests": 2, "hints": [] }, { "question_id": 674, "task_id": "longest-continuous-increasing-subsequence", "drop": [], "similar": [ "number-of-longest-increasing-subsequence", "minimum-window-subsequence", "consecutive-characters", "longest-increasing-subsequence-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 134, "kept": 132, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "1 <= nums.length <= 10**(4)" ] }, { "line": 109, "end_line": 109, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 675, "task_id": "cut-off-trees-for-golf-event", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "forest" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Heights of all trees are distinct." ], "public_tests": 3, "hints": [] }, { "question_id": 678, "task_id": "valid-parenthesis-string", "drop": [], "similar": [ "special-binary-string", "check-if-a-parentheses-string-can-be-valid" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 181, "kept": 181, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s[i] is '(', ')' or '*'." ], "public_tests": 4, "hints": [ "Use backtracking to explore all possible combinations of treating '*' as either '(', ')', or an empty string. If any combination leads to a valid string, return true.", "DP[i][j] represents whether the substring s[i:j] is valid.", "Keep track of the count of open parentheses encountered so far. If you encounter a close parenthesis, it should balance with an open parenthesis. Utilize a stack to handle this effectively.", "How about using 2 stacks instead of 1? Think about it." ] }, { "question_id": 679, "task_id": "24-game", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "cards" ], "tests": { "total": 109, "kept": 104, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= cards[i] <= 9" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= cards[i] <= 9" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= cards[i] <= 9" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= cards[i] <= 9" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= cards[i] <= 9" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 680, "task_id": "valid-palindrome-ii", "drop": [], "similar": [ "valid-palindrome", "valid-palindrome-iii", "valid-palindrome-iv" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 108, "kept": 107, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 106, "end_line": 106, "violates": [ "s consists of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 681, "task_id": "next-closest-time", "drop": [ "premium" ] }, { "question_id": 682, "task_id": "baseball-game", "drop": [], "similar": [ "crawler-log-folder" ], "flags": [], "comparison": "exact", "parameter_names": [ "operations" ], "tests": { "total": 76, "kept": 73, "dropped": { "int_overflow": 3 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 42, "end_line": 42, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 65, "end_line": 65, "unrepresentable_in": [ "cpp", "rust", "java" ] } ], "unchecked_constraints": [ "operations[i] is \"C\", \"D\", \"+\", or a string representing an integer in the range [-3 * 10**(4), 3 * 10**(4)].", "For operation \"+\", there will always be at least two previous scores on the record.", "For operations \"C\" and \"D\", there will always be at least one previous score on the record." ], "public_tests": 3, "hints": [] }, { "question_id": 683, "task_id": "k-empty-slots", "drop": [ "premium" ] }, { "question_id": 684, "task_id": "redundant-connection", "drop": [], "similar": [ "redundant-connection-ii", "accounts-merge", "maximum-employees-to-be-invited-to-a-meeting", "shortest-cycle-in-a-graph" ], "flags": [ "multiple_answers", "has_images" ], "comparison": "exact", "parameter_names": [ "edges" ], "tests": { "total": 76, "kept": 32, "dropped": { "constraint_violation": 44 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 4, "end_line": 4, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= ai < bi <= edges.length" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= ai < bi <= edges.length" ] } ], "unchecked_constraints": [ "There are no repeated edges.", "The given graph is connected." ], "public_tests": 2, "hints": [] }, { "question_id": 685, "task_id": "redundant-connection-ii", "drop": [], "similar": [ "redundant-connection" ], "flags": [ "multiple_answers", "has_images" ], "comparison": "exact", "parameter_names": [ "edges" ], "tests": { "total": 94, "kept": 94, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= ui, vi <= n", "ui != vi" ], "public_tests": 2, "hints": [] }, { "question_id": 686, "task_id": "repeated-string-match", "drop": [], "similar": [ "repeated-substring-pattern" ], "flags": [], "comparison": "exact", "parameter_names": [ "a", "b" ], "tests": { "total": 144, "kept": 143, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 134, "end_line": 134, "violates": [ "1 <= a.length, b.length <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 687, "task_id": "longest-univalue-path", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-maximum-path-sum", "count-univalue-subtrees", "path-sum-iii", "longest-path-with-different-adjacent-characters" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 106, "kept": 0, "dropped": { "unreadable": 106 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 105, "end_line": 105, "unreadable": true }, { "line": 106, "end_line": 106, "unreadable": true }, { "line": 107, "end_line": 107, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [0, 10**(4)].", "-1000 <= Node.val <= 1000", "The depth of the tree will not exceed 1000." ] }, { "question_id": 688, "task_id": "knight-probability-in-chessboard", "drop": [], "similar": [ "out-of-boundary-paths", "maximum-number-of-moves-to-kill-all-pawns" ], "flags": [ "figure_reference", "decimal_answer", "has_images" ], "comparison": "float", "parameter_names": [ "n", "k", "row", "column" ], "tests": { "total": 79, "kept": 79, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3283 maximum-number-of-moves-to-kill-all-pawns" ] }, { "question_id": 689, "task_id": "maximum-sum-of-3-non-overlapping-subarrays", "drop": [], "similar": [ "best-time-to-buy-and-sell-stock-iii", "sum-of-variable-length-subarrays", "maximize-ysum-by-picking-a-triplet-of-distinct-xvalues" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 80, "kept": 73, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= k <= floor(nums.length / 3)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] < 2**(16)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i] < 2**(16)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] < 2**(16)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] < 2**(16)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= k <= floor(nums.length / 3)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] < 2**(16)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3427 sum-of-variable-length-subarrays" ] }, { "question_id": 691, "task_id": "stickers-to-spell-word", "drop": [], "similar": [ "ransom-note" ], "flags": [], "comparison": "exact", "parameter_names": [ "stickers", "target" ], "tests": { "total": 146, "kept": 95, "dropped": { "constraint_violation": 51 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= target.length <= 15" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= stickers[i].length <= 10", "1 <= target.length <= 15" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= target.length <= 15" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= stickers[i].length <= 10", "1 <= target.length <= 15" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= target.length <= 15" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= target.length <= 15" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= stickers[i].length <= 10", "1 <= target.length <= 15" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= target.length <= 15" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= target.length <= 15" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= target.length <= 15" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= target.length <= 15" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= target.length <= 15" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= target.length <= 15" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= target.length <= 15" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= target.length <= 15" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= target.length <= 15" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= target.length <= 15" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= stickers[i].length <= 10", "1 <= target.length <= 15" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= target.length <= 15" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= target.length <= 15" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= target.length <= 15" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= target.length <= 15" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= target.length <= 15" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= target.length <= 15" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= target.length <= 15" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= target.length <= 15" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= target.length <= 15" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= target.length <= 15" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= target.length <= 15" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= target.length <= 15" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= target.length <= 15" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= target.length <= 15" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= target.length <= 15" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= target.length <= 15" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= stickers[i].length <= 10", "1 <= target.length <= 15" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= target.length <= 15" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= target.length <= 15" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= target.length <= 15" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= target.length <= 15" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= stickers[i].length <= 10", "1 <= target.length <= 15" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= target.length <= 15" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= target.length <= 15" ] }, { "line": 128, "end_line": 128, "violates": [ "1 <= target.length <= 15" ] }, { "line": 131, "end_line": 131, "violates": [ "1 <= target.length <= 15" ] }, { "line": 135, "end_line": 135, "violates": [ "1 <= target.length <= 15" ] }, { "line": 136, "end_line": 136, "violates": [ "1 <= target.length <= 15" ] }, { "line": 137, "end_line": 137, "violates": [ "1 <= target.length <= 15" ] }, { "line": 139, "end_line": 139, "violates": [ "1 <= target.length <= 15" ] }, { "line": 140, "end_line": 140, "violates": [ "1 <= target.length <= 15" ] }, { "line": 142, "end_line": 142, "violates": [ "1 <= target.length <= 15" ] }, { "line": 143, "end_line": 143, "violates": [ "1 <= target.length <= 15" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We want to perform an exhaustive search, but we need to speed it up based on the input data being random. For all stickers, we can ignore any letters that are not in the target word. When our candidate answer won't be smaller than an answer we have already found, we can stop searching this path. When a sticker dominates another, we shouldn't include the dominated sticker in our sticker collection. [Here, we say a sticker `A` dominates `B` if `A.count(letter) >= B.count(letter)` for all letters.]" ] }, { "question_id": 692, "task_id": "top-k-frequent-words", "drop": [], "similar": [ "top-k-frequent-elements", "k-closest-points-to-origin", "sort-features-by-popularity", "sender-with-largest-word-count", "maximum-number-of-pairs-in-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "words", "k" ], "tests": { "total": 92, "kept": 90, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= words[i].length <= 10" ] } ], "unchecked_constraints": [ "k is in the range [1, The number of unique words[i]]" ], "public_tests": 2, "hints": [] }, { "question_id": 693, "task_id": "binary-number-with-alternating-bits", "drop": [], "similar": [ "number-of-1-bits" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 72, "kept": 66, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= n <= 2**(31) - 1" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= n <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 694, "task_id": "number-of-distinct-islands", "drop": [ "premium" ] }, { "question_id": 695, "task_id": "max-area-of-island", "drop": [], "similar": [ "number-of-islands", "battleships-in-a-board", "island-perimeter", "largest-submatrix-with-rearrangements", "detonate-the-maximum-bombs", "maximum-number-of-fish-in-a-grid" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 59, "kept": 59, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 696, "task_id": "count-binary-substrings", "drop": [], "similar": [ "encode-and-decode-strings", "number-of-substrings-with-fixed-ratio", "count-the-number-of-substrings-with-dominant-ones" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 158, "kept": 158, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How many valid binary substrings exist in \"000111\", and how many in \"11100\"? What about \"00011100\"?" ] }, { "question_id": 697, "task_id": "degree-of-an-array", "drop": [], "similar": [ "maximum-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 93, "kept": 93, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums.length will be between 1 and 50,000.", "nums[i] will be an integer between 0 and 49,999." ], "public_tests": 2, "hints": [ "Say 5 is the only element that occurs the most number of times - for example, nums = [1, 5, 2, 3, 5, 4, 5, 6]. What is the answer?" ] }, { "question_id": 698, "task_id": "partition-to-k-equal-sum-subsets", "drop": [], "similar": [ "partition-equal-subset-sum", "fair-distribution-of-cookies", "maximum-number-of-ways-to-partition-an-array", "maximum-rows-covered-by-columns", "maximum-product-of-two-integers-with-no-common-bits" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 87, "kept": 85, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= k <= nums.length <= 16" ] } ], "unchecked_constraints": [ "The frequency of each element is in the range [1, 4]." ], "public_tests": 2, "hints": [ "We can figure out what target each subset must sum to. Then, let's recursively search, where at each call to our function, we choose which of k subsets the next value will join." ] }, { "question_id": 699, "task_id": "falling-squares", "drop": [], "similar": [ "the-skyline-problem" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "positions" ], "tests": { "total": 105, "kept": 104, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= lefti <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If positions = [[10, 20], [20, 30]], this is the same as [[1, 2], [2, 3]]. Currently, the values of positions are very large. Can you generalize this approach so as to make the values in positions manageable?" ] }, { "question_id": 700, "task_id": "search-in-a-binary-search-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "closest-binary-search-tree-value", "insert-into-a-binary-search-tree", "closest-nodes-queries-in-a-binary-search-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "val" ], "tests": { "total": 20, "kept": 0, "dropped": { "unreadable": 20 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 5000].", "1 <= Node.val <= 10**(7)", "root is a binary search tree." ] }, { "question_id": 701, "task_id": "insert-into-a-binary-search-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "search-in-a-binary-search-tree" ], "flags": [ "multiple_answers", "has_images" ], "comparison": "exact", "parameter_names": [ "root", "val" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the tree will be in the range [0, 10**(4)].", "-10**(8) <= Node.val <= 10**(8)", "All the values Node.val are unique.", "It's guaranteed that val does not exist in the original BST." ] }, { "question_id": 704, "task_id": "binary-search", "drop": [], "similar": [ "search-in-a-sorted-array-of-unknown-size", "maximum-count-of-positive-integer-and-negative-integer" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 115, "kept": 97, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 33, "end_line": 33, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 35, "end_line": 35, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 45, "end_line": 45, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 51, "end_line": 51, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 59, "end_line": 59, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 69, "end_line": 69, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 76, "end_line": 76, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 78, "end_line": 78, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 80, "end_line": 80, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 81, "end_line": 81, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 82, "end_line": 82, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 91, "end_line": 91, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 96, "end_line": 96, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 108, "end_line": 108, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 109, "end_line": 109, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 110, "end_line": 110, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] }, { "line": 115, "end_line": 115, "violates": [ "-10**(4) < nums[i], target < 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 709, "task_id": "to-lower-case", "drop": [ "too_few_tests" ], "similar": [ "capitalize-the-title" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 3, "kept": 3, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s consists of printable ASCII characters." ] }, { "question_id": 711, "task_id": "number-of-distinct-islands-ii", "drop": [ "premium" ] }, { "question_id": 712, "task_id": "minimum-ascii-delete-sum-for-two-strings", "drop": [], "similar": [ "edit-distance", "longest-increasing-subsequence", "delete-operation-for-two-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "s2" ], "tests": { "total": 115, "kept": 112, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= s1.length, s2.length <= 1000" ] }, { "line": 6, "end_line": 6, "violates": [ "1 <= s1.length, s2.length <= 1000" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= s1.length, s2.length <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let dp(i, j) be the answer for inputs s1[i:] and s2[j:]." ] }, { "question_id": 713, "task_id": "subarray-product-less-than-k", "drop": [], "similar": [ "maximum-product-subarray", "maximum-size-subarray-sum-equals-k", "subarray-sum-equals-k", "two-sum-less-than-k", "number-of-smooth-descent-periods-of-a-stock", "count-subarrays-with-score-less-than-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 128, "kept": 120, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 35, "end_line": 35, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 85, "end_line": 85, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 112, "end_line": 112, "violates": [ "0 <= k <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each j, let opt(j) be the smallest i so that nums[i] * nums[i+1] * ... * nums[j] is less than k. opt is an increasing function." ] }, { "question_id": 714, "task_id": "best-time-to-buy-and-sell-stock-with-transaction-fee", "drop": [], "similar": [ "best-time-to-buy-and-sell-stock-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "prices", "fee" ], "tests": { "total": 107, "kept": 97, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= prices[i] < 5 * 10**(4)", "1 <= prices[i] < 5 * 10**(4)" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= prices[i] < 5 * 10**(4)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= prices[i] < 5 * 10**(4)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= prices[i] < 5 * 10**(4)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= prices[i] < 5 * 10**(4)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= prices[i] < 5 * 10**(4)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= prices[i] < 5 * 10**(4)", "1 <= prices[i] < 5 * 10**(4)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= prices[i] < 5 * 10**(4)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= prices[i] < 5 * 10**(4)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= prices[i] < 5 * 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider the first K stock prices. At the end, the only legal states are that you don't own a share of stock, or that you do. Calculate the most profit you could have under each of these two cases." ] }, { "question_id": 717, "task_id": "1-bit-and-2-bit-characters", "drop": [], "similar": [ "gray-code" ], "flags": [], "comparison": "exact", "parameter_names": [ "bits" ], "tests": { "total": 95, "kept": 95, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Keep track of where the next character starts. At the end, you want to know if you started on the last bit." ] }, { "question_id": 718, "task_id": "maximum-length-of-repeated-subarray", "drop": [], "similar": [ "minimum-size-subarray-sum", "longest-common-subpath", "find-the-maximum-length-of-a-good-subsequence-ii", "find-the-maximum-length-of-a-good-subsequence-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 110, "kept": 108, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 101, "end_line": 101, "violates": [ "0 <= nums1[i], nums2[i] <= 100" ] }, { "line": 106, "end_line": 106, "violates": [ "0 <= nums1[i], nums2[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use dynamic programming. dp[i][j] will be the longest common prefix of A[i:] and B[j:].", "The answer is max(dp[i][j]) over all i, j." ] }, { "question_id": 719, "task_id": "find-k-th-smallest-pair-distance", "drop": [], "similar": [ "find-k-pairs-with-smallest-sums", "kth-smallest-element-in-a-sorted-matrix", "find-k-closest-elements", "kth-smallest-number-in-multiplication-table", "k-th-smallest-prime-fraction", "find-the-median-of-the-uniqueness-array", "maximize-score-of-numbers-in-ranges" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 76, "kept": 70, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= k <= n * (n - 1) / 2" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= k <= n * (n - 1) / 2" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= k <= n * (n - 1) / 2" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= k <= n * (n - 1) / 2" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Binary search for the answer. How can you check how many pairs have distance <= X?" ], "similar_to_test": [ "3281 maximize-score-of-numbers-in-ranges" ] }, { "question_id": 720, "task_id": "longest-word-in-dictionary", "drop": [], "similar": [ "longest-word-in-dictionary-through-deleting", "implement-magic-dictionary", "longest-word-with-all-prefixes" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 116, "kept": 114, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 67, "end_line": 67, "violates": [ "1 <= words[i].length <= 30" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= words[i].length <= 30" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For every word in the input list, we can check whether all prefixes of that word are in the input list by using a Set." ] }, { "question_id": 721, "task_id": "accounts-merge", "drop": [], "similar": [ "redundant-connection", "sentence-similarity", "sentence-similarity-ii" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "accounts" ], "tests": { "total": 85, "kept": 85, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "accounts[i][j] (for j > 0) is a valid email." ], "public_tests": 2, "hints": [ "For every pair of emails in the same account, draw an edge between those emails. The problem is about enumerating the connected components of this graph." ] }, { "question_id": 722, "task_id": "remove-comments", "drop": [], "similar": [ "mini-parser", "ternary-expression-parser" ], "flags": [], "comparison": "exact", "parameter_names": [ "source" ], "tests": { "total": 102, "kept": 88, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "0 <= source[i].length <= 80" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= source[i].length <= 80" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= source[i].length <= 80" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= source[i].length <= 80" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= source[i].length <= 80" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= source[i].length <= 80" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= source[i].length <= 80" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= source[i].length <= 80" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= source[i].length <= 80" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= source[i].length <= 80" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= source[i].length <= 80" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= source[i].length <= 80" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= source[i].length <= 80" ] }, { "line": 87, "end_line": 87, "violates": [ "0 <= source[i].length <= 80" ] } ], "unchecked_constraints": [ "source[i] consists of printable ASCII characters.", "Every open block comment is eventually closed.", "There are no single-quote or double-quote in the input." ], "public_tests": 2, "hints": [ "Carefully parse each line according to the following rules: * If we start a block comment and we aren't in a block, then we will skip over the next two characters and change our state to be in a block. * If we end a block comment and we are in a block, then we will skip over the next two characters and change our state to be *not* in a block. * If we start a line comment and we aren't in a block, then we will ignore the rest of the line. * If we aren't in a block comment (and it wasn't the start of a comment), we will record the character we are at. * At the end of each line, if we aren't in a block, we will record the line." ] }, { "question_id": 723, "task_id": "candy-crush", "drop": [ "premium" ] }, { "question_id": 724, "task_id": "find-pivot-index", "drop": [], "similar": [ "subarray-sum-equals-k", "find-the-middle-index-in-array", "number-of-ways-to-split-array", "maximum-sum-score-of-array", "left-and-right-sum-differences" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 95, "kept": 93, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 23, "end_line": 23, "violates": [ "-1000 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Create an array sumLeft where sumLeft[i] is the sum of all the numbers to the left of index i.", "Create an array sumRight where sumRight[i] is the sum of all the numbers to the right of index i.", "For each index i, check if sumLeft[i] equals sumRight[i]. If so, return i. If no such i is found, return -1." ] }, { "question_id": 726, "task_id": "number-of-atoms", "drop": [], "similar": [ "decode-string", "encode-string-with-shortest-length", "parse-lisp-expression" ], "flags": [], "comparison": "exact", "parameter_names": [ "formula" ], "tests": { "total": 173, "kept": 173, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "formula is always valid." ], "public_tests": 3, "hints": [ "To parse formula[i:], when we see a `'('`, we will parse recursively whatever is inside the brackets (up to the correct closing ending bracket) and add it to our count, multiplying by the following multiplicity if there is one. Otherwise, we should see an uppercase character: we will parse the rest of the letters to get the name, and add that (plus the multiplicity if there is one.)" ] }, { "question_id": 727, "task_id": "minimum-window-subsequence", "drop": [ "premium" ] }, { "question_id": 728, "task_id": "self-dividing-numbers", "drop": [], "similar": [ "perfect-number", "check-if-number-has-equal-digit-count-and-digit-value", "count-the-digits-that-divide-a-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "left", "right" ], "tests": { "total": 82, "kept": 78, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= left <= right <= 10**(4)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= left <= right <= 10**(4)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= left <= right <= 10**(4)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= left <= right <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each number in the range, check whether it is self dividing by converting that number to a character array (or string in Python), then checking that each digit is nonzero and divides the original number." ] }, { "question_id": 730, "task_id": "count-different-palindromic-subsequences", "drop": [], "similar": [ "longest-palindromic-subsequence", "count-palindromic-subsequences" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 79, "kept": 79, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let dp(i, j) be the answer for the string T = S[i:j+1] including the empty sequence. The answer is the number of unique characters in T, plus palindromes of the form \"a_a\", \"b_b\", \"c_c\", and \"d_d\", where \"_\" represents zero or more characters." ] }, { "question_id": 733, "task_id": "flood-fill", "drop": [], "similar": [ "island-perimeter" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "image", "sr", "sc", "color" ], "tests": { "total": 88, "kept": 88, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Write a recursive function that paints the pixel if it's the correct color, then recurses on neighboring pixels." ] }, { "question_id": 734, "task_id": "sentence-similarity", "drop": [ "premium" ] }, { "question_id": 735, "task_id": "asteroid-collision", "drop": [], "similar": [ "can-place-flowers", "destroying-asteroids", "count-collisions-on-a-road", "robot-collisions" ], "flags": [], "comparison": "exact", "parameter_names": [ "asteroids" ], "tests": { "total": 123, "kept": 122, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "asteroids[i] != 0" ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Say a row of asteroids is stable. What happens when a new asteroid is added on the right?" ] }, { "question_id": 736, "task_id": "parse-lisp-expression", "drop": [], "similar": [ "ternary-expression-parser", "number-of-atoms", "basic-calculator-iv" ], "flags": [], "comparison": "exact", "parameter_names": [ "expression" ], "tests": { "total": 111, "kept": 111, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There are no leading or trailing spaces in expression.", "All tokens are separated by a single space in expression.", "The answer and all intermediate calculations of that answer are guaranteed to fit in a 32-bit integer.", "The expression is guaranteed to be legal and evaluate to an integer." ], "public_tests": 3, "hints": [ "* If the expression starts with a digit or '-', it's an integer: return it. * If the expression starts with a letter, it's a variable. Recall it by checking the current scope in reverse order. * Otherwise, group the tokens (variables or expressions) within this expression by counting the \"balance\" `bal` of the occurrences of `'('` minus the number of occurrences of `')'`. When the balance is zero, we have ended a token. For example, `(add 1 (add 2 3))` should have tokens `'1'` and `'(add 2 3)'`. * For add and mult expressions, evaluate each token and return the addition or multiplication of them. * For let expressions, evaluate each expression sequentially and assign it to the variable in the current scope, then return the evaluation of the final expression." ] }, { "question_id": 737, "task_id": "sentence-similarity-ii", "drop": [ "premium" ] }, { "question_id": 738, "task_id": "monotone-increasing-digits", "drop": [], "similar": [ "remove-k-digits" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 111, "kept": 82, "dropped": { "constraint_violation": 29 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 97, "end_line": 97, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 98, "end_line": 98, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 102, "end_line": 102, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 104, "end_line": 104, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 107, "end_line": 107, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 109, "end_line": 109, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 111, "end_line": 111, "violates": [ "0 <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Build the answer digit by digit, adding the largest possible one that would make the number still less than or equal to N." ] }, { "question_id": 739, "task_id": "daily-temperatures", "drop": [], "similar": [ "next-greater-element-i", "online-stock-span" ], "flags": [], "comparison": "exact", "parameter_names": [ "temperatures" ], "tests": { "total": 107, "kept": 75, "dropped": { "constraint_violation": 32 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 22, "end_line": 22, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 29, "end_line": 29, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 30, "end_line": 30, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 31, "end_line": 31, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 34, "end_line": 34, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 39, "end_line": 39, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 40, "end_line": 40, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 41, "end_line": 41, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 45, "end_line": 45, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 48, "end_line": 48, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 50, "end_line": 50, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 57, "end_line": 57, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 62, "end_line": 62, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 65, "end_line": 65, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 68, "end_line": 68, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 70, "end_line": 70, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 73, "end_line": 73, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 76, "end_line": 76, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 79, "end_line": 79, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 80, "end_line": 80, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 83, "end_line": 83, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 84, "end_line": 84, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 87, "end_line": 87, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 90, "end_line": 90, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 96, "end_line": 96, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 99, "end_line": 99, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 100, "end_line": 100, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 101, "end_line": 101, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 103, "end_line": 103, "violates": [ "30 <= temperatures[i] <= 100" ] }, { "line": 105, "end_line": 105, "violates": [ "30 <= temperatures[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If the temperature is say, 70 today, then in the future a warmer temperature must be either 71, 72, 73, ..., 99, or 100. We could remember when all of them occur next." ] }, { "question_id": 740, "task_id": "delete-and-earn", "drop": [], "similar": [ "house-robber" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 115, "kept": 114, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If you take a number, you might as well take them all. Keep track of what the value is of the subset of the input with maximum M when you either take or don't take M." ] }, { "question_id": 741, "task_id": "cherry-pickup", "drop": [], "similar": [ "minimum-path-sum", "dungeon-game", "maximum-path-quality-of-a-graph", "paths-in-matrix-whose-sum-is-divisible-by-k" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 77, "kept": 76, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 68, "end_line": 68, "violates": [ "n == grid[i].length" ] } ], "unchecked_constraints": [ "grid[i][j] is -1, 0, or 1." ], "public_tests": 2, "hints": [] }, { "question_id": 742, "task_id": "closest-leaf-in-a-binary-tree", "drop": [ "premium" ] }, { "question_id": 743, "task_id": "network-delay-time", "drop": [], "similar": [ "the-time-when-the-network-becomes-idle", "second-minimum-time-to-reach-destination" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "times", "n", "k" ], "tests": { "total": 100, "kept": 100, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= ui, vi <= n", "ui != vi", "0 <= wi <= 100", "All the pairs (ui, vi) are unique. (i.e., no multiple edges.)" ], "public_tests": 3, "hints": [ "We visit each node at some time, and if that time is better than the fastest time we've reached this node, we travel along outgoing edges in sorted order. Alternatively, we could use Dijkstra's algorithm." ] }, { "question_id": 744, "task_id": "find-smallest-letter-greater-than-target", "drop": [], "similar": [ "count-elements-with-strictly-smaller-and-greater-elements" ], "flags": [], "comparison": "exact", "parameter_names": [ "letters", "target" ], "tests": { "total": 93, "kept": 77, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 24, "end_line": 24, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 31, "end_line": 31, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 41, "end_line": 41, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 55, "end_line": 55, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 57, "end_line": 57, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 61, "end_line": 61, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 63, "end_line": 63, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 79, "end_line": 79, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 83, "end_line": 83, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 88, "end_line": 88, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 89, "end_line": 89, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 90, "end_line": 90, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 91, "end_line": 91, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 92, "end_line": 92, "violates": [ "letters is sorted in non-decreasing order." ] }, { "line": 94, "end_line": 94, "violates": [ "letters is sorted in non-decreasing order." ] } ], "unchecked_constraints": [ "letters[i] is a lowercase English letter.", "letters contains at least two different characters.", "target is a lowercase English letter." ], "public_tests": 3, "hints": [ "Try to find whether each of 26 next letters are in the given string array." ] }, { "question_id": 746, "task_id": "min-cost-climbing-stairs", "drop": [], "similar": [ "climbing-stairs", "find-number-of-ways-to-reach-the-k-th-stair" ], "flags": [], "comparison": "exact", "parameter_names": [ "cost" ], "tests": { "total": 102, "kept": 97, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 47, "end_line": 47, "violates": [ "0 <= cost[i] <= 999" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= cost[i] <= 999" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= cost[i] <= 999" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= cost[i] <= 999" ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= cost[i] <= 999" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Build an array dp where dp[i] is the minimum cost to climb to the top starting from the ith staircase.", "Assuming we have n staircase labeled from 0 to n - 1 and assuming the top is n, then dp[n] = 0, marking that if you are at the top, the cost is 0.", "Now, looping from n - 1 to 0, the dp[i] = cost[i] + min(dp[i + 1], dp[i + 2]). The answer will be the minimum of dp[0] and dp[1]" ] }, { "question_id": 747, "task_id": "largest-number-at-least-twice-of-others", "drop": [], "similar": [ "keep-multiplying-found-values-by-two", "largest-number-after-digit-swaps-by-parity" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 142, "kept": 129, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 37, "end_line": 37, "violates": [ "2 <= nums.length <= 50" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "2 <= nums.length <= 50" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 108, "end_line": 108, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 110, "end_line": 110, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 111, "end_line": 111, "violates": [ "0 <= nums[i] <= 100", "0 <= nums[i] <= 100" ] }, { "line": 118, "end_line": 118, "violates": [ "2 <= nums.length <= 50" ] }, { "line": 126, "end_line": 126, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 135, "end_line": 135, "violates": [ "0 <= nums[i] <= 100", "0 <= nums[i] <= 100" ] }, { "line": 139, "end_line": 139, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 141, "end_line": 141, "violates": [ "0 <= nums[i] <= 100" ] } ], "unchecked_constraints": [ "The largest element in nums is unique." ], "public_tests": 2, "hints": [ "Scan through the array to find the unique largest element `m`, keeping track of it's index `maxIndex`. Scan through the array again. If we find some `x != m` with `m < 2*x`, we should return `-1`. Otherwise, we should return `maxIndex`." ] }, { "question_id": 748, "task_id": "shortest-completing-word", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "licensePlate", "words" ], "tests": { "total": 85, "kept": 28, "dropped": { "constraint_violation": 57 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= licensePlate.length <= 7", "licensePlate contains digits, letters (uppercase or lowercase), or space ' '." ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= words[i].length <= 15" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= licensePlate.length <= 7", "1 <= words[i].length <= 15" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= licensePlate.length <= 7", "1 <= words[i].length <= 15" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= licensePlate.length <= 7", "licensePlate contains digits, letters (uppercase or lowercase), or space ' '." ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= licensePlate.length <= 7", "1 <= words[i].length <= 15" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= licensePlate.length <= 7", "licensePlate contains digits, letters (uppercase or lowercase), or space ' '." ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= licensePlate.length <= 7", "licensePlate contains digits, letters (uppercase or lowercase), or space ' '." ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= licensePlate.length <= 7", "licensePlate contains digits, letters (uppercase or lowercase), or space ' '." ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= licensePlate.length <= 7", "licensePlate contains digits, letters (uppercase or lowercase), or space ' '." ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= words[i].length <= 15" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= licensePlate.length <= 7" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= licensePlate.length <= 7" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Count only the letters (possibly converted to lowercase) of each word. If a word is shorter and the count of each letter is at least the count of that letter in the licensePlate, it is the best answer we've seen yet." ] }, { "question_id": 749, "task_id": "contain-virus", "drop": [], "similar": [ "count-the-number-of-infection-sequences" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "isInfected" ], "tests": { "total": 58, "kept": 57, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= m, n <= 50" ] } ], "unchecked_constraints": [ "There is always a contiguous viral region throughout the described process that will infect strictly more uncontaminated squares in the next round." ], "public_tests": 3, "hints": [ "The implementation is long - we want to perfrom the following steps: * Find all viral regions (connected components), additionally for each region keeping track of the frontier (neighboring uncontaminated cells), and the perimeter of the region. * Disinfect the most viral region, adding it's perimeter to the answer. * Spread the virus in the remaining regions outward by 1 square." ] }, { "question_id": 750, "task_id": "number-of-corner-rectangles", "drop": [ "premium" ] }, { "question_id": 751, "task_id": "ip-to-cidr", "drop": [ "premium" ] }, { "question_id": 752, "task_id": "open-the-lock", "drop": [], "similar": [ "reachable-nodes-with-restrictions" ], "flags": [], "comparison": "exact", "parameter_names": [ "deadends", "target" ], "tests": { "total": 110, "kept": 108, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= deadends.length <= 500" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= deadends.length <= 500" ] } ], "unchecked_constraints": [ "target will not be in the list deadends." ], "public_tests": 3, "hints": [ "We can think of this problem as a shortest path problem on a graph: there are `10000` nodes (strings `'0000'` to `'9999'`), and there is an edge between two nodes if they differ in one digit, that digit differs by 1 (wrapping around, so `'0'` and `'9'` differ by 1), and if *both* nodes are not in `deadends`." ] }, { "question_id": 753, "task_id": "cracking-the-safe", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 19, "kept": 19, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We can think of this problem as the problem of finding an Euler path (a path visiting every edge exactly once) on the following graph: there are k^{n-1} nodes with each node having k edges. It turns out this graph always has an Eulerian circuit (path starting where it ends.) We should visit each node in \"post-order\" so as to not get stuck in the graph prematurely." ] }, { "question_id": 754, "task_id": "reach-a-number", "drop": [], "similar": [ "number-of-ways-to-reach-a-position-after-exactly-k-steps" ], "flags": [], "comparison": "exact", "parameter_names": [ "target" ], "tests": { "total": 70, "kept": 69, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "-10**(9) <= target <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 755, "task_id": "pour-water", "drop": [ "premium" ] }, { "question_id": 756, "task_id": "pyramid-transition-matrix", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "bottom", "allowed" ], "tests": { "total": 73, "kept": 47, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "All the values of allowed are unique." ] }, { "line": 19, "end_line": 19, "violates": [ "2 <= bottom.length <= 6", "All the values of allowed are unique." ] }, { "line": 21, "end_line": 21, "violates": [ "All the values of allowed are unique." ] }, { "line": 23, "end_line": 23, "violates": [ "2 <= bottom.length <= 6", "All the values of allowed are unique." ] }, { "line": 24, "end_line": 24, "violates": [ "2 <= bottom.length <= 6" ] }, { "line": 27, "end_line": 27, "violates": [ "All the values of allowed are unique." ] }, { "line": 31, "end_line": 31, "violates": [ "All the values of allowed are unique." ] }, { "line": 33, "end_line": 33, "violates": [ "All the values of allowed are unique." ] }, { "line": 38, "end_line": 38, "violates": [ "All the values of allowed are unique." ] }, { "line": 40, "end_line": 40, "violates": [ "2 <= bottom.length <= 6", "All the values of allowed are unique." ] }, { "line": 41, "end_line": 41, "violates": [ "2 <= bottom.length <= 6", "All the values of allowed are unique." ] }, { "line": 42, "end_line": 42, "violates": [ "All the values of allowed are unique." ] }, { "line": 47, "end_line": 47, "violates": [ "All the values of allowed are unique." ] }, { "line": 49, "end_line": 49, "violates": [ "All the values of allowed are unique." ] }, { "line": 50, "end_line": 50, "violates": [ "All the values of allowed are unique." ] }, { "line": 55, "end_line": 55, "violates": [ "All the values of allowed are unique." ] }, { "line": 59, "end_line": 59, "violates": [ "All the values of allowed are unique." ] }, { "line": 60, "end_line": 60, "violates": [ "All the values of allowed are unique." ] }, { "line": 62, "end_line": 62, "violates": [ "All the values of allowed are unique." ] }, { "line": 64, "end_line": 64, "violates": [ "All the values of allowed are unique." ] }, { "line": 65, "end_line": 65, "violates": [ "All the values of allowed are unique." ] }, { "line": 66, "end_line": 66, "violates": [ "All the values of allowed are unique." ] }, { "line": 67, "end_line": 67, "violates": [ "All the values of allowed are unique." ] }, { "line": 68, "end_line": 68, "violates": [ "All the values of allowed are unique." ] }, { "line": 70, "end_line": 70, "violates": [ "All the values of allowed are unique." ] }, { "line": 72, "end_line": 72, "violates": [ "All the values of allowed are unique." ] } ], "unchecked_constraints": [ "The letters in all input strings are from the set {'A', 'B', 'C', 'D', 'E', 'F'}." ], "public_tests": 2, "hints": [] }, { "question_id": 757, "task_id": "set-intersection-size-at-least-two", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "intervals" ], "tests": { "total": 90, "kept": 84, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "0 <= starti < endi <= 10**(8)" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= starti < endi <= 10**(8)" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= starti < endi <= 10**(8)" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= starti < endi <= 10**(8)", "0 <= starti < endi <= 10**(8)" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= starti < endi <= 10**(8)" ] }, { "line": 73, "end_line": 73, "violates": [ "0 <= starti < endi <= 10**(8)", "0 <= starti < endi <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 758, "task_id": "bold-words-in-string", "drop": [ "premium" ] }, { "question_id": 760, "task_id": "find-anagram-mappings", "drop": [ "premium" ] }, { "question_id": 761, "task_id": "special-binary-string", "drop": [], "similar": [ "valid-parenthesis-string", "number-of-good-binary-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 127, "kept": 127, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s is a special binary string." ], "public_tests": 2, "hints": [ "Draw a line from (x, y) to (x+1, y+1) if we see a \"1\", else to (x+1, y-1). A special substring is just a line that starts and ends at the same y-coordinate, and that is the lowest y-coordinate reached. Call a mountain a special substring with no special prefixes - ie. only at the beginning and end is the lowest y-coordinate reached. If F is the answer function, and S has mountain decomposition M1,M2,M3,...,Mk, then the answer is: reverse_sorted(F(M1), F(M2), ..., F(Mk)). However, you'll also need to deal with the case that S is a mountain, such as 11011000 -> 11100100." ] }, { "question_id": 762, "task_id": "prime-number-of-set-bits-in-binary-representation", "drop": [], "similar": [ "number-of-1-bits" ], "flags": [], "comparison": "exact", "parameter_names": [ "left", "right" ], "tests": { "total": 79, "kept": 73, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= left <= right <= 10**(6)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= left <= right <= 10**(6)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= left <= right <= 10**(6)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= left <= right <= 10**(6)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= left <= right <= 10**(6)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= left <= right <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Write a helper function to count the number of set bits in a number, then check whether the number of set bits is 2, 3, 5, 7, 11, 13, 17 or 19." ] }, { "question_id": 763, "task_id": "partition-labels", "drop": [], "similar": [ "merge-intervals", "optimal-partition-of-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 64, "kept": 64, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to greedily choose the smallest partition that includes the first letter. If you have something like \"abaccbdeffed\", then you might need to add b. You can use an map like \"last['b'] = 5\" to help you expand the width of your partition." ] }, { "question_id": 764, "task_id": "largest-plus-sign", "drop": [], "similar": [ "maximal-square" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "mines" ], "tests": { "total": 91, "kept": 88, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= mines.length <= 5000" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= mines.length <= 5000" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= mines.length <= 5000" ] } ], "unchecked_constraints": [ "All the pairs (xi, yi) are unique." ], "public_tests": 2, "hints": [ "For each direction such as \"left\", find left[r][c] = the number of 1s you will see before a zero starting at r, c and walking left. You can find this in N^2 time with a dp. The largest plus sign at r, c is just the minimum of left[r][c], up[r][c] etc." ] }, { "question_id": 765, "task_id": "couples-holding-hands", "drop": [], "similar": [ "first-missing-positive", "missing-number", "k-similar-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "row" ], "tests": { "total": 81, "kept": 79, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "All the elements of row are unique." ] }, { "line": 74, "end_line": 74, "violates": [ "All the elements of row are unique." ] } ], "unchecked_constraints": [ "2n == row.length", "2 <= n <= 30\u200b\u200b\u200b\u200b\u200b\u200b\u200b", "0 <= row[i] < 2n" ], "public_tests": 2, "hints": [ "Say there are N two-seat couches. For each couple, draw an edge from the couch of one partner to the couch of the other partner." ] }, { "question_id": 766, "task_id": "toeplitz-matrix", "drop": [], "similar": [ "valid-word-square" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 84, "kept": 84, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Check whether each value is equal to the value of it's top-left neighbor." ] }, { "question_id": 767, "task_id": "reorganize-string", "drop": [], "similar": [ "rearrange-string-k-distance-apart", "task-scheduler", "longest-happy-string" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 56, "kept": 56, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Alternate placing the most common letters." ] }, { "question_id": 768, "task_id": "max-chunks-to-make-sorted-ii", "drop": [], "similar": [ "max-chunks-to-make-sorted" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 149, "kept": 148, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 131, "end_line": 131, "violates": [ "0 <= arr[i] <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Each k for which some permutation of arr[:k] is equal to sorted(arr)[:k] is where we should cut each chunk." ] }, { "question_id": 769, "task_id": "max-chunks-to-make-sorted", "drop": [], "similar": [ "max-chunks-to-make-sorted-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 127, "kept": 124, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 58, "end_line": 58, "violates": [ "0 <= arr[i] < n" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= n <= 10" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= n <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The first chunk can be found as the smallest k for which A[:k+1] == [0, 1, 2, ...k]; then we repeat this process." ] }, { "question_id": 770, "task_id": "basic-calculator-iv", "drop": [], "similar": [ "parse-lisp-expression", "basic-calculator-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "expression", "evalvars", "evalints" ], "tests": { "total": 126, "kept": 122, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "expression consists of lowercase English letters, digits, '+', '-', '*', '(', ')', ' '." ] }, { "line": 10, "end_line": 10, "violates": [ "expression consists of lowercase English letters, digits, '+', '-', '*', '(', ')', ' '." ] }, { "line": 18, "end_line": 18, "violates": [ "expression consists of lowercase English letters, digits, '+', '-', '*', '(', ')', ' '." ] }, { "line": 44, "end_line": 44, "violates": [ "expression consists of lowercase English letters, digits, '+', '-', '*', '(', ')', ' '." ] } ], "unchecked_constraints": [ "expression does not contain any leading or trailing spaces.", "All the tokens in expression are separated by a single space." ], "public_tests": 3, "hints": [ "One way is with a Polynomial class. For example, * `Poly:add(this, that)` returns the result of `this + that`. * `Poly:sub(this, that)` returns the result of `this - that`. * `Poly:mul(this, that)` returns the result of `this * that`. * `Poly:evaluate(this, evalmap)` returns the polynomial after replacing all free variables with constants as specified by `evalmap`. * `Poly:toList(this)` returns the polynomial in the correct output format. * `Solution::combine(left, right, symbol)` returns the result of applying the binary operator represented by `symbol` to `left` and `right`. * `Solution::make(expr)` makes a new `Poly` represented by either the constant or free variable specified by `expr`. * `Solution::parse(expr)` parses an expression into a new `Poly`." ] }, { "question_id": 771, "task_id": "jewels-and-stones", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "jewels", "stones" ], "tests": { "total": 103, "kept": 86, "dropped": { "constraint_violation": 17 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= jewels.length, stones.length <= 50" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= jewels.length, stones.length <= 50" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= jewels.length, stones.length <= 50" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= jewels.length, stones.length <= 50" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= jewels.length, stones.length <= 50" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= jewels.length, stones.length <= 50" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= jewels.length, stones.length <= 50" ] }, { "line": 36, "end_line": 36, "violates": [ "jewels and stones consist of only English letters." ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= jewels.length, stones.length <= 50" ] }, { "line": 54, "end_line": 54, "violates": [ "jewels and stones consist of only English letters." ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= jewels.length, stones.length <= 50" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= jewels.length, stones.length <= 50" ] }, { "line": 86, "end_line": 86, "violates": [ "jewels and stones consist of only English letters." ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= jewels.length, stones.length <= 50" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= jewels.length, stones.length <= 50" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= jewels.length, stones.length <= 50" ] }, { "line": 104, "end_line": 104, "violates": [ "jewels and stones consist of only English letters." ] } ], "unchecked_constraints": [ "All the characters of jewels are unique." ], "public_tests": 2, "hints": [ "For each stone, check if it is a jewel." ] }, { "question_id": 772, "task_id": "basic-calculator-iii", "drop": [ "premium" ] }, { "question_id": 773, "task_id": "sliding-puzzle", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board" ], "tests": { "total": 78, "kept": 78, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Each value board[i][j] is unique." ], "public_tests": 3, "hints": [ "Perform a breadth-first-search, where the nodes are the puzzle boards and edges are if two puzzle boards can be transformed into one another with one move." ] }, { "question_id": 774, "task_id": "minimize-max-distance-to-gas-station", "drop": [ "premium" ] }, { "question_id": 775, "task_id": "global-and-local-inversions", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 109, "kept": 107, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "0 <= nums[i] < n" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= nums[i] < n" ] } ], "unchecked_constraints": [ "nums is a permutation of all the numbers in the range [0, n - 1]." ], "public_tests": 2, "hints": [ "Where can the 0 be placed in an ideal permutation? What about the 1?" ] }, { "question_id": 777, "task_id": "swap-adjacent-in-lr-string", "drop": [], "similar": [ "move-pieces-to-obtain-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "start", "result" ], "tests": { "total": 257, "kept": 247, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 51, "end_line": 51, "violates": [ "start.length == result.length" ] }, { "line": 70, "end_line": 70, "violates": [ "start.length == result.length" ] }, { "line": 71, "end_line": 71, "violates": [ "start.length == result.length" ] }, { "line": 100, "end_line": 100, "violates": [ "start.length == result.length" ] }, { "line": 108, "end_line": 108, "violates": [ "start.length == result.length" ] }, { "line": 122, "end_line": 122, "violates": [ "start.length == result.length" ] }, { "line": 129, "end_line": 129, "violates": [ "start.length == result.length" ] }, { "line": 142, "end_line": 142, "violates": [ "start.length == result.length" ] }, { "line": 183, "end_line": 183, "violates": [ "start.length == result.length" ] }, { "line": 245, "end_line": 245, "violates": [ "start.length == result.length" ] } ], "unchecked_constraints": [ "Both start and result will only consist of characters in 'L', 'R', and 'X'." ], "public_tests": 2, "hints": [ "Think of the L and R's as people on a horizontal line, where X is a space. The people can't cross each other, and also you can't go from XRX to RXX." ] }, { "question_id": 778, "task_id": "swim-in-rising-water", "drop": [], "similar": [ "path-with-minimum-effort" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 33, "kept": 33, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Each value grid[i][j] is unique." ], "public_tests": 2, "hints": [ "Use either Dijkstra's, or binary search for the best time T for which you can reach the end if you only step on squares at most T." ] }, { "question_id": 779, "task_id": "k-th-symbol-in-grammar", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 86, "kept": 50, "dropped": { "constraint_violation": 36 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 4, "end_line": 4, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= k <= 2**(n - 1)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= k <= 2**(n - 1)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try to represent the current (N, K) in terms of some (N-1, prevK). What is prevK ?" ] }, { "question_id": 780, "task_id": "reaching-points", "drop": [], "similar": [ "number-of-ways-to-reach-a-position-after-exactly-k-steps", "check-if-point-is-reachable", "determine-if-a-cell-is-reachable-at-a-given-time" ], "flags": [], "comparison": "exact", "parameter_names": [ "sx", "sy", "tx", "ty" ], "tests": { "total": 101, "kept": 101, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 781, "task_id": "rabbits-in-forest", "drop": [], "similar": [ "group-the-people-given-the-group-size-they-belong-to" ], "flags": [], "comparison": "exact", "parameter_names": [ "answers" ], "tests": { "total": 66, "kept": 66, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 782, "task_id": "transform-to-chessboard", "drop": [], "similar": [ "minimum-moves-to-get-a-peaceful-board" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board" ], "tests": { "total": 75, "kept": 75, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 783, "task_id": "minimum-distance-between-bst-nodes", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-inorder-traversal" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 94, "kept": 0, "dropped": { "unreadable": 94 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [2, 100].", "0 <= Node.val <= 10**(5)" ] }, { "question_id": 784, "task_id": "letter-case-permutation", "drop": [], "similar": [ "subsets", "brace-expansion" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "s" ], "tests": { "total": 111, "kept": 99, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= s.length <= 12" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= s.length <= 12" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= s.length <= 12" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= s.length <= 12" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= s.length <= 12" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= s.length <= 12" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= s.length <= 12" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= s.length <= 12" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= s.length <= 12" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= s.length <= 12" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= s.length <= 12" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= s.length <= 12" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 785, "task_id": "is-graph-bipartite", "drop": [], "similar": [ "divide-nodes-into-the-maximum-number-of-groups" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "graph" ], "tests": { "total": 103, "kept": 100, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 47, "end_line": 47, "violates": [ "0 <= graph[u].length < n", "0 <= graph[u][i] <= n - 1" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= graph[u][i] <= n - 1" ] }, { "line": 85, "end_line": 85, "violates": [ "0 <= graph[u].length < n", "0 <= graph[u][i] <= n - 1" ] } ], "unchecked_constraints": [ "graph[u] does not contain u.", "All the values of graph[u] are unique.", "If graph[u] contains v, then graph[v] contains u." ], "public_tests": 2, "hints": [] }, { "question_id": 786, "task_id": "k-th-smallest-prime-fraction", "drop": [], "similar": [ "kth-smallest-element-in-a-sorted-matrix", "kth-smallest-number-in-multiplication-table", "find-k-th-smallest-pair-distance" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "k" ], "tests": { "total": 51, "kept": 51, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "arr[i] is a prime number for i > 0.", "All the numbers of arr are unique and sorted in strictly increasing order." ], "public_tests": 2, "hints": [] }, { "question_id": 787, "task_id": "cheapest-flights-within-k-stops", "drop": [], "similar": [ "maximum-vacation-days", "minimum-cost-to-reach-city-with-discounts" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "flights", "src", "dst", "k" ], "tests": { "total": 94, "kept": 91, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 80, "end_line": 80, "violates": [ "0 <= flights.length <= (n * (n - 1) / 2)" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= flights.length <= (n * (n - 1) / 2)" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= src, dst, k < n" ] } ], "unchecked_constraints": [ "There will not be any multiple flights between two cities." ], "public_tests": 3, "hints": [] }, { "question_id": 788, "task_id": "rotated-digits", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 55, "kept": 55, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 789, "task_id": "escape-the-ghosts", "drop": [], "similar": [ "cat-and-mouse-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "ghosts", "target" ], "tests": { "total": 138, "kept": 138, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There can be multiple ghosts in the same location.", "-10**(4) <= xtarget, ytarget <= 10**(4)" ], "public_tests": 3, "hints": [] }, { "question_id": 790, "task_id": "domino-and-tromino-tiling", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 30, "kept": 30, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 791, "task_id": "custom-sort-string", "drop": [], "similar": [ "sort-the-students-by-their-kth-score" ], "flags": [], "comparison": "exact", "parameter_names": [ "order", "s" ], "tests": { "total": 117, "kept": 112, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= order.length <= 26" ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= s.length <= 200" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= order.length <= 26" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= s.length <= 200" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= order.length <= 26" ] } ], "unchecked_constraints": [ "All the characters of order are unique." ], "public_tests": 2, "hints": [] }, { "question_id": 792, "task_id": "number-of-matching-subsequences", "drop": [], "similar": [ "is-subsequence", "shortest-way-to-form-string", "count-vowel-substrings-of-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "words" ], "tests": { "total": 56, "kept": 55, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "1 <= words[i].length <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 793, "task_id": "preimage-size-of-factorial-zeroes-function", "drop": [], "similar": [ "factorial-trailing-zeroes" ], "flags": [], "comparison": "exact", "parameter_names": [ "k" ], "tests": { "total": 104, "kept": 102, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 74, "end_line": 74, "violates": [ "0 <= k <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 794, "task_id": "valid-tic-tac-toe-state", "drop": [], "similar": [ "design-tic-tac-toe" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board" ], "tests": { "total": 91, "kept": 90, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "board[i].length == 3" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 795, "task_id": "number-of-subarrays-with-bounded-maximum", "drop": [], "similar": [ "count-subarrays-with-median-k", "find-the-number-of-subarrays-where-boundary-elements-are-maximum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "left", "right" ], "tests": { "total": 101, "kept": 100, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 72, "end_line": 72, "violates": [ "0 <= left <= right <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 796, "task_id": "rotate-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "goal" ], "tests": { "total": 113, "kept": 111, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 46, "end_line": 46, "violates": [ "s and goal consist of lowercase English letters." ] }, { "line": 102, "end_line": 102, "violates": [ "s and goal consist of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 797, "task_id": "all-paths-from-source-to-target", "drop": [], "similar": [ "number-of-ways-to-arrive-at-destination", "number-of-increasing-paths-in-a-grid" ], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "graph" ], "tests": { "total": 72, "kept": 72, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "graph[i][j] != i (i.e., there will be no self-loops).", "The input graph is guaranteed to be a DAG.", "0 <= graph[i][j] < n", "All the elements of graph[i] are unique." ], "public_tests": 2, "hints": [] }, { "question_id": 798, "task_id": "smallest-rotation-with-highest-score", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 94, "kept": 83, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 16, "end_line": 16, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 18, "end_line": 18, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= nums[i] < nums.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 799, "task_id": "champagne-tower", "drop": [], "similar": [ "number-of-ways-to-build-house-of-cards" ], "flags": [ "figure_reference", "decimal_answer", "has_images" ], "comparison": "float", "parameter_names": [ "poured", "query_row", "query_glass" ], "tests": { "total": 183, "kept": 183, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 800, "task_id": "similar-rgb-color", "drop": [ "premium" ] }, { "question_id": 801, "task_id": "minimum-swaps-to-make-sequences-increasing", "drop": [], "similar": [ "minimum-operations-to-make-the-array-k-increasing", "minimum-operations-to-maximize-last-elements-in-arrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 107, "kept": 107, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 802, "task_id": "find-eventual-safe-states", "drop": [], "similar": [ "build-a-matrix-with-conditions" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "graph" ], "tests": { "total": 81, "kept": 67, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "0 <= graph[i][j] <= n - 1" ] }, { "line": 20, "end_line": 20, "violates": [ "0 <= graph[i][j] <= n - 1" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= graph[i][j] <= n - 1" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= graph[i].length <= n", "0 <= graph[i][j] <= n - 1" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= graph[i][j] <= n - 1" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= graph[i][j] <= n - 1" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= graph[i][j] <= n - 1" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= graph[i][j] <= n - 1" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= graph[i][j] <= n - 1" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= graph[i][j] <= n - 1" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= graph[i][j] <= n - 1" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= graph[i][j] <= n - 1" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= graph[i].length <= n", "0 <= graph[i][j] <= n - 1" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= graph[i][j] <= n - 1" ] } ], "unchecked_constraints": [ "graph[i] is sorted in a strictly increasing order.", "The graph may contain self-loops.", "The number of edges in the graph will be in the range [1, 4 * 10**(4)]." ], "public_tests": 2, "hints": [] }, { "question_id": 803, "task_id": "bricks-falling-when-hit", "drop": [], "similar": [ "last-day-where-you-can-still-cross", "number-of-ways-to-build-sturdy-brick-wall" ], "flags": [], "comparison": "exact", "parameter_names": [ "grid", "hits" ], "tests": { "total": 155, "kept": 155, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "grid[i][j] is 0 or 1.", "0 <= xi <= m - 1", "0 <= yi <= n - 1", "All (xi, yi) are unique." ], "public_tests": 2, "hints": [] }, { "question_id": 804, "task_id": "unique-morse-code-words", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 82, "kept": 57, "dropped": { "constraint_violation": 25 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= words[i].length <= 12" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= words[i].length <= 12" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 805, "task_id": "split-array-with-same-average", "drop": [], "similar": [ "partition-array-into-two-arrays-to-minimize-sum-difference", "minimum-average-difference" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 100, "kept": 95, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "0 <= nums[i] <= 10**(4)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums.length <= 30" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums.length <= 30" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= nums[i] <= 10**(4)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums.length <= 30", "0 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 806, "task_id": "number-of-lines-to-write-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "widths", "s" ], "tests": { "total": 46, "kept": 16, "dropped": { "constraint_violation": 30 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 3, "end_line": 3, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 5, "end_line": 5, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 6, "end_line": 6, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 7, "end_line": 7, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 9, "end_line": 9, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 10, "end_line": 10, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 11, "end_line": 11, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 13, "end_line": 13, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 15, "end_line": 15, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 17, "end_line": 17, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 19, "end_line": 19, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 21, "end_line": 21, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 25, "end_line": 25, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 27, "end_line": 27, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 28, "end_line": 28, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 29, "end_line": 29, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 30, "end_line": 30, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 32, "end_line": 32, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 33, "end_line": 33, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 34, "end_line": 34, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 36, "end_line": 36, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 38, "end_line": 38, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 39, "end_line": 39, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 40, "end_line": 40, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 42, "end_line": 42, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 43, "end_line": 43, "violates": [ "2 <= widths[i] <= 10" ] }, { "line": 46, "end_line": 46, "violates": [ "2 <= widths[i] <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 807, "task_id": "max-increase-to-keep-city-skyline", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 69, "kept": 68, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "n == grid[r].length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 808, "task_id": "soup-servings", "drop": [], "similar": [], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "n" ], "tests": { "total": 55, "kept": 52, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 18, "end_line": 18, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For large n, the answer approaches a constant value.", "Which soup is more likely to deplete first if we are allowed to perform many operations without bias?" ] }, { "question_id": 809, "task_id": "expressive-words", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "words" ], "tests": { "total": 71, "kept": 70, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 53, "end_line": 53, "violates": [ "1 <= s.length, words.length <= 100", "1 <= words[i].length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 810, "task_id": "chalkboard-xor-game", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 122, "kept": 116, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "0 <= nums[i] < 2**(16)", "0 <= nums[i] < 2**(16)" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= nums[i] < 2**(16)" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= nums[i] < 2**(16)" ] }, { "line": 97, "end_line": 97, "violates": [ "0 <= nums[i] < 2**(16)", "0 <= nums[i] < 2**(16)" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= nums[i] < 2**(16)" ] }, { "line": 107, "end_line": 107, "violates": [ "0 <= nums[i] < 2**(16)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 811, "task_id": "subdomain-visit-count", "drop": [], "similar": [], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "cpdomains" ], "tests": { "total": 68, "kept": 68, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= cpdomain.length <= 100", "1 <= cpdomain[i].length <= 100", "cpdomain[i] follows either the \"repi d1i.d2i.d3i\" format or the \"repi d1i.d2i\" format.", "repi is an integer in the range [1, 10**(4)].", "d1i, d2i, and d3i consist of lowercase English letters." ], "public_tests": 2, "hints": [] }, { "question_id": 812, "task_id": "largest-triangle-area", "drop": [], "similar": [ "largest-perimeter-triangle" ], "flags": [ "figure_reference", "decimal_answer", "has_images" ], "comparison": "float", "parameter_names": [ "points" ], "tests": { "total": 113, "kept": 108, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "-50 <= xi, yi <= 50" ] }, { "line": 50, "end_line": 50, "violates": [ "-50 <= xi, yi <= 50" ] }, { "line": 61, "end_line": 61, "violates": [ "-50 <= xi, yi <= 50" ] }, { "line": 68, "end_line": 68, "violates": [ "-50 <= xi, yi <= 50" ] }, { "line": 77, "end_line": 77, "violates": [ "-50 <= xi, yi <= 50" ] } ], "unchecked_constraints": [ "All the given points are unique." ], "public_tests": 2, "hints": [] }, { "question_id": 813, "task_id": "largest-sum-of-averages", "drop": [], "similar": [], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "nums", "k" ], "tests": { "total": 102, "kept": 100, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 814, "task_id": "binary-tree-pruning", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 5, "kept": 0, "dropped": { "unreadable": 5 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 200].", "Node.val is either 0 or 1." ] }, { "question_id": 815, "task_id": "bus-routes", "drop": [], "similar": [ "minimum-costs-using-the-train-line" ], "flags": [], "comparison": "exact", "parameter_names": [ "routes", "source", "target" ], "tests": { "total": 77, "kept": 77, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "sum(routes[i].length) <= 10**(5)" ], "public_tests": 2, "hints": [] }, { "question_id": 816, "task_id": "ambiguous-coordinates", "drop": [], "similar": [], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "s" ], "tests": { "total": 93, "kept": 78, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "4 <= s.length <= 12" ] }, { "line": 28, "end_line": 28, "violates": [ "4 <= s.length <= 12" ] }, { "line": 29, "end_line": 29, "violates": [ "4 <= s.length <= 12" ] }, { "line": 39, "end_line": 39, "violates": [ "4 <= s.length <= 12" ] }, { "line": 46, "end_line": 46, "violates": [ "4 <= s.length <= 12" ] }, { "line": 53, "end_line": 53, "violates": [ "4 <= s.length <= 12" ] }, { "line": 58, "end_line": 58, "violates": [ "4 <= s.length <= 12" ] }, { "line": 59, "end_line": 59, "violates": [ "4 <= s.length <= 12" ] }, { "line": 64, "end_line": 64, "violates": [ "4 <= s.length <= 12" ] }, { "line": 66, "end_line": 66, "violates": [ "4 <= s.length <= 12" ] }, { "line": 68, "end_line": 68, "violates": [ "4 <= s.length <= 12" ] }, { "line": 77, "end_line": 77, "violates": [ "4 <= s.length <= 12" ] }, { "line": 78, "end_line": 78, "violates": [ "4 <= s.length <= 12" ] }, { "line": 80, "end_line": 80, "violates": [ "4 <= s.length <= 12" ] }, { "line": 92, "end_line": 92, "violates": [ "4 <= s.length <= 12" ] } ], "unchecked_constraints": [ "The rest of s are digits." ], "public_tests": 3, "hints": [] }, { "question_id": 817, "task_id": "linked-list-components", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "merge-nodes-in-between-zeros" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head", "nums" ], "tests": { "total": 106, "kept": 0, "dropped": { "unreadable": 106 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 105, "end_line": 105, "unreadable": true }, { "line": 106, "end_line": 106, "unreadable": true }, { "line": 107, "end_line": 107, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the linked list is n.", "1 <= n <= 10**(4)", "0 <= Node.val < n", "All the values Node.val are unique.", "1 <= nums.length <= n", "0 <= nums[i] < n" ] }, { "question_id": 818, "task_id": "race-car", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "target" ], "tests": { "total": 49, "kept": 44, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "1 <= target <= 10**(4)" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= target <= 10**(4)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= target <= 10**(4)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= target <= 10**(4)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= target <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 820, "task_id": "short-encoding-of-words", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 116, "kept": 80, "dropped": { "constraint_violation": 36 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= words[i].length <= 7" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= words[i].length <= 7" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 821, "task_id": "shortest-distance-to-a-character", "drop": [], "similar": [ "check-distances-between-same-letters" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "c" ], "tests": { "total": 118, "kept": 118, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s[i] and c are lowercase English letters.", "It is guaranteed that c occurs at least once in s." ], "public_tests": 2, "hints": [] }, { "question_id": 822, "task_id": "card-flipping-game", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "fronts", "backs" ], "tests": { "total": 107, "kept": 107, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 823, "task_id": "binary-trees-with-factors", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 105, "kept": 98, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "2 <= arr[i] <= 10**(9)" ] }, { "line": 27, "end_line": 27, "violates": [ "2 <= arr[i] <= 10**(9)" ] }, { "line": 35, "end_line": 35, "violates": [ "2 <= arr[i] <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "2 <= arr[i] <= 10**(9)" ] }, { "line": 65, "end_line": 65, "violates": [ "2 <= arr[i] <= 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "2 <= arr[i] <= 10**(9)" ] }, { "line": 91, "end_line": 91, "violates": [ "2 <= arr[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 824, "task_id": "goat-latin", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "sentence" ], "tests": { "total": 135, "kept": 135, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "sentence has no leading or trailing spaces.", "All the words in sentence are separated by a single space." ], "public_tests": 2, "hints": [] }, { "question_id": 825, "task_id": "friends-of-appropriate-ages", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "ages" ], "tests": { "total": 102, "kept": 102, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 826, "task_id": "most-profit-assigning-work", "drop": [], "similar": [ "maximum-number-of-tasks-you-can-assign", "successful-pairs-of-spells-and-potions", "maximum-matching-of-players-with-trainers" ], "flags": [], "comparison": "exact", "parameter_names": [ "difficulty", "profit", "worker" ], "tests": { "total": 106, "kept": 105, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= difficulty[i], profit[i], worker[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 827, "task_id": "making-a-large-island", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 81, "kept": 80, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "n == grid[i].length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 828, "task_id": "count-unique-characters-of-all-substrings-of-a-given-string", "drop": [], "similar": [ "total-appeal-of-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 160, "kept": 157, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 42, "end_line": 42, "violates": [ "1 <= s.length <= 10**(5)" ] }, { "line": 79, "end_line": 79, "violates": [ "s consists of uppercase English letters only." ] }, { "line": 88, "end_line": 88, "violates": [ "s consists of uppercase English letters only." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 829, "task_id": "consecutive-numbers-sum", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 53, "kept": 52, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 830, "task_id": "positions-of-large-groups", "drop": [], "similar": [ "divide-a-string-into-groups-of-size-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 54, "kept": 53, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 55, "end_line": 55, "violates": [ "s contains lowercase English letters only." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 831, "task_id": "masking-personal-information", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 187, "kept": 187, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s is either a valid email or a phone number.", "If s is an email: 8 <= s.length <= 40", "s consists of uppercase and lowercase English letters and exactly one '@' symbol and '.' symbol." ], "public_tests": 3, "hints": [] }, { "question_id": 832, "task_id": "flipping-an-image", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "image" ], "tests": { "total": 61, "kept": 53, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "n == image[i].length" ] }, { "line": 10, "end_line": 10, "violates": [ "n == image[i].length" ] }, { "line": 17, "end_line": 17, "violates": [ "n == image[i].length" ] }, { "line": 32, "end_line": 32, "violates": [ "n == image[i].length" ] }, { "line": 36, "end_line": 36, "violates": [ "n == image[i].length" ] }, { "line": 40, "end_line": 40, "violates": [ "n == image[i].length" ] }, { "line": 41, "end_line": 41, "violates": [ "n == image[i].length" ] }, { "line": 60, "end_line": 60, "violates": [ "n == image[i].length" ] } ], "unchecked_constraints": [ "images[i][j] is either 0 or 1." ], "public_tests": 2, "hints": [] }, { "question_id": 833, "task_id": "find-and-replace-in-string", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "s", "indices", "sources", "targets" ], "tests": { "total": 96, "kept": 26, "dropped": { "constraint_violation": 70 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 9, "end_line": 9, "violates": [ "k == indices.length == sources.length == targets.length", "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 10, "end_line": 10, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 11, "end_line": 11, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 13, "end_line": 13, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 14, "end_line": 14, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 15, "end_line": 15, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 16, "end_line": 16, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 17, "end_line": 17, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 18, "end_line": 18, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 20, "end_line": 20, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 21, "end_line": 21, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 23, "end_line": 23, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 24, "end_line": 24, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 25, "end_line": 25, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 26, "end_line": 26, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 27, "end_line": 27, "violates": [ "k == indices.length == sources.length == targets.length", "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 29, "end_line": 29, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 30, "end_line": 30, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 31, "end_line": 31, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 32, "end_line": 32, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 33, "end_line": 33, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 34, "end_line": 34, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 35, "end_line": 35, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 37, "end_line": 37, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 38, "end_line": 38, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 39, "end_line": 39, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 40, "end_line": 40, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 41, "end_line": 41, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 42, "end_line": 42, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 43, "end_line": 43, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 45, "end_line": 45, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 46, "end_line": 46, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 48, "end_line": 48, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 49, "end_line": 49, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 52, "end_line": 52, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 53, "end_line": 53, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 54, "end_line": 54, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 55, "end_line": 55, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 56, "end_line": 56, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 57, "end_line": 57, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 59, "end_line": 59, "violates": [ "s consists of only lowercase English letters." ] }, { "line": 60, "end_line": 60, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 63, "end_line": 63, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 64, "end_line": 64, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 66, "end_line": 66, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 67, "end_line": 67, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 68, "end_line": 68, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 69, "end_line": 69, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 70, "end_line": 70, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 71, "end_line": 71, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 73, "end_line": 73, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 74, "end_line": 74, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 75, "end_line": 75, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 76, "end_line": 76, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 77, "end_line": 77, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 78, "end_line": 78, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 81, "end_line": 81, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 83, "end_line": 83, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 85, "end_line": 85, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 86, "end_line": 86, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 87, "end_line": 87, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 88, "end_line": 88, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 89, "end_line": 89, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 90, "end_line": 90, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 92, "end_line": 92, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 94, "end_line": 94, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 95, "end_line": 95, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 96, "end_line": 96, "violates": [ "k == indices.length == sources.length == targets.length", "sources[i] and targets[i] consist of only lowercase English letters." ] }, { "line": 97, "end_line": 97, "violates": [ "sources[i] and targets[i] consist of only lowercase English letters." ] } ], "unchecked_constraints": [ "0 <= indexes[i] < s.length" ], "public_tests": 2, "hints": [] }, { "question_id": 834, "task_id": "sum-of-distances-in-tree", "drop": [], "similar": [ "distribute-coins-in-binary-tree", "count-nodes-with-the-highest-score", "collect-coins-in-a-tree", "maximum-score-after-applying-operations-on-a-tree", "count-pairs-of-connectable-servers-in-a-weighted-tree-network", "time-taken-to-mark-all-nodes" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 40, "kept": 40, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The given input represents a valid tree." ], "public_tests": 3, "hints": [] }, { "question_id": 835, "task_id": "image-overlap", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "img1", "img2" ], "tests": { "total": 75, "kept": 75, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 836, "task_id": "rectangle-overlap", "drop": [], "similar": [ "rectangle-area" ], "flags": [], "comparison": "exact", "parameter_names": [ "rec1", "rec2" ], "tests": { "total": 122, "kept": 119, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 66, "end_line": 66, "violates": [ "-10**(9) <= rec1[i], rec2[i] <= 10**(9)" ] }, { "line": 95, "end_line": 95, "violates": [ "-10**(9) <= rec1[i], rec2[i] <= 10**(9)", "-10**(9) <= rec1[i], rec2[i] <= 10**(9)" ] }, { "line": 111, "end_line": 111, "violates": [ "-10**(9) <= rec1[i], rec2[i] <= 10**(9)", "-10**(9) <= rec1[i], rec2[i] <= 10**(9)" ] } ], "unchecked_constraints": [ "rec1 and rec2 represent a valid rectangle with a non-zero area." ], "public_tests": 3, "hints": [] }, { "question_id": 837, "task_id": "new-21-game", "drop": [], "similar": [], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "n", "k", "maxPts" ], "tests": { "total": 63, "kept": 63, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 838, "task_id": "push-dominoes", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "dominoes" ], "tests": { "total": 162, "kept": 162, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 839, "task_id": "similar-string-groups", "drop": [], "similar": [ "groups-of-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "strs" ], "tests": { "total": 57, "kept": 57, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All words in strs have the same length and are anagrams of each other." ], "public_tests": 2, "hints": [] }, { "question_id": 840, "task_id": "magic-squares-in-grid", "drop": [], "similar": [ "largest-magic-square" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 82, "kept": 73, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "0 <= grid[i][j] <= 15" ] }, { "line": 8, "end_line": 8, "violates": [ "0 <= grid[i][j] <= 15" ] }, { "line": 10, "end_line": 10, "violates": [ "0 <= grid[i][j] <= 15" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= grid[i][j] <= 15" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= row, col <= 10" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= grid[i][j] <= 15" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= row, col <= 10" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= row, col <= 10" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= row, col <= 10", "0 <= grid[i][j] <= 15" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 841, "task_id": "keys-and-rooms", "drop": [], "similar": [ "graph-valid-tree" ], "flags": [], "comparison": "exact", "parameter_names": [ "rooms" ], "tests": { "total": 86, "kept": 67, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 5, "end_line": 5, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 8, "end_line": 8, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 10, "end_line": 10, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 13, "end_line": 13, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 15, "end_line": 15, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 17, "end_line": 17, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 26, "end_line": 26, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 33, "end_line": 33, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 38, "end_line": 38, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 41, "end_line": 41, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 49, "end_line": 49, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 50, "end_line": 50, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 57, "end_line": 57, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 63, "end_line": 63, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 78, "end_line": 78, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 80, "end_line": 80, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 81, "end_line": 81, "violates": [ "All the values of rooms[i] are unique." ] }, { "line": 84, "end_line": 84, "violates": [ "All the values of rooms[i] are unique." ] } ], "unchecked_constraints": [ "1 <= sum(rooms[i].length) <= 3000" ], "public_tests": 2, "hints": [] }, { "question_id": 842, "task_id": "split-array-into-fibonacci-sequence", "drop": [], "similar": [ "additive-number", "fibonacci-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 78, "kept": 76, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= num.length <= 200" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= num.length <= 200" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 844, "task_id": "backspace-string-compare", "drop": [], "similar": [ "crawler-log-folder", "removing-stars-from-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 109, "kept": 92, "dropped": { "constraint_violation": 17 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= s.length, t.length <= 200" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= s.length, t.length <= 200" ] } ], "unchecked_constraints": [ "s and t only contain lowercase letters and '#' characters." ], "public_tests": 3, "hints": [] }, { "question_id": 845, "task_id": "longest-mountain-in-array", "drop": [], "similar": [ "minimum-number-of-removals-to-make-mountain-array", "find-good-days-to-rob-the-bank" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 160, "kept": 159, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "0 <= arr[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 846, "task_id": "hand-of-straights", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "hand", "groupSize" ], "tests": { "total": 81, "kept": 81, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 847, "task_id": "shortest-path-visiting-all-nodes", "drop": [], "similar": [ "find-the-minimum-cost-array-permutation" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "graph" ], "tests": { "total": 63, "kept": 53, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= n <= 12" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= n <= 12" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= n <= 12" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= n <= 12" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= n <= 12" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= n <= 12" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= n <= 12" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= n <= 12" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= n <= 12" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= n <= 12" ] } ], "unchecked_constraints": [ "graph[i] does not contain i.", "If graph[a] contains b, then graph[b] contains a.", "The input graph is always connected." ], "public_tests": 2, "hints": [] }, { "question_id": 848, "task_id": "shifting-letters", "drop": [], "similar": [ "replace-all-digits-with-characters", "shifting-letters-ii", "lexicographically-smallest-string-after-substring-operation", "shift-distance-between-two-strings", "find-the-k-th-character-in-string-game-i", "find-the-k-th-character-in-string-game-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "shifts" ], "tests": { "total": 88, "kept": 78, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "shifts.length == s.length" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= shifts[i] <= 10**(9)" ] }, { "line": 37, "end_line": 37, "violates": [ "shifts.length == s.length" ] }, { "line": 38, "end_line": 38, "violates": [ "shifts.length == s.length" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= shifts[i] <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= shifts[i] <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "shifts.length == s.length" ] }, { "line": 59, "end_line": 59, "violates": [ "shifts.length == s.length" ] }, { "line": 84, "end_line": 84, "violates": [ "shifts.length == s.length" ] }, { "line": 85, "end_line": 85, "violates": [ "shifts.length == s.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3304 find-the-k-th-character-in-string-game-i", "3307 find-the-k-th-character-in-string-game-ii", "3361 shift-distance-between-two-strings" ] }, { "question_id": 849, "task_id": "maximize-distance-to-closest-person", "drop": [], "similar": [ "exam-room", "task-scheduler-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "seats" ], "tests": { "total": 120, "kept": 120, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "seats[i] is 0 or 1.", "At least one seat is empty.", "At least one seat is occupied." ], "public_tests": 3, "hints": [] }, { "question_id": 850, "task_id": "rectangle-area-ii", "drop": [], "similar": [ "separate-squares-ii" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "rectangles" ], "tests": { "total": 105, "kept": 104, "dropped": { "int_overflow": 1 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "unrepresentable_in": [ "cpp", "rust", "java" ] } ], "unchecked_constraints": [ "rectanges[i].length == 4", "0 <= xi1, yi1, xi2, yi2 <= 10**(9)", "xi1 <= xi2", "yi1 <= yi2", "All rectangles have non zero area." ], "public_tests": 2, "hints": [], "similar_to_test": [ "3454 separate-squares-ii" ] }, { "question_id": 851, "task_id": "loud-and-rich", "drop": [], "similar": [ "build-a-matrix-with-conditions" ], "flags": [], "comparison": "exact", "parameter_names": [ "richer", "quiet" ], "tests": { "total": 100, "kept": 80, "dropped": { "constraint_violation": 20 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 7, "end_line": 7, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 13, "end_line": 13, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 14, "end_line": 14, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 16, "end_line": 16, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 20, "end_line": 20, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 46, "end_line": 46, "violates": [ "ai != bi" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 73, "end_line": 73, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 89, "end_line": 89, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= quiet[i] < n" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= quiet[i] < n" ] } ], "unchecked_constraints": [ "All the pairs of richer are unique.", "The observations in richer are all logically consistent." ], "public_tests": 2, "hints": [] }, { "question_id": 852, "task_id": "peak-index-in-a-mountain-array", "drop": [], "similar": [ "find-peak-element", "find-in-mountain-array", "minimum-number-of-removals-to-make-mountain-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 87, "kept": 82, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "0 <= arr[i] <= 10**(6)" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= arr[i] <= 10**(6)" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= arr[i] <= 10**(6)" ] }, { "line": 81, "end_line": 81, "violates": [ "0 <= arr[i] <= 10**(6)" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= arr[i] <= 10**(6)" ] } ], "unchecked_constraints": [ "arr is guaranteed to be a mountain array." ], "public_tests": 3, "hints": [] }, { "question_id": 853, "task_id": "car-fleet", "drop": [], "similar": [ "car-fleet-ii", "count-collisions-on-a-road" ], "flags": [], "comparison": "exact", "parameter_names": [ "target", "position", "speed" ], "tests": { "total": 124, "kept": 122, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 56, "end_line": 56, "violates": [ "n == position.length == speed.length" ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= position[i] < target" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 854, "task_id": "k-similar-strings", "drop": [], "similar": [ "couples-holding-hands" ], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "s2" ], "tests": { "total": 47, "kept": 47, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s2 is an anagram of s1." ], "public_tests": 2, "hints": [] }, { "question_id": 856, "task_id": "score-of-parentheses", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 55, "kept": 55, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s is a balanced parentheses string." ], "public_tests": 3, "hints": [] }, { "question_id": 857, "task_id": "minimum-cost-to-hire-k-workers", "drop": [], "similar": [ "maximum-subsequence-score" ], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "quality", "wage", "k" ], "tests": { "total": 104, "kept": 104, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 858, "task_id": "mirror-reflection", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "p", "q" ], "tests": { "total": 84, "kept": 84, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 859, "task_id": "buddy-strings", "drop": [], "similar": [ "determine-if-two-strings-are-close", "check-if-one-string-swap-can-make-strings-equal", "make-number-of-distinct-characters-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "goal" ], "tests": { "total": 126, "kept": 126, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 860, "task_id": "lemonade-change", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "bills" ], "tests": { "total": 106, "kept": 106, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 861, "task_id": "score-after-flipping-matrix", "drop": [], "similar": [ "remove-all-ones-with-row-and-column-flips" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 80, "kept": 80, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 862, "task_id": "shortest-subarray-with-sum-at-least-k", "drop": [], "similar": [ "shortest-subarray-with-or-at-least-k-ii", "shortest-subarray-with-or-at-least-k-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 127, "kept": 123, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "-10**(5) <= nums[i] <= 10**(5)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 61, "end_line": 61, "violates": [ "-10**(5) <= nums[i] <= 10**(5)", "1 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 864, "task_id": "shortest-path-to-get-all-keys", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 60, "kept": 48, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "n == grid[i].length" ] }, { "line": 17, "end_line": 17, "violates": [ "n == grid[i].length" ] }, { "line": 18, "end_line": 18, "violates": [ "n == grid[i].length" ] }, { "line": 19, "end_line": 19, "violates": [ "n == grid[i].length" ] }, { "line": 20, "end_line": 20, "violates": [ "n == grid[i].length" ] }, { "line": 21, "end_line": 21, "violates": [ "n == grid[i].length" ] }, { "line": 31, "end_line": 31, "violates": [ "n == grid[i].length" ] }, { "line": 32, "end_line": 32, "violates": [ "n == grid[i].length" ] }, { "line": 35, "end_line": 35, "violates": [ "n == grid[i].length" ] }, { "line": 38, "end_line": 38, "violates": [ "n == grid[i].length" ] }, { "line": 55, "end_line": 55, "violates": [ "n == grid[i].length" ] }, { "line": 61, "end_line": 61, "violates": [ "n == grid[i].length" ] } ], "unchecked_constraints": [ "grid[i][j] is either an English letter, '.', '#', or '@'.", "There is exactly one '@' in the grid.", "The number of keys in the grid is in the range [1, 6].", "Each key in the grid is unique.", "Each key in the grid has a matching lock." ], "public_tests": 3, "hints": [] }, { "question_id": 865, "task_id": "smallest-subtree-with-all-the-deepest-nodes", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the tree will be in the range [1, 500].", "0 <= Node.val <= 500", "The values of the nodes in the tree are unique." ] }, { "question_id": 866, "task_id": "prime-palindrome", "drop": [], "similar": [ "sum-of-k-mirror-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 52, "kept": 44, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= n <= 10**(8)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= n <= 10**(8)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= n <= 10**(8)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= n <= 10**(8)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= n <= 10**(8)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= n <= 10**(8)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= n <= 10**(8)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= n <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 867, "task_id": "transpose-matrix", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 74, "kept": 74, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We don't need any special algorithms to do this. You just need to know what the transpose of a matrix looks like. Rows become columns and vice versa!" ] }, { "question_id": 868, "task_id": "binary-gap", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 65, "kept": 49, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 869, "task_id": "reordered-power-of-2", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 87, "kept": 79, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 34, "end_line": 34, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 870, "task_id": "advantage-shuffle", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 100, "kept": 99, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 85, "end_line": 85, "violates": [ "nums2.length == nums1.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 871, "task_id": "minimum-number-of-refueling-stops", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "target", "startFuel", "stations" ], "tests": { "total": 96, "kept": 92, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= positioni < positioni+1 < target" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= positioni < positioni+1 < target" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= positioni < positioni+1 < target" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= positioni < positioni+1 < target" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 872, "task_id": "leaf-similar-trees", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root1", "root2" ], "tests": { "total": 88, "kept": 0, "dropped": { "unreadable": 88 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in each tree will be in the range [1, 200].", "Both of the given trees will have values in the range [0, 200]." ] }, { "question_id": 873, "task_id": "length-of-longest-fibonacci-subsequence", "drop": [], "similar": [ "fibonacci-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 122, "kept": 121, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 107, "end_line": 107, "violates": [ "1 <= arr[i] < arr[i + 1] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use dynamic programming here?", "Consider a sequence ending at index iarr[i], which can be done in linear time per element." ] }, { "question_id": 874, "task_id": "walking-robot-simulation", "drop": [], "similar": [ "walking-robot-simulation-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "commands", "obstacles" ], "tests": { "total": 114, "kept": 114, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "commands[i] is either -2, -1, or an integer in the range [1, 9].", "-3 * 10**(4) <= xi, yi <= 3 * 10**(4)", "The answer is guaranteed to be less than 2**(31)." ], "public_tests": 3, "hints": [] }, { "question_id": 875, "task_id": "koko-eating-bananas", "drop": [], "similar": [ "minimize-max-distance-to-gas-station", "maximum-candies-allocated-to-k-children", "minimized-maximum-of-products-distributed-to-any-store", "frog-jump-ii", "minimum-time-to-repair-cars" ], "flags": [], "comparison": "exact", "parameter_names": [ "piles", "h" ], "tests": { "total": 124, "kept": 100, "dropped": { "constraint_violation": 24 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 6, "end_line": 6, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 17, "end_line": 17, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 38, "end_line": 38, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 65, "end_line": 65, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 68, "end_line": 68, "violates": [ "piles.length <= h <= 10**(9)", "piles.length <= h <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "piles.length <= h <= 10**(9)", "piles.length <= h <= 10**(9)" ] }, { "line": 73, "end_line": 73, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 82, "end_line": 82, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 90, "end_line": 90, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 101, "end_line": 101, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 102, "end_line": 102, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 103, "end_line": 103, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 107, "end_line": 107, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 109, "end_line": 109, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 110, "end_line": 110, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 113, "end_line": 113, "violates": [ "piles.length <= h <= 10**(9)", "piles.length <= h <= 10**(9)" ] }, { "line": 115, "end_line": 115, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 117, "end_line": 117, "violates": [ "piles.length <= h <= 10**(9)", "piles.length <= h <= 10**(9)" ] }, { "line": 119, "end_line": 119, "violates": [ "piles.length <= h <= 10**(9)" ] }, { "line": 124, "end_line": 124, "violates": [ "piles.length <= h <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 876, "task_id": "middle-of-the-linked-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "delete-the-middle-node-of-a-linked-list", "maximum-twin-sum-of-a-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the list is in the range [1, 100].", "1 <= Node.val <= 100" ] }, { "question_id": 877, "task_id": "stone-game", "drop": [], "similar": [ "stone-game-v", "stone-game-vi", "stone-game-vii", "stone-game-viii", "stone-game-ix", "strictly-palindromic-number", "visit-array-positions-to-maximize-score" ], "flags": [], "comparison": "exact", "parameter_names": [ "piles" ], "tests": { "total": 119, "kept": 106, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= piles[i] <= 500", "1 <= piles[i] <= 500" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= piles[i] <= 500" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= piles[i] <= 500" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= piles[i] <= 500" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= piles[i] <= 500" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= piles[i] <= 500" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= piles[i] <= 500" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= piles[i] <= 500" ] }, { "line": 91, "end_line": 91, "violates": [ "piles.length is even.", "1 <= piles[i] <= 500" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= piles[i] <= 500", "1 <= piles[i] <= 500" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= piles[i] <= 500" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= piles[i] <= 500" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= piles[i] <= 500" ] } ], "unchecked_constraints": [ "sum(piles[i]) is odd." ], "public_tests": 2, "hints": [] }, { "question_id": 878, "task_id": "nth-magical-number", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "a", "b" ], "tests": { "total": 104, "kept": 81, "dropped": { "constraint_violation": 23 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 15, "end_line": 15, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 20, "end_line": 20, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 28, "end_line": 28, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 35, "end_line": 35, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 39, "end_line": 39, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 44, "end_line": 44, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 49, "end_line": 49, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 54, "end_line": 54, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 56, "end_line": 56, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 58, "end_line": 58, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 72, "end_line": 72, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 76, "end_line": 76, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 79, "end_line": 79, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 80, "end_line": 80, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 82, "end_line": 82, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 83, "end_line": 83, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 86, "end_line": 86, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 87, "end_line": 87, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 89, "end_line": 89, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 90, "end_line": 90, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 98, "end_line": 98, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] }, { "line": 102, "end_line": 102, "violates": [ "2 <= a, b <= 4 * 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 879, "task_id": "profitable-schemes", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "minProfit", "group", "profit" ], "tests": { "total": 117, "kept": 113, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 54, "end_line": 54, "violates": [ "1 <= group.length <= 100", "profit.length == group.length" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= group.length <= 100", "profit.length == group.length" ] }, { "line": 87, "end_line": 87, "violates": [ "profit.length == group.length" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= n <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 880, "task_id": "decoded-string-at-index", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 101, "kept": 101, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s starts with a letter.", "It is guaranteed that k is less than or equal to the length of the decoded string.", "The decoded string is guaranteed to have less than 2**(63) letters." ], "public_tests": 3, "hints": [] }, { "question_id": 881, "task_id": "boats-to-save-people", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "people", "limit" ], "tests": { "total": 89, "kept": 89, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 882, "task_id": "reachable-nodes-in-subdivided-graph", "drop": [], "similar": [ "find-all-people-with-secret", "paths-in-maze-that-lead-to-same-room" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "edges", "maxMoves", "n" ], "tests": { "total": 103, "kept": 72, "dropped": { "constraint_violation": 31 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "0 <= ui < vi < n" ] }, { "line": 16, "end_line": 16, "violates": [ "0 <= ui < vi < n" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= ui < vi < n" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= ui < vi < n" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= ui < vi < n" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= ui < vi < n" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= ui < vi < n" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= ui < vi < n" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= ui < vi < n" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= ui < vi < n" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= ui < vi < n" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= ui < vi < n" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= ui < vi < n" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= ui < vi < n" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= ui < vi < n" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= ui < vi < n" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= ui < vi < n" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= ui < vi < n" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= ui < vi < n" ] }, { "line": 73, "end_line": 73, "violates": [ "0 <= ui < vi < n" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= ui < vi < n" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= ui < vi < n" ] }, { "line": 81, "end_line": 81, "violates": [ "0 <= ui < vi < n" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= ui < vi < n" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= ui < vi < n" ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= ui < vi < n" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= ui < vi < n" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= ui < vi < n" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= ui < vi < n" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= ui < vi < n" ] }, { "line": 104, "end_line": 104, "violates": [ "0 <= ui < vi < n" ] } ], "unchecked_constraints": [ "There are no multiple edges in the graph." ], "public_tests": 3, "hints": [] }, { "question_id": 883, "task_id": "projection-area-of-3d-shapes", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 72, "kept": 72, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 884, "task_id": "uncommon-words-from-two-sentences", "drop": [], "similar": [ "count-common-words-with-one-occurrence" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "s1", "s2" ], "tests": { "total": 130, "kept": 121, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "s1 and s2 consist of lowercase English letters and spaces." ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= s1.length, s2.length <= 200" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= s1.length, s2.length <= 200" ] }, { "line": 83, "end_line": 83, "violates": [ "s1 and s2 consist of lowercase English letters and spaces." ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= s1.length, s2.length <= 200" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= s1.length, s2.length <= 200" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= s1.length, s2.length <= 200" ] }, { "line": 129, "end_line": 129, "violates": [ "1 <= s1.length, s2.length <= 200" ] }, { "line": 130, "end_line": 130, "violates": [ "1 <= s1.length, s2.length <= 200" ] } ], "unchecked_constraints": [ "s1 and s2 do not have leading or trailing spaces.", "All the words in s1 and s2 are separated by a single space." ], "public_tests": 2, "hints": [] }, { "question_id": 885, "task_id": "spiral-matrix-iii", "drop": [], "similar": [ "spiral-matrix", "spiral-matrix-ii", "spiral-matrix-iv" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "rows", "cols", "rStart", "cStart" ], "tests": { "total": 74, "kept": 74, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 886, "task_id": "possible-bipartition", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "dislikes" ], "tests": { "total": 76, "kept": 31, "dropped": { "constraint_violation": 45 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= ai < bi <= n" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= ai < bi <= n" ] } ], "unchecked_constraints": [ "All the pairs of dislikes are unique." ], "public_tests": 2, "hints": [] }, { "question_id": 887, "task_id": "super-egg-drop", "drop": [], "similar": [ "egg-drop-with-2-eggs-and-n-floors" ], "flags": [], "comparison": "exact", "parameter_names": [ "k", "n" ], "tests": { "total": 92, "kept": 92, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 888, "task_id": "fair-candy-swap", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "aliceSizes", "bobSizes" ], "tests": { "total": 93, "kept": 91, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= aliceSizes[i], bobSizes[j] <= 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= aliceSizes[i], bobSizes[j] <= 10**(5)" ] } ], "unchecked_constraints": [ "Alice and Bob have a different total number of candies.", "There will be at least one valid answer for the given input." ], "public_tests": 3, "hints": [] }, { "question_id": 889, "task_id": "construct-binary-tree-from-preorder-and-postorder-traversal", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "multiple_answers", "has_images" ], "comparison": "exact", "parameter_names": [ "preorder", "postorder" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "It is guaranteed that preorder and postorder are the preorder traversal and postorder traversal of the same binary tree." ] }, { "question_id": 890, "task_id": "find-and-replace-pattern", "drop": [], "similar": [ "isomorphic-strings", "word-pattern" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "words", "pattern" ], "tests": { "total": 118, "kept": 105, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "words[i].length == pattern.length" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= pattern.length <= 20", "words[i].length == pattern.length" ] }, { "line": 26, "end_line": 26, "violates": [ "words[i].length == pattern.length" ] }, { "line": 47, "end_line": 47, "violates": [ "words[i].length == pattern.length" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= pattern.length <= 20", "words[i].length == pattern.length" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= pattern.length <= 20", "words[i].length == pattern.length" ] }, { "line": 88, "end_line": 88, "violates": [ "words[i].length == pattern.length" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= pattern.length <= 20", "words[i].length == pattern.length" ] }, { "line": 99, "end_line": 99, "violates": [ "words[i].length == pattern.length" ] }, { "line": 103, "end_line": 103, "violates": [ "words[i].length == pattern.length" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= pattern.length <= 20", "words[i].length == pattern.length" ] }, { "line": 109, "end_line": 109, "violates": [ "words[i].length == pattern.length" ] }, { "line": 112, "end_line": 112, "violates": [ "words[i].length == pattern.length" ] } ], "unchecked_constraints": [ "pattern and words[i] are lowercase English letters." ], "public_tests": 2, "hints": [] }, { "question_id": 891, "task_id": "sum-of-subsequence-widths", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 86, "kept": 84, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 892, "task_id": "surface-area-of-3d-shapes", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 78, "kept": 73, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 21, "end_line": 21, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 32, "end_line": 32, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 63, "end_line": 63, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= grid[i][j] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 893, "task_id": "groups-of-special-equivalent-strings", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 81, "kept": 81, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All the strings are of the same length." ], "public_tests": 2, "hints": [] }, { "question_id": 896, "task_id": "monotonic-array", "drop": [], "similar": [ "count-hills-and-valleys-in-an-array", "find-the-count-of-monotonic-pairs-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 151, "kept": 151, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [], "similar_to_test": [ "3250 find-the-count-of-monotonic-pairs-i" ] }, { "question_id": 897, "task_id": "increasing-order-search-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the given tree will be in the range [1, 100].", "0 <= Node.val <= 1000" ] }, { "question_id": 898, "task_id": "bitwise-ors-of-subarrays", "drop": [], "similar": [ "longest-nice-subarray", "smallest-subarrays-with-maximum-bitwise-or", "bitwise-or-of-all-subsequence-sums", "find-the-maximum-sequence-value-of-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 93, "kept": 91, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 62, "end_line": 62, "violates": [ "0 <= arr[i] <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= arr[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Consider the the subarrays that end at index i. The number of unique bitwise OR for these subarrays is limited." ], "similar_to_test": [ "3287 find-the-maximum-sequence-value-of-array" ] }, { "question_id": 899, "task_id": "orderly-queue", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 118, "kept": 116, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= k <= s.length <= 1000" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= k <= s.length <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 902, "task_id": "numbers-at-most-n-given-digit-set", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "digits", "n" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "digits[i] is a digit from '1' to '9'." ], "public_tests": 3, "hints": [] }, { "question_id": 903, "task_id": "valid-permutations-for-di-sequence", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 247, "kept": 247, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 904, "task_id": "fruit-into-baskets", "drop": [], "similar": [ "longest-nice-subarray", "fruits-into-baskets-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "fruits" ], "tests": { "total": 98, "kept": 92, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "0 <= fruits[i] < fruits.length" ] }, { "line": 7, "end_line": 7, "violates": [ "0 <= fruits[i] < fruits.length" ] }, { "line": 9, "end_line": 9, "violates": [ "0 <= fruits[i] < fruits.length" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= fruits[i] < fruits.length" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= fruits[i] < fruits.length" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= fruits[i] < fruits.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [], "similar_to_test": [ "3477 fruits-into-baskets-ii" ] }, { "question_id": 905, "task_id": "sort-array-by-parity", "drop": [], "similar": [ "sort-array-by-parity-ii", "sort-even-and-odd-indices-independently", "largest-number-after-digit-swaps-by-parity" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 98, "kept": 91, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 40, "end_line": 40, "violates": [ "0 <= nums[i] <= 5000" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= nums[i] <= 5000" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= nums[i] <= 5000" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= nums[i] <= 5000" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= nums[i] <= 5000" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= nums[i] <= 5000" ] }, { "line": 96, "end_line": 96, "violates": [ "0 <= nums[i] <= 5000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 906, "task_id": "super-palindromes", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "left", "right" ], "tests": { "total": 86, "kept": 65, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= left.length, right.length <= 18" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= left.length, right.length <= 18" ] } ], "unchecked_constraints": [ "left and right cannot have leading zeros.", "left and right represent integers in the range [1, 10**(18) - 1].", "left is less than or equal to right." ], "public_tests": 2, "hints": [] }, { "question_id": 907, "task_id": "sum-of-subarray-minimums", "drop": [], "similar": [ "sum-of-subarray-ranges", "sum-of-total-strength-of-wizards" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 93, "kept": 85, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= arr[i] <= 3 * 10**(4)", "1 <= arr[i] <= 3 * 10**(4)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= arr[i] <= 3 * 10**(4)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= arr[i] <= 3 * 10**(4)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= arr[i] <= 3 * 10**(4)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= arr[i] <= 3 * 10**(4)", "1 <= arr[i] <= 3 * 10**(4)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= arr[i] <= 3 * 10**(4)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= arr[i] <= 3 * 10**(4)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= arr[i] <= 3 * 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 908, "task_id": "smallest-range-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 126, "kept": 121, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "0 <= nums[i] <= 10**(4)" ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= nums[i] <= 10**(4)", "0 <= k <= 10**(4)" ] }, { "line": 106, "end_line": 106, "violates": [ "0 <= nums[i] <= 10**(4)" ] }, { "line": 116, "end_line": 116, "violates": [ "0 <= nums[i] <= 10**(4)", "0 <= k <= 10**(4)" ] }, { "line": 117, "end_line": 117, "violates": [ "0 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 909, "task_id": "snakes-and-ladders", "drop": [], "similar": [ "most-profitable-path-in-a-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board" ], "tests": { "total": 72, "kept": 72, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "board[i][j] is either -1 or in the range [1, n**(2)].", "The squares labeled 1 and n**(2) are not the starting points of any snake or ladder." ], "public_tests": 2, "hints": [] }, { "question_id": 910, "task_id": "smallest-range-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 107, "kept": 105, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 40, "end_line": 40, "violates": [ "0 <= nums[i] <= 10**(4)" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 912, "task_id": "sort-an-array", "drop": [ "too_few_tests" ], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 5, "kept": 5, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 913, "task_id": "cat-and-mouse", "drop": [], "similar": [ "cat-and-mouse-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "graph" ], "tests": { "total": 63, "kept": 61, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 34, "end_line": 34, "violates": [ "3 <= graph.length <= 50" ] }, { "line": 37, "end_line": 37, "violates": [ "3 <= graph.length <= 50" ] } ], "unchecked_constraints": [ "graph[i] is unique.", "The mouse and the cat can always move." ], "public_tests": 2, "hints": [] }, { "question_id": 914, "task_id": "x-of-a-kind-in-a-deck-of-cards", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "deck" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 915, "task_id": "partition-array-into-disjoint-intervals", "drop": [], "similar": [ "sum-of-beauty-in-the-array", "optimal-partition-of-string", "minimum-index-of-a-valid-split", "maximum-strength-of-k-disjoint-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 95, "kept": 94, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "0 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [ "There is at least one valid answer for the given input." ], "public_tests": 2, "hints": [] }, { "question_id": 916, "task_id": "word-subsets", "drop": [], "similar": [], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "words1", "words2" ], "tests": { "total": 69, "kept": 35, "dropped": { "constraint_violation": 34 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= words1[i].length, words2[i].length <= 10", "All the strings of words1 are unique." ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= words1[i].length, words2[i].length <= 10", "All the strings of words1 are unique." ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= words1[i].length, words2[i].length <= 10", "All the strings of words1 are unique." ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= words1[i].length, words2[i].length <= 10", "words1[i] and words2[i] consist only of lowercase English letters." ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] }, { "line": 67, "end_line": 67, "violates": [ "All the strings of words1 are unique." ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= words1[i].length, words2[i].length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 917, "task_id": "reverse-only-letters", "drop": [], "similar": [ "faulty-keyboard", "reverse-letters-then-special-characters-in-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 98, "kept": 97, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 95, "end_line": 95, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [ "s consists of characters with ASCII values in the range [33, 122].", "s does not contain '\\\"' or '\\\\'." ], "public_tests": 3, "hints": [ "This problem is exactly like reversing a normal string except that there are certain characters that we have to simply skip. That should be easy enough to do if you know how to reverse a string using the two-pointer approach." ] }, { "question_id": 918, "task_id": "maximum-sum-circular-subarray", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 117, "kept": 117, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For those of you who are familiar with the Kadane's algorithm, think in terms of that. For the newbies, Kadane's algorithm is used to finding the maximum sum subarray from a given array. This problem is a twist on that idea and it is advisable to read up on that algorithm first before starting this problem. Unless you already have a great algorithm brewing up in your mind in which case, go right ahead!", "What is an alternate way of representing a circular array so that it appears to be a straight array? Essentially, there are two cases of this problem that we need to take care of. Let's look at the figure below to understand those two cases:", "The first case can be handled by the good old Kadane's algorithm. However, is there a smarter way of going about handling the second case as well?" ] }, { "question_id": 920, "task_id": "number-of-music-playlists", "drop": [], "similar": [ "count-the-number-of-good-subsequences" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "goal", "k" ], "tests": { "total": 88, "kept": 88, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 921, "task_id": "minimum-add-to-make-parentheses-valid", "drop": [], "similar": [ "minimum-number-of-swaps-to-make-the-string-balanced" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 115, "kept": 114, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= s.length <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 922, "task_id": "sort-array-by-parity-ii", "drop": [], "similar": [ "sort-array-by-parity", "rearrange-array-elements-by-sign", "sort-even-and-odd-indices-independently", "largest-number-after-digit-swaps-by-parity", "find-the-number-of-k-even-arrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 81, "kept": 80, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 73, "end_line": 73, "violates": [ "nums.length is even." ] } ], "unchecked_constraints": [ "Half of the integers in nums are even." ], "public_tests": 2, "hints": [], "similar_to_test": [ "3339 find-the-number-of-k-even-arrays" ] }, { "question_id": 923, "task_id": "3sum-with-multiplicity", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "target" ], "tests": { "total": 87, "kept": 85, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "0 <= arr[i] <= 100" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= arr[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 924, "task_id": "minimize-malware-spread", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "graph", "initial" ], "tests": { "total": 69, "kept": 69, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "graph[i][j] is 0 or 1." ], "public_tests": 3, "hints": [] }, { "question_id": 925, "task_id": "long-pressed-name", "drop": [], "similar": [ "maximum-matching-of-players-with-trainers" ], "flags": [], "comparison": "exact", "parameter_names": [ "name", "typed" ], "tests": { "total": 140, "kept": 139, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 103, "end_line": 103, "violates": [ "1 <= name.length, typed.length <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 926, "task_id": "flip-string-to-monotone-increasing", "drop": [], "similar": [ "minimum-cost-to-make-all-characters-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 143, "kept": 143, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 927, "task_id": "three-equal-parts", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "arr[i] is 0 or 1" ], "public_tests": 3, "hints": [] }, { "question_id": 928, "task_id": "minimize-malware-spread-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "graph", "initial" ], "tests": { "total": 74, "kept": 72, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= initial.length < n" ] }, { "line": 14, "end_line": 14, "violates": [ "graph[i][j] == graph[j][i]" ] } ], "unchecked_constraints": [ "graph[i][j] is 0 or 1." ], "public_tests": 3, "hints": [] }, { "question_id": 929, "task_id": "unique-email-addresses", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "emails" ], "tests": { "total": 104, "kept": 91, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "emails[i] consist of lowercase English letters, '+', '.' and '@'." ] }, { "line": 13, "end_line": 13, "violates": [ "emails[i] consist of lowercase English letters, '+', '.' and '@'." ] }, { "line": 28, "end_line": 28, "violates": [ "emails[i] consist of lowercase English letters, '+', '.' and '@'." ] }, { "line": 40, "end_line": 40, "violates": [ "emails[i] consist of lowercase English letters, '+', '.' and '@'." ] }, { "line": 44, "end_line": 44, "violates": [ "emails[i] consist of lowercase English letters, '+', '.' and '@'." ] }, { "line": 54, "end_line": 54, "violates": [ "emails[i] consist of lowercase English letters, '+', '.' and '@'." ] }, { "line": 60, "end_line": 60, "violates": [ "emails[i] consist of lowercase English letters, '+', '.' and '@'." ] }, { "line": 65, "end_line": 65, "violates": [ "emails[i] consist of lowercase English letters, '+', '.' and '@'." ] }, { "line": 80, "end_line": 80, "violates": [ "emails[i] consist of lowercase English letters, '+', '.' and '@'." ] }, { "line": 85, "end_line": 85, "violates": [ "emails[i] consist of lowercase English letters, '+', '.' and '@'." ] }, { "line": 95, "end_line": 95, "violates": [ "emails[i] consist of lowercase English letters, '+', '.' and '@'." ] }, { "line": 100, "end_line": 100, "violates": [ "emails[i] consist of lowercase English letters, '+', '.' and '@'." ] }, { "line": 102, "end_line": 102, "violates": [ "emails[i] consist of lowercase English letters, '+', '.' and '@'." ] } ], "unchecked_constraints": [ "Each emails[i] contains exactly one '@' character.", "All local and domain names are non-empty.", "Local names do not start with a '+' character.", "Domain names end with the \".com\" suffix.", "Domain names must contain at least one character before \".com\" suffix." ], "public_tests": 2, "hints": [] }, { "question_id": 930, "task_id": "binary-subarrays-with-sum", "drop": [], "similar": [ "count-subarrays-with-score-less-than-k", "ways-to-split-array-into-good-subarrays", "find-all-possible-stable-binary-arrays-i", "find-all-possible-stable-binary-arrays-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "goal" ], "tests": { "total": 72, "kept": 72, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can you transform the problem into finding two prefix sums whose difference equals goal?", "While iterating through the array, keep track of how many times each prefix sum has appeared so far.", "If the current prefix sum is curr, how many previous prefix sums equal to curr - goal exist?" ] }, { "question_id": 931, "task_id": "minimum-falling-path-sum", "drop": [], "similar": [ "minimum-falling-path-sum-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 79, "kept": 66, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "-100 <= matrix[i][j] <= 100" ] }, { "line": 11, "end_line": 11, "violates": [ "-100 <= matrix[i][j] <= 100" ] }, { "line": 12, "end_line": 12, "violates": [ "n == matrix.length == matrix[i].length" ] }, { "line": 14, "end_line": 14, "violates": [ "n == matrix.length == matrix[i].length" ] }, { "line": 20, "end_line": 20, "violates": [ "-100 <= matrix[i][j] <= 100" ] }, { "line": 26, "end_line": 26, "violates": [ "n == matrix.length == matrix[i].length" ] }, { "line": 39, "end_line": 39, "violates": [ "n == matrix.length == matrix[i].length" ] }, { "line": 47, "end_line": 47, "violates": [ "-100 <= matrix[i][j] <= 100" ] }, { "line": 59, "end_line": 59, "violates": [ "n == matrix.length == matrix[i].length" ] }, { "line": 62, "end_line": 62, "violates": [ "-100 <= matrix[i][j] <= 100" ] }, { "line": 68, "end_line": 68, "violates": [ "-100 <= matrix[i][j] <= 100" ] }, { "line": 74, "end_line": 74, "violates": [ "-100 <= matrix[i][j] <= 100" ] }, { "line": 79, "end_line": 79, "violates": [ "-100 <= matrix[i][j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 932, "task_id": "beautiful-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 58, "kept": 58, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 934, "task_id": "shortest-bridge", "drop": [], "similar": [ "minimum-number-of-operations-to-make-x-and-y-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 52, "kept": 44, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 8, "end_line": 8, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 10, "end_line": 10, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 11, "end_line": 11, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 29, "end_line": 29, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 33, "end_line": 33, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 45, "end_line": 45, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 50, "end_line": 50, "violates": [ "n == grid.length == grid[i].length" ] } ], "unchecked_constraints": [ "There are exactly two islands in grid." ], "public_tests": 3, "hints": [] }, { "question_id": 935, "task_id": "knight-dialer", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 42, "kept": 42, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 936, "task_id": "stamping-the-sequence", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "stamp", "target" ], "tests": { "total": 88, "kept": 78, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "stamp and target consist of lowercase English letters." ] }, { "line": 8, "end_line": 8, "violates": [ "stamp and target consist of lowercase English letters." ] }, { "line": 9, "end_line": 9, "violates": [ "stamp and target consist of lowercase English letters." ] }, { "line": 10, "end_line": 10, "violates": [ "stamp and target consist of lowercase English letters." ] }, { "line": 11, "end_line": 11, "violates": [ "stamp and target consist of lowercase English letters." ] }, { "line": 13, "end_line": 13, "violates": [ "stamp and target consist of lowercase English letters." ] }, { "line": 18, "end_line": 18, "violates": [ "stamp and target consist of lowercase English letters." ] }, { "line": 24, "end_line": 24, "violates": [ "stamp and target consist of lowercase English letters." ] }, { "line": 25, "end_line": 25, "violates": [ "stamp and target consist of lowercase English letters." ] }, { "line": 28, "end_line": 28, "violates": [ "stamp and target consist of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 937, "task_id": "reorder-data-in-log-files", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "logs" ], "tests": { "total": 53, "kept": 53, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All the tokens of logs[i] are separated by a single space.", "logs[i] is guaranteed to have an identifier and at least one word after the identifier." ], "public_tests": 2, "hints": [] }, { "question_id": 938, "task_id": "range-sum-of-bst", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "low", "high" ], "tests": { "total": 81, "kept": 0, "dropped": { "unreadable": 81 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 2 * 10**(4)].", "1 <= Node.val <= 10**(5)", "All Node.val are unique." ] }, { "question_id": 939, "task_id": "minimum-area-rectangle", "drop": [], "similar": [ "minimum-rectangles-to-cover-points", "maximum-area-rectangle-with-point-constraints-i", "maximum-area-rectangle-with-point-constraints-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "points" ], "tests": { "total": 81, "kept": 81, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All the given points are unique." ], "public_tests": 2, "hints": [], "similar_to_test": [ "3380 maximum-area-rectangle-with-point-constraints-i", "3382 maximum-area-rectangle-with-point-constraints-ii" ] }, { "question_id": 940, "task_id": "distinct-subsequences-ii", "drop": [], "similar": [ "number-of-unique-good-subsequences", "count-k-subsequences-of-a-string-with-maximum-beauty" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 53, "kept": 53, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 941, "task_id": "valid-mountain-array", "drop": [], "similar": [ "minimum-number-of-removals-to-make-mountain-array", "beautiful-towers-i" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 141, "kept": 117, "dropped": { "constraint_violation": 24 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 87, "end_line": 87, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 98, "end_line": 98, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 102, "end_line": 102, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 103, "end_line": 103, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 111, "end_line": 111, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 112, "end_line": 112, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 114, "end_line": 114, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 116, "end_line": 116, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 119, "end_line": 119, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 120, "end_line": 120, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 124, "end_line": 124, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 130, "end_line": 130, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 131, "end_line": 131, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 133, "end_line": 133, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 139, "end_line": 139, "violates": [ "0 <= arr[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "It's very easy to keep track of a monotonically increasing or decreasing ordering of elements. You just need to be able to determine the start of the valley in the mountain and from that point onwards, it should be a valley i.e. no mini-hills after that. Use this information in regards to the values in the array and you will be able to come up with a straightforward solution." ] }, { "question_id": 942, "task_id": "di-string-match", "drop": [], "similar": [ "construct-smallest-number-from-di-string" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 157, "kept": 157, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 943, "task_id": "find-the-shortest-superstring", "drop": [], "similar": [ "maximum-rows-covered-by-columns", "find-the-minimum-cost-array-permutation", "find-the-shortest-superstring-ii" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 96, "kept": 86, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "1 <= words.length <= 12" ] }, { "line": 31, "end_line": 31, "violates": [ "All the strings of words are unique." ] }, { "line": 39, "end_line": 39, "violates": [ "All the strings of words are unique." ] }, { "line": 45, "end_line": 45, "violates": [ "All the strings of words are unique." ] }, { "line": 48, "end_line": 48, "violates": [ "All the strings of words are unique." ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= words.length <= 12" ] }, { "line": 64, "end_line": 64, "violates": [ "All the strings of words are unique." ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= words.length <= 12" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= words.length <= 12" ] }, { "line": 94, "end_line": 94, "violates": [ "All the strings of words are unique." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 944, "task_id": "delete-columns-to-make-sorted", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "strs" ], "tests": { "total": 99, "kept": 98, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 92, "end_line": 92, "violates": [ "strs[i] consists of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 945, "task_id": "minimum-increment-to-make-array-unique", "drop": [], "similar": [ "minimum-operations-to-make-the-array-increasing", "maximum-product-after-k-increments", "minimum-number-of-operations-to-make-elements-in-array-distinct" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 104, "kept": 104, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3396 minimum-number-of-operations-to-make-elements-in-array-distinct" ] }, { "question_id": 946, "task_id": "validate-stack-sequences", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "pushed", "popped" ], "tests": { "total": 101, "kept": 101, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "popped is a permutation of pushed." ], "public_tests": 2, "hints": [] }, { "question_id": 947, "task_id": "most-stones-removed-with-same-row-or-column", "drop": [], "similar": [ "minimum-moves-to-get-a-peaceful-board" ], "flags": [], "comparison": "exact", "parameter_names": [ "stones" ], "tests": { "total": 100, "kept": 100, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "No two stones are at the same coordinate point." ], "public_tests": 3, "hints": [] }, { "question_id": 948, "task_id": "bag-of-tokens", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "tokens", "power" ], "tests": { "total": 103, "kept": 100, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 52, "end_line": 52, "violates": [ "0 <= tokens[i], power < 10**(4)" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= tokens[i], power < 10**(4)" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= tokens[i], power < 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 949, "task_id": "largest-time-for-given-digits", "drop": [], "similar": [ "number-of-valid-clock-times" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 123, "kept": 123, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 950, "task_id": "reveal-cards-in-increasing-order", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "deck" ], "tests": { "total": 78, "kept": 72, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= deck[i] <= 10**(6)", "All the values of deck are unique." ] }, { "line": 36, "end_line": 36, "violates": [ "All the values of deck are unique." ] }, { "line": 55, "end_line": 55, "violates": [ "All the values of deck are unique." ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= deck[i] <= 10**(6)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= deck[i] <= 10**(6)" ] }, { "line": 77, "end_line": 77, "violates": [ "All the values of deck are unique." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 951, "task_id": "flip-equivalent-binary-trees", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root1", "root2" ], "tests": { "total": 76, "kept": 0, "dropped": { "unreadable": 76 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in each tree is in the range [0, 100].", "Each tree will have unique node values in the range [0, 99]." ] }, { "question_id": 952, "task_id": "largest-component-size-by-common-factor", "drop": [], "similar": [ "groups-of-strings", "distinct-prime-factors-of-product-of-array" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 98, "kept": 96, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 953, "task_id": "verifying-an-alien-dictionary", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "words", "order" ], "tests": { "total": 158, "kept": 138, "dropped": { "constraint_violation": 20 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "order.length == 26" ] }, { "line": 15, "end_line": 15, "violates": [ "order.length == 26" ] }, { "line": 31, "end_line": 31, "violates": [ "order.length == 26", "order.length == 26" ] }, { "line": 39, "end_line": 39, "violates": [ "order.length == 26" ] }, { "line": 53, "end_line": 53, "violates": [ "order.length == 26" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 66, "end_line": 66, "violates": [ "order.length == 26" ] }, { "line": 68, "end_line": 68, "violates": [ "order.length == 26" ] }, { "line": 76, "end_line": 76, "violates": [ "order.length == 26" ] }, { "line": 82, "end_line": 82, "violates": [ "order.length == 26", "order.length == 26" ] }, { "line": 85, "end_line": 85, "violates": [ "order.length == 26" ] }, { "line": 91, "end_line": 91, "violates": [ "order.length == 26" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 97, "end_line": 97, "violates": [ "order.length == 26" ] }, { "line": 105, "end_line": 105, "violates": [ "order.length == 26" ] }, { "line": 112, "end_line": 112, "violates": [ "order.length == 26" ] }, { "line": 120, "end_line": 120, "violates": [ "order.length == 26" ] }, { "line": 135, "end_line": 135, "violates": [ "order.length == 26" ] }, { "line": 148, "end_line": 148, "violates": [ "order.length == 26" ] }, { "line": 156, "end_line": 156, "violates": [ "order.length == 26" ] } ], "unchecked_constraints": [ "All characters in words[i] and order are English lowercase letters." ], "public_tests": 3, "hints": [] }, { "question_id": 954, "task_id": "array-of-doubled-pairs", "drop": [], "similar": [ "find-original-array-from-doubled-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 112, "kept": 112, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 955, "task_id": "delete-columns-to-make-sorted-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "strs" ], "tests": { "total": 205, "kept": 205, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 956, "task_id": "tallest-billboard", "drop": [], "similar": [ "partition-array-into-two-arrays-to-minimize-sum-difference" ], "flags": [], "comparison": "exact", "parameter_names": [ "rods" ], "tests": { "total": 98, "kept": 77, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= rods[i] <= 1000", "1 <= rods[i] <= 1000" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= rods[i] <= 1000" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= rods.length <= 20" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= rods.length <= 20", "1 <= rods[i] <= 1000" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= rods[i] <= 1000" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= rods[i] <= 1000" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= rods.length <= 20" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= rods[i] <= 1000" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= rods[i] <= 1000" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= rods.length <= 20" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= rods[i] <= 1000", "1 <= rods[i] <= 1000" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= rods[i] <= 1000" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= rods[i] <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= rods[i] <= 1000" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= rods.length <= 20" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= rods[i] <= 1000" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= rods[i] <= 1000" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= rods[i] <= 1000" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= rods[i] <= 1000" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= rods[i] <= 1000" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= rods.length <= 20" ] } ], "unchecked_constraints": [ "sum(rods[i]) <= 5000" ], "public_tests": 3, "hints": [] }, { "question_id": 957, "task_id": "prison-cells-after-n-days", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "cells", "n" ], "tests": { "total": 102, "kept": 100, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 958, "task_id": "check-completeness-of-a-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 136, "kept": 0, "dropped": { "unreadable": 136 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 105, "end_line": 105, "unreadable": true }, { "line": 106, "end_line": 106, "unreadable": true }, { "line": 107, "end_line": 107, "unreadable": true }, { "line": 108, "end_line": 108, "unreadable": true }, { "line": 109, "end_line": 109, "unreadable": true }, { "line": 110, "end_line": 110, "unreadable": true }, { "line": 111, "end_line": 111, "unreadable": true }, { "line": 112, "end_line": 112, "unreadable": true }, { "line": 113, "end_line": 113, "unreadable": true }, { "line": 114, "end_line": 114, "unreadable": true }, { "line": 115, "end_line": 115, "unreadable": true }, { "line": 116, "end_line": 116, "unreadable": true }, { "line": 117, "end_line": 117, "unreadable": true }, { "line": 118, "end_line": 118, "unreadable": true }, { "line": 119, "end_line": 119, "unreadable": true }, { "line": 120, "end_line": 120, "unreadable": true }, { "line": 121, "end_line": 121, "unreadable": true }, { "line": 122, "end_line": 122, "unreadable": true }, { "line": 123, "end_line": 123, "unreadable": true }, { "line": 124, "end_line": 124, "unreadable": true }, { "line": 125, "end_line": 125, "unreadable": true }, { "line": 126, "end_line": 126, "unreadable": true }, { "line": 127, "end_line": 127, "unreadable": true }, { "line": 128, "end_line": 128, "unreadable": true }, { "line": 129, "end_line": 129, "unreadable": true }, { "line": 130, "end_line": 130, "unreadable": true }, { "line": 131, "end_line": 131, "unreadable": true }, { "line": 132, "end_line": 132, "unreadable": true }, { "line": 133, "end_line": 133, "unreadable": true }, { "line": 134, "end_line": 134, "unreadable": true }, { "line": 135, "end_line": 135, "unreadable": true }, { "line": 136, "end_line": 136, "unreadable": true }, { "line": 137, "end_line": 137, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 100].", "1 <= Node.val <= 1000" ] }, { "question_id": 959, "task_id": "regions-cut-by-slashes", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 89, "kept": 20, "dropped": { "constraint_violation": 69 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 4, "end_line": 4, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 5, "end_line": 5, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 6, "end_line": 6, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 7, "end_line": 7, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 10, "end_line": 10, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 13, "end_line": 13, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 14, "end_line": 14, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 15, "end_line": 15, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 16, "end_line": 16, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 18, "end_line": 18, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 19, "end_line": 19, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 20, "end_line": 20, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 21, "end_line": 21, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 22, "end_line": 22, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 23, "end_line": 23, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 24, "end_line": 24, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 27, "end_line": 27, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 28, "end_line": 28, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 29, "end_line": 29, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 31, "end_line": 31, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 32, "end_line": 32, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 34, "end_line": 34, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 35, "end_line": 35, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 38, "end_line": 38, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 40, "end_line": 40, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 41, "end_line": 41, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 42, "end_line": 42, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 44, "end_line": 44, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 45, "end_line": 45, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 46, "end_line": 46, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 48, "end_line": 48, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 49, "end_line": 49, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 50, "end_line": 50, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 51, "end_line": 51, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 52, "end_line": 52, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 53, "end_line": 53, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 54, "end_line": 54, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 55, "end_line": 55, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 56, "end_line": 56, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 58, "end_line": 58, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 59, "end_line": 59, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 60, "end_line": 60, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 61, "end_line": 61, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 63, "end_line": 63, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 64, "end_line": 64, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 65, "end_line": 65, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 66, "end_line": 66, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 67, "end_line": 67, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 68, "end_line": 68, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 69, "end_line": 69, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 70, "end_line": 70, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 71, "end_line": 71, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 72, "end_line": 72, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 73, "end_line": 73, "violates": [ "n == grid.length == grid[i].length", "n == grid.length == grid[i].length" ] }, { "line": 74, "end_line": 74, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 75, "end_line": 75, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 76, "end_line": 76, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 77, "end_line": 77, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 78, "end_line": 78, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 79, "end_line": 79, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 80, "end_line": 80, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 82, "end_line": 82, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 83, "end_line": 83, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 85, "end_line": 85, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 87, "end_line": 87, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 88, "end_line": 88, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 89, "end_line": 89, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 90, "end_line": 90, "violates": [ "n == grid.length == grid[i].length" ] } ], "unchecked_constraints": [ "grid[i][j] is either '/', '\\', or ' '." ], "public_tests": 3, "hints": [] }, { "question_id": 960, "task_id": "delete-columns-to-make-sorted-iii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "strs" ], "tests": { "total": 100, "kept": 100, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 961, "task_id": "n-repeated-element-in-size-2n-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 93, "kept": 90, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "0 <= nums[i] <= 10**(4)" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= nums[i] <= 10**(4)" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [ "2 <= n <= 5000", "nums.length == 2 * n", "nums contains n + 1 unique elements and one of them is repeated exactly n times." ], "public_tests": 3, "hints": [] }, { "question_id": 962, "task_id": "maximum-width-ramp", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 69, "kept": 68, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "0 <= nums[i] <= 5 * 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 963, "task_id": "minimum-area-rectangle-ii", "drop": [], "similar": [], "flags": [ "decimal_answer", "has_images" ], "comparison": "float", "parameter_names": [ "points" ], "tests": { "total": 100, "kept": 99, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 47, "end_line": 47, "violates": [ "0 <= xi, yi <= 4 * 10**(4)" ] } ], "unchecked_constraints": [ "All the given points are unique." ], "public_tests": 3, "hints": [] }, { "question_id": 964, "task_id": "least-operators-to-express-number", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "x", "target" ], "tests": { "total": 161, "kept": 127, "dropped": { "constraint_violation": 34 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 142, "end_line": 142, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 152, "end_line": 152, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 155, "end_line": 155, "violates": [ "1 <= target <= 2 * 10**(8)" ] }, { "line": 161, "end_line": 161, "violates": [ "1 <= target <= 2 * 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 965, "task_id": "univalued-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "find-all-the-lonely-nodes" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 77, "kept": 0, "dropped": { "unreadable": 77 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 100].", "0 <= Node.val < 100" ] }, { "question_id": 966, "task_id": "vowel-spellchecker", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "wordlist", "queries" ], "tests": { "total": 87, "kept": 17, "dropped": { "constraint_violation": 70 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7", "wordlist[i] and queries[i] consist only of only English letters." ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= wordlist[i].length, queries[i].length <= 7" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 967, "task_id": "numbers-with-same-consecutive-differences", "drop": [], "similar": [], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "n", "k" ], "tests": { "total": 61, "kept": 61, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 968, "task_id": "binary-tree-cameras", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "distribute-coins-in-binary-tree", "choose-edges-to-maximize-score-in-a-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 107, "kept": 0, "dropped": { "unreadable": 107 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 105, "end_line": 105, "unreadable": true }, { "line": 106, "end_line": 106, "unreadable": true }, { "line": 107, "end_line": 107, "unreadable": true }, { "line": 108, "end_line": 108, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 1000].", "Node.val == 0" ] }, { "question_id": 969, "task_id": "pancake-sorting", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 99, "kept": 98, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 68, "end_line": 68, "violates": [ "1 <= arr[i] <= arr.length" ] } ], "unchecked_constraints": [ "All integers in arr are unique (i.e. arr is a permutation of the integers from 1 to arr.length)." ], "public_tests": 2, "hints": [] }, { "question_id": 970, "task_id": "powerful-integers", "drop": [], "similar": [ "count-the-number-of-powerful-integers" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "x", "y", "bound" ], "tests": { "total": 82, "kept": 82, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 971, "task_id": "flip-binary-tree-to-match-preorder-traversal", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "root", "voyage" ], "tests": { "total": 91, "kept": 0, "dropped": { "unreadable": 91 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is n.", "1 <= Node.val, voyage[i] <= n", "All the values in the tree are unique." ] }, { "question_id": 972, "task_id": "equal-rational-numbers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 155, "kept": 155, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Each part consists only of digits.", "The does not have leading zeros (except for the zero itself).", "1 <= .length <= 4", "0 <= .length <= 4", "1 <= .length <= 4" ], "public_tests": 3, "hints": [] }, { "question_id": 973, "task_id": "k-closest-points-to-origin", "drop": [], "similar": [ "kth-largest-element-in-an-array", "top-k-frequent-elements", "top-k-frequent-words", "find-nearest-point-that-has-the-same-x-or-y-coordinate", "minimum-rectangles-to-cover-points", "k-th-nearest-obstacle-queries" ], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "points", "k" ], "tests": { "total": 98, "kept": 98, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3275 k-th-nearest-obstacle-queries" ] }, { "question_id": 974, "task_id": "subarray-sums-divisible-by-k", "drop": [], "similar": [ "subarray-sum-equals-k", "make-sum-divisible-by-p", "count-number-of-bad-pairs", "find-the-divisibility-array-of-a-string", "count-of-interesting-subarrays", "maximum-subarray-sum-with-length-divisible-by-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 108, "kept": 106, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "2 <= k <= 10**(4)" ] }, { "line": 18, "end_line": 18, "violates": [ "2 <= k <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3381 maximum-subarray-sum-with-length-divisible-by-k" ] }, { "question_id": 975, "task_id": "odd-even-jump", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 205, "kept": 199, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "0 <= arr[i] < 10**(5)" ] }, { "line": 145, "end_line": 145, "violates": [ "0 <= arr[i] < 10**(5)" ] }, { "line": 154, "end_line": 154, "violates": [ "0 <= arr[i] < 10**(5)" ] }, { "line": 165, "end_line": 165, "violates": [ "0 <= arr[i] < 10**(5)", "0 <= arr[i] < 10**(5)" ] }, { "line": 175, "end_line": 175, "violates": [ "0 <= arr[i] < 10**(5)", "0 <= arr[i] < 10**(5)" ] }, { "line": 191, "end_line": 191, "violates": [ "0 <= arr[i] < 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 976, "task_id": "largest-perimeter-triangle", "drop": [], "similar": [ "largest-triangle-area" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 114, "kept": 112, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 977, "task_id": "squares-of-a-sorted-array", "drop": [], "similar": [ "merge-sorted-array", "sort-transformed-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 119, "kept": 114, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 50, "end_line": 50, "violates": [ "nums is sorted in non-decreasing order." ] }, { "line": 54, "end_line": 54, "violates": [ "-10**(4) <= nums[i] <= 10**(4)" ] }, { "line": 71, "end_line": 71, "violates": [ "nums is sorted in non-decreasing order." ] }, { "line": 82, "end_line": 82, "violates": [ "nums is sorted in non-decreasing order." ] }, { "line": 99, "end_line": 99, "violates": [ "nums is sorted in non-decreasing order." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 978, "task_id": "longest-turbulent-subarray", "drop": [], "similar": [ "maximum-subarray", "longest-alternating-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 150, "kept": 147, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "0 <= arr[i] <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "0 <= arr[i] <= 10**(9)" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= arr[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 979, "task_id": "distribute-coins-in-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "sum-of-distances-in-tree", "binary-tree-cameras" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 46, "kept": 0, "dropped": { "unreadable": 46 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is n.", "1 <= n <= 100", "0 <= Node.val <= n", "The sum of all Node.val is n." ] }, { "question_id": 980, "task_id": "unique-paths-iii", "drop": [], "similar": [ "sudoku-solver", "unique-paths-ii", "word-search-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 85, "kept": 41, "dropped": { "constraint_violation": 44 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= m * n <= 20" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= m * n <= 20" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= m * n <= 20" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= m * n <= 20" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= m * n <= 20" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= m * n <= 20" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= m * n <= 20" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= m * n <= 20" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= m * n <= 20" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= m * n <= 20" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= m * n <= 20" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= m * n <= 20" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= m * n <= 20" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= m * n <= 20" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= m * n <= 20" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= m * n <= 20" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= m * n <= 20" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= m * n <= 20" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= m * n <= 20" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= m * n <= 20" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= m * n <= 20" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= m * n <= 20" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= m * n <= 20" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= m * n <= 20" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= m * n <= 20" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= m * n <= 20" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= m * n <= 20" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= m * n <= 20" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= m * n <= 20" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= m * n <= 20" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= m * n <= 20" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= m * n <= 20" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= m * n <= 20" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= m * n <= 20" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= m * n <= 20" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= m * n <= 20" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= m * n <= 20" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= m * n <= 20" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= m * n <= 20" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= m * n <= 20" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= m * n <= 20" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= m * n <= 20" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= m * n <= 20" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= m * n <= 20" ] } ], "unchecked_constraints": [ "There is exactly one starting cell and one ending cell." ], "public_tests": 3, "hints": [] }, { "question_id": 982, "task_id": "triples-with-bitwise-and-equal-to-zero", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 91, "kept": 88, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 54, "end_line": 54, "violates": [ "0 <= nums[i] < 2**(16)" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= nums[i] < 2**(16)" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= nums[i] < 2**(16)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 983, "task_id": "minimum-cost-for-tickets", "drop": [], "similar": [ "coin-change", "most-expensive-item-that-can-not-be-bought" ], "flags": [], "comparison": "exact", "parameter_names": [ "days", "costs" ], "tests": { "total": 79, "kept": 79, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "days is in strictly increasing order." ], "public_tests": 2, "hints": [] }, { "question_id": 984, "task_id": "string-without-aaa-or-bbb", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "a", "b" ], "tests": { "total": 64, "kept": 64, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "It is guaranteed such an s exists for the given a and b." ], "public_tests": 2, "hints": [] }, { "question_id": 985, "task_id": "sum-of-even-numbers-after-queries", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 88, "kept": 87, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 52, "end_line": 52, "violates": [ "-10**(4) <= vali <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 986, "task_id": "interval-list-intersections", "drop": [], "similar": [ "merge-intervals", "merge-sorted-array", "employee-free-time", "maximum-matching-of-players-with-trainers" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "firstList", "secondList" ], "tests": { "total": 107, "kept": 104, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 38, "end_line": 38, "violates": [ "0 <= starti < endi <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= starti < endi <= 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= starti < endi <= 10**(9)" ] } ], "unchecked_constraints": [ "0 <= startj < endj <= 10**(9)", "endj < startj+1", "endi < starti+1" ], "public_tests": 2, "hints": [] }, { "question_id": 987, "task_id": "vertical-order-traversal-of-a-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 89, "kept": 0, "dropped": { "unreadable": 89 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 1000].", "0 <= Node.val <= 1000" ] }, { "question_id": 988, "task_id": "smallest-string-starting-from-leaf", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "sum-root-to-leaf-numbers", "binary-tree-paths" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 71, "kept": 0, "dropped": { "unreadable": 71 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 8500].", "0 <= Node.val <= 25" ] }, { "question_id": 989, "task_id": "add-to-array-form-of-integer", "drop": [], "similar": [ "add-two-numbers", "plus-one", "add-binary", "add-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "num", "k" ], "tests": { "total": 75, "kept": 31, "dropped": { "constraint_violation": 44 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= k <= 10**(4)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= k <= 10**(4)" ] } ], "unchecked_constraints": [ "num does not contain any leading zeros except for the zero itself." ], "public_tests": 3, "hints": [] }, { "question_id": 990, "task_id": "satisfiability-of-equality-equations", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "equations" ], "tests": { "total": 83, "kept": 82, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 54, "end_line": 54, "violates": [ "equations[i].length == 4", "equations[i][1] is either '=' or '!'." ] } ], "unchecked_constraints": [ "equations[i][0] is a lowercase letter.", "equations[i][2] is '='.", "equations[i][3] is a lowercase letter." ], "public_tests": 2, "hints": [] }, { "question_id": 991, "task_id": "broken-calculator", "drop": [], "similar": [ "2-keys-keyboard", "minimum-operations-to-make-the-integer-zero" ], "flags": [], "comparison": "exact", "parameter_names": [ "startValue", "target" ], "tests": { "total": 96, "kept": 95, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= startValue, target <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 992, "task_id": "subarrays-with-k-different-integers", "drop": [], "similar": [ "longest-substring-without-repeating-characters", "longest-substring-with-at-most-two-distinct-characters", "longest-substring-with-at-most-k-distinct-characters", "count-vowel-substrings-of-a-string", "number-of-unique-flavors-after-sharing-k-candies", "k-divisible-elements-subarrays", "count-complete-subarrays-in-an-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 119, "kept": 113, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= nums[i], k <= nums.length" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i], k <= nums.length" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i], k <= nums.length" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i], k <= nums.length" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i], k <= nums.length" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= nums[i], k <= nums.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try generating all possible subarrays and check for the number of unique integers. Increment the count accordingly.", "How about using a map to store the count of integers?", "Think about the Sliding Window and 2-pointer approach." ] }, { "question_id": 993, "task_id": "cousins-in-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-level-order-traversal", "cousins-in-binary-tree-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "x", "y" ], "tests": { "total": 54, "kept": 0, "dropped": { "unreadable": 54 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [2, 100].", "1 <= Node.val <= 100", "Each node has a unique value.", "x and y are exist in the tree." ] }, { "question_id": 994, "task_id": "rotting-oranges", "drop": [], "similar": [ "walls-and-gates", "battleships-in-a-board", "detonate-the-maximum-bombs", "escape-the-spreading-fire" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "grid[i][j] is 0, 1, or 2." ], "public_tests": 3, "hints": [] }, { "question_id": 995, "task_id": "minimum-number-of-k-consecutive-bit-flips", "drop": [], "similar": [ "bulb-switcher", "minimum-time-to-remove-all-cars-containing-illegal-goods", "number-of-distinct-binary-strings-after-applying-operations", "minimum-operations-to-make-binary-array-elements-equal-to-one-i", "smallest-number-with-all-set-bits" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 100, "kept": 100, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [], "similar_to_test": [ "3370 smallest-number-with-all-set-bits" ] }, { "question_id": 996, "task_id": "number-of-squareful-arrays", "drop": [], "similar": [ "permutations-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 997, "task_id": "find-the-town-judge", "drop": [], "similar": [ "find-the-celebrity" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "trust" ], "tests": { "total": 86, "kept": 86, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All the pairs of trust are unique." ], "public_tests": 3, "hints": [] }, { "question_id": 998, "task_id": "maximum-binary-tree-ii", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "maximum-binary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "val" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 100].", "1 <= Node.val <= 100", "All the values of the tree are unique." ] }, { "question_id": 999, "task_id": "available-captures-for-rook", "drop": [], "similar": [ "count-unguarded-cells-in-the-grid", "minimum-moves-to-capture-the-queen", "maximum-value-sum-by-placing-three-rooks-ii", "maximum-value-sum-by-placing-three-rooks-i" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board" ], "tests": { "total": 58, "kept": 58, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There is exactly one cell with board[i][j] == 'R'" ], "public_tests": 3, "hints": [], "similar_to_test": [ "3256 maximum-value-sum-by-placing-three-rooks-i", "3257 maximum-value-sum-by-placing-three-rooks-ii" ] }, { "question_id": 1000, "task_id": "minimum-cost-to-merge-stones", "drop": [], "similar": [ "burst-balloons", "minimum-cost-to-connect-sticks" ], "flags": [], "comparison": "exact", "parameter_names": [ "stones", "k" ], "tests": { "total": 235, "kept": 216, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 45, "end_line": 45, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= n <= 30" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 176, "end_line": 176, "violates": [ "1 <= n <= 30" ] }, { "line": 181, "end_line": 181, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 197, "end_line": 197, "violates": [ "1 <= n <= 30" ] }, { "line": 209, "end_line": 209, "violates": [ "1 <= n <= 30" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 1001, "task_id": "grid-illumination", "drop": [], "similar": [ "n-queens" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "lamps", "queries" ], "tests": { "total": 85, "kept": 85, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= rowj, colj < n" ], "public_tests": 3, "hints": [] }, { "question_id": 1002, "task_id": "find-common-characters", "drop": [], "similar": [ "intersection-of-two-arrays-ii" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "words" ], "tests": { "total": 103, "kept": 103, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 1003, "task_id": "check-if-word-is-valid-after-substitutions", "drop": [], "similar": [ "valid-parentheses" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 140, "kept": 139, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= s.length <= 2 * 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 1004, "task_id": "max-consecutive-ones-iii", "drop": [], "similar": [ "longest-substring-with-at-most-k-distinct-characters", "longest-repeating-character-replacement", "max-consecutive-ones", "max-consecutive-ones-ii", "longest-subarray-of-1s-after-deleting-one-element", "maximize-the-confusion-of-an-exam", "minimum-recolors-to-get-k-consecutive-black-blocks", "longest-nice-subarray", "maximum-sum-of-distinct-subarrays-with-length-k", "maximum-enemy-forts-that-can-be-captured" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 77, "kept": 77, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "One thing's for sure, we will only flip a zero if it extends an existing window of 1s. Otherwise, there's no point in doing it, right? Think Sliding Window!", "Since we know this problem can be solved using the sliding window construct, we might as well focus in that direction for hints. Basically, in a given window, we can never have > K zeros, right?", "We don't have a fixed size window in this case. The window size can grow and shrink depending upon the number of zeros we have (we don't actually have to flip the zeros here!).", "The way to shrink or expand a window would be based on the number of zeros that can still be flipped and so on." ] }, { "question_id": 1005, "task_id": "maximize-sum-of-array-after-k-negations", "drop": [], "similar": [ "find-subsequence-of-length-k-with-the-largest-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 121, "kept": 118, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 34, "end_line": 34, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 108, "end_line": 108, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= k <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 1006, "task_id": "clumsy-factorial", "drop": [], "similar": [ "count-the-number-of-computer-unlocking-permutations" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 38, "kept": 38, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 1007, "task_id": "minimum-domino-rotations-for-equal-row", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "tops", "bottoms" ], "tests": { "total": 112, "kept": 101, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= tops[i], bottoms[i] <= 6" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= tops[i], bottoms[i] <= 6" ] }, { "line": 30, "end_line": 30, "violates": [ "bottoms.length == tops.length" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= tops[i], bottoms[i] <= 6" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= tops[i], bottoms[i] <= 6" ] }, { "line": 45, "end_line": 45, "violates": [ "bottoms.length == tops.length" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= tops[i], bottoms[i] <= 6" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= tops[i], bottoms[i] <= 6" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= tops[i], bottoms[i] <= 6" ] }, { "line": 72, "end_line": 72, "violates": [ "bottoms.length == tops.length" ] }, { "line": 89, "end_line": 89, "violates": [ "bottoms.length == tops.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 1008, "task_id": "construct-binary-search-tree-from-preorder-traversal", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "preorder" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 1009, "task_id": "complement-of-base-10-integer", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 37, "kept": 33, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "0 <= n < 10**(9)" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= n < 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= n < 10**(9)" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= n < 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "A binary number plus its complement will equal 111....111 in binary. Also, N = 0 is a corner case." ] }, { "question_id": 1010, "task_id": "pairs-of-songs-with-total-durations-divisible-by-60", "drop": [], "similar": [ "destroy-sequential-targets", "count-pairs-that-form-a-complete-day-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "time" ], "tests": { "total": 89, "kept": 74, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= time[i] <= 500" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We only need to consider each song length modulo 60.", "We can count the number of songs having same (length % 60), and store that in an array of size 60." ] }, { "question_id": 1011, "task_id": "capacity-to-ship-packages-within-d-days", "drop": [], "similar": [ "split-array-largest-sum", "divide-chocolate", "cutting-ribbons", "minimized-maximum-of-products-distributed-to-any-store", "maximum-bags-with-full-capacity-of-rocks", "minimum-total-distance-traveled" ], "flags": [], "comparison": "exact", "parameter_names": [ "weights", "days" ], "tests": { "total": 80, "kept": 74, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= weights[i] <= 500" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= weights[i] <= 500" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= weights[i] <= 500", "1 <= weights[i] <= 500" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= weights[i] <= 500", "1 <= weights[i] <= 500" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= weights[i] <= 500" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= weights[i] <= 500" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Binary search on the answer. We need a function possible(capacity) which returns true if and only if we can do the task in D days." ] }, { "question_id": 1012, "task_id": "numbers-with-repeated-digits", "drop": [], "similar": [ "count-the-number-of-powerful-integers" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 59, "kept": 55, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "How many numbers with no duplicate digits? How many numbers with K digits and no duplicates?", "How many numbers with same length as N? How many numbers with same prefix as N?" ] }, { "question_id": 1013, "task_id": "partition-array-into-three-parts-with-equal-sum", "drop": [], "similar": [ "find-the-middle-index-in-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 77, "kept": 77, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If we have three parts with the same sum, what is the sum of each? If you can find the first part, can you find the second part?" ] }, { "question_id": 1014, "task_id": "best-sightseeing-pair", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "values" ], "tests": { "total": 106, "kept": 102, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 44, "end_line": 44, "violates": [ "1 <= values[i] <= 1000" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= values[i] <= 1000" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= values[i] <= 1000" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= values[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can you tell the best sightseeing spot in one pass (ie. as you iterate over the input?) What should we store or keep track of as we iterate to do this?" ] }, { "question_id": 1015, "task_id": "smallest-integer-divisible-by-k", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "k" ], "tests": { "total": 90, "kept": 70, "dropped": { "constraint_violation": 20 } }, "dropped_tests": [ { "line": 38, "end_line": 38, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= k <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "11111 = 1111 * 10 + 1 We only need to store remainders modulo K.", "If we never get a remainder of 0, why would that happen, and how would we know that?" ] }, { "question_id": 1016, "task_id": "binary-string-with-substrings-representing-1-to-n", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "n" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We only need to check substrings of length at most 30, because 10^9 has 30 bits." ] }, { "question_id": 1017, "task_id": "convert-to-base-2", "drop": [], "similar": [ "encode-number", "convert-date-to-binary" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 69, "kept": 61, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Figure out whether you need the ones digit placed or not, then shift by two." ], "similar_to_test": [ "3280 convert-date-to-binary" ] }, { "question_id": 1018, "task_id": "binary-prefix-divisible-by-5", "drop": [], "similar": [ "average-value-of-even-numbers-that-are-divisible-by-three", "find-the-maximum-divisibility-score" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 69, "kept": 69, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If X is the first i digits of the array as a binary number, then 2X + A[i] is the first i+1 digits." ] }, { "question_id": 1019, "task_id": "next-greater-node-in-linked-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 115, "kept": 0, "dropped": { "unreadable": 115 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 105, "end_line": 105, "unreadable": true }, { "line": 106, "end_line": 106, "unreadable": true }, { "line": 107, "end_line": 107, "unreadable": true }, { "line": 108, "end_line": 108, "unreadable": true }, { "line": 109, "end_line": 109, "unreadable": true }, { "line": 110, "end_line": 110, "unreadable": true }, { "line": 111, "end_line": 111, "unreadable": true }, { "line": 112, "end_line": 112, "unreadable": true }, { "line": 113, "end_line": 113, "unreadable": true }, { "line": 114, "end_line": 114, "unreadable": true }, { "line": 115, "end_line": 115, "unreadable": true }, { "line": 116, "end_line": 116, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is n.", "1 <= n <= 10**(4)", "1 <= Node.val <= 10**(9)" ] }, { "question_id": 1020, "task_id": "number-of-enclaves", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 67, "kept": 67, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can you model this problem as a graph problem? Create n * m + 1 nodes where n * m nodes represents each cell of the map and one extra node to represent the exterior of the map.", "In the map add edges between neighbors on land cells. And add edges between the exterior and land nodes which are in the boundary. Return as answer the number of nodes that are not reachable from the exterior node." ] }, { "question_id": 1021, "task_id": "remove-outermost-parentheses", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 103, "kept": 102, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= s.length <= 10**(5)" ] } ], "unchecked_constraints": [ "s is a valid parentheses string." ], "public_tests": 3, "hints": [ "Can you find the primitive decomposition? The number of ( and ) characters must be equal." ] }, { "question_id": 1022, "task_id": "sum-of-root-to-leaf-binary-numbers", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 98, "kept": 0, "dropped": { "unreadable": 98 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 1000].", "Node.val is 0 or 1." ] }, { "question_id": 1023, "task_id": "camelcase-matching", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "queries", "pattern" ], "tests": { "total": 114, "kept": 103, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "queries[i] and pattern consist of English letters." ] }, { "line": 17, "end_line": 17, "violates": [ "queries[i] and pattern consist of English letters." ] }, { "line": 28, "end_line": 28, "violates": [ "queries[i] and pattern consist of English letters." ] }, { "line": 36, "end_line": 36, "violates": [ "queries[i] and pattern consist of English letters." ] }, { "line": 45, "end_line": 45, "violates": [ "queries[i] and pattern consist of English letters." ] }, { "line": 48, "end_line": 48, "violates": [ "queries[i] and pattern consist of English letters." ] }, { "line": 55, "end_line": 55, "violates": [ "queries[i] and pattern consist of English letters." ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= queries[i].length <= 100" ] }, { "line": 83, "end_line": 83, "violates": [ "queries[i] and pattern consist of English letters." ] }, { "line": 89, "end_line": 89, "violates": [ "queries[i] and pattern consist of English letters." ] }, { "line": 97, "end_line": 97, "violates": [ "queries[i] and pattern consist of English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Given a single pattern and word, how can we solve it?", "One way to do it is using a DP (pos1, pos2) where pos1 is a pointer to the word and pos2 to the pattern and returns true if we can match the pattern with the given word.", "We have two scenarios: The first one is when `word[pos1] == pattern[pos2]`, then the transition will be just DP(pos1 + 1, pos2 + 1). The second scenario is when `word[pos1]` is lowercase then we can add this character to the pattern so that the transition is just DP(pos1 + 1, pos2) The case base is `if (pos1 == n && pos2 == m) return true;` Where n and m are the sizes of the strings word and pattern respectively." ] }, { "question_id": 1024, "task_id": "video-stitching", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "clips", "time" ], "tests": { "total": 95, "kept": 86, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "0 <= starti <= endi <= 100", "1 <= time <= 100" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= starti <= endi <= 100", "1 <= time <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= starti <= endi <= 100", "1 <= time <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= starti <= endi <= 100" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= starti <= endi <= 100", "1 <= time <= 100" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= starti <= endi <= 100", "1 <= time <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= starti <= endi <= 100" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= starti <= endi <= 100", "1 <= time <= 100" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= starti <= endi <= 100", "1 <= time <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "What if we sort the intervals? Considering the sorted intervals, how can we solve the problem with dynamic programming?", "Let's consider a DP(pos, limit) where pos represents the position of the current interval we are gonna take the decision and limit is the current covered area from [0 - limit]. This DP returns the minimum number of taken intervals or infinite if it's not possible to cover the [0 - T] section." ] }, { "question_id": 1025, "task_id": "divisor-game", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 51, "kept": 50, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= n <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If the current number is even, we can always subtract a 1 to make it odd. If the current number is odd, we must subtract an odd number to make it even." ] }, { "question_id": 1026, "task_id": "maximum-difference-between-node-and-ancestor", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 87, "kept": 0, "dropped": { "unreadable": 87 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [2, 5000].", "0 <= Node.val <= 10**(5)" ] }, { "question_id": 1027, "task_id": "longest-arithmetic-subsequence", "drop": [], "similar": [ "destroy-sequential-targets" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 159, "kept": 149, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "0 <= nums[i] <= 500" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= nums[i] <= 500" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= nums[i] <= 500" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= nums[i] <= 500" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= nums[i] <= 500" ] }, { "line": 83, "end_line": 83, "violates": [ "0 <= nums[i] <= 500" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= nums[i] <= 500" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= nums[i] <= 500" ] }, { "line": 105, "end_line": 105, "violates": [ "0 <= nums[i] <= 500" ] }, { "line": 132, "end_line": 132, "violates": [ "0 <= nums[i] <= 500" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 1028, "task_id": "recover-a-tree-from-preorder-traversal", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "traversal" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the original tree is in the range [1, 1000].", "1 <= Node.val <= 10**(9)" ] }, { "question_id": 1029, "task_id": "two-city-scheduling", "drop": [], "similar": [ "rearrange-array-to-maximize-prefix-score" ], "flags": [], "comparison": "exact", "parameter_names": [ "costs" ], "tests": { "total": 68, "kept": 56, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= aCosti, bCosti <= 1000" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= aCosti, bCosti <= 1000" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= aCosti, bCosti <= 1000" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= aCosti, bCosti <= 1000" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= aCosti, bCosti <= 1000" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= aCosti, bCosti <= 1000" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= aCosti, bCosti <= 1000" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= aCosti, bCosti <= 1000" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= aCosti, bCosti <= 1000" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= aCosti, bCosti <= 1000" ] }, { "line": 65, "end_line": 65, "violates": [ "costs.length is even.", "1 <= aCosti, bCosti <= 1000" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= aCosti, bCosti <= 1000" ] } ], "unchecked_constraints": [ "2 * n == costs.length" ], "public_tests": 3, "hints": [] }, { "question_id": 1030, "task_id": "matrix-cells-in-distance-order", "drop": [], "similar": [ "cells-in-a-range-on-an-excel-sheet" ], "flags": [], "comparison": "exact", "parameter_names": [ "rows", "cols", "rCenter", "cCenter" ], "tests": { "total": 73, "kept": 73, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 1031, "task_id": "maximum-sum-of-two-non-overlapping-subarrays", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "firstLen", "secondLen" ], "tests": { "total": 110, "kept": 108, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 61, "end_line": 61, "violates": [ "0 <= nums[i] <= 1000" ] }, { "line": 107, "end_line": 107, "violates": [ "0 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "We can use prefix sums to calculate any subarray sum quickly. For each L length subarray, find the best possible M length subarray that occurs before and after it." ] }, { "question_id": 1033, "task_id": "moving-stones-until-consecutive", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "a", "b", "c" ], "tests": { "total": 130, "kept": 130, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "a, b, and c have different values." ], "public_tests": 3, "hints": [ "For the minimum: We can always do it in at most 2 moves, by moving one stone next to another, then the third stone next to the other two. When can we do it in 1 move? 0 moves? For the maximum: Every move, the maximum position minus the minimum position must decrease by at least 1." ] }, { "question_id": 1034, "task_id": "coloring-a-border", "drop": [], "similar": [ "island-perimeter" ], "flags": [], "comparison": "exact", "parameter_names": [ "grid", "row", "col", "color" ], "tests": { "total": 79, "kept": 76, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= grid[i][j], color <= 1000" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= grid[i][j], color <= 1000" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= grid[i][j], color <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a DFS to find every square in the component. Then for each square, color it if it has a neighbor that is outside the grid or a different color." ] }, { "question_id": 1035, "task_id": "uncrossed-lines", "drop": [], "similar": [ "edit-distance" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 106, "kept": 106, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think dynamic programming. Given an oracle dp(i,j) that tells us how many lines A[i:], B[j:] [the sequence A[i], A[i+1], ... and B[j], B[j+1], ...] are uncrossed, can we write this as a recursion?" ] }, { "question_id": 1036, "task_id": "escape-a-large-maze", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "blocked", "source", "target" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= sx, sy, tx, ty < 10**(6)", "It is guaranteed that source and target are not blocked." ], "public_tests": 2, "hints": [ "If we become stuck, there's either a loop around the source or around the target.", "If there is a loop around say, the source, what is the maximum number of squares it can have?" ] }, { "question_id": 1037, "task_id": "valid-boomerang", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "points" ], "tests": { "total": 116, "kept": 111, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "0 <= xi, yi <= 100" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= xi, yi <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= xi, yi <= 100" ] }, { "line": 102, "end_line": 102, "violates": [ "0 <= xi, yi <= 100" ] }, { "line": 110, "end_line": 110, "violates": [ "0 <= xi, yi <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "3 points form a boomerang if and only if the triangle formed from them has non-zero area." ] }, { "question_id": 1038, "task_id": "binary-search-tree-to-greater-sum-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 100].", "0 <= Node.val <= 100", "All the values in the tree are unique." ] }, { "question_id": 1039, "task_id": "minimum-score-triangulation-of-polygon", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "values" ], "tests": { "total": 111, "kept": 91, "dropped": { "constraint_violation": 20 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= values[i] <= 100" ] }, { "line": 38, "end_line": 38, "violates": [ "3 <= n <= 50", "1 <= values[i] <= 100" ] }, { "line": 41, "end_line": 41, "violates": [ "3 <= n <= 50" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= values[i] <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= values[i] <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= values[i] <= 100" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= values[i] <= 100" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= values[i] <= 100" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= values[i] <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= values[i] <= 100" ] }, { "line": 76, "end_line": 76, "violates": [ "3 <= n <= 50" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= values[i] <= 100" ] }, { "line": 78, "end_line": 78, "violates": [ "3 <= n <= 50" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= values[i] <= 100" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= values[i] <= 100" ] }, { "line": 87, "end_line": 87, "violates": [ "3 <= n <= 50" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= values[i] <= 100" ] }, { "line": 103, "end_line": 103, "violates": [ "3 <= n <= 50" ] }, { "line": 106, "end_line": 106, "violates": [ "3 <= n <= 50" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= values[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Without loss of generality, there is a triangle that uses adjacent vertices A[0] and A[N-1] (where N = A.length). Depending on your choice K of it, this breaks down the triangulation into two subproblems A[1:K] and A[K+1:N-1]." ] }, { "question_id": 1040, "task_id": "moving-stones-until-consecutive-ii", "drop": [], "similar": [ "minimum-number-of-operations-to-make-array-continuous" ], "flags": [], "comparison": "exact", "parameter_names": [ "stones" ], "tests": { "total": 140, "kept": 137, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= stones[i] <= 10**(9)" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= stones[i] <= 10**(9)" ] }, { "line": 141, "end_line": 141, "violates": [ "3 <= stones.length <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For the minimum, how many stones are already in place? For the maximum, we have to lose either the gap A[1] - A[0] or A[N-1] - A[N-2] (where N = A.length), but every other space can be occupied." ] }, { "question_id": 1041, "task_id": "robot-bounded-in-circle", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "instructions" ], "tests": { "total": 140, "kept": 140, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "instructions[i] is 'G', 'L' or, 'R'." ], "public_tests": 3, "hints": [ "Calculate the final vector of how the robot travels after executing all instructions once - it consists of a change in position plus a change in direction.", "The robot stays in the circle if and only if (looking at the final vector) it changes direction (ie. doesn't stay pointing north), or it moves 0." ] }, { "question_id": 1042, "task_id": "flower-planting-with-no-adjacent", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "n", "paths" ], "tests": { "total": 59, "kept": 59, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Every garden has at most 3 paths coming into or leaving it." ], "public_tests": 3, "hints": [ "Since each garden is connected to at most 3 gardens, there's always an available color for each garden. For example, if one garden is next to gardens with colors 1, 3, 4, then color #2 is available." ] }, { "question_id": 1043, "task_id": "partition-array-for-maximum-sum", "drop": [], "similar": [ "subsequence-of-size-k-with-the-largest-even-sum", "partition-string-into-minimum-beautiful-substrings", "minimum-substring-partition-of-equal-character-frequency" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "k" ], "tests": { "total": 104, "kept": 102, "dropped": { "int_overflow": 2 } }, "dropped_tests": [ { "line": 52, "end_line": 52, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 64, "end_line": 64, "unrepresentable_in": [ "cpp", "rust", "java" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think dynamic programming: dp[i] will be the answer for array A[0], ..., A[i-1].", "For j = 1 .. k that keeps everything in bounds, dp[i] is the maximum of dp[i-j] + max(A[i-1], ..., A[i-j]) * j ." ] }, { "question_id": 1044, "task_id": "longest-duplicate-substring", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 117, "kept": 116, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 53, "end_line": 53, "violates": [ "s consists of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Binary search for the length of the answer. (If there's an answer of length 10, then there are answers of length 9, 8, 7, ...)", "To check whether an answer of length K exists, we can use Rabin-Karp 's algorithm." ] }, { "question_id": 1046, "task_id": "last-stone-weight", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "stones" ], "tests": { "total": 124, "kept": 105, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= stones.length <= 30" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= stones.length <= 30" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= stones.length <= 30" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= stones.length <= 30" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= stones.length <= 30" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= stones.length <= 30" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= stones.length <= 30" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= stones.length <= 30" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= stones.length <= 30" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= stones.length <= 30" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= stones.length <= 30" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= stones.length <= 30" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= stones.length <= 30" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simulate the process. We can do it with a heap, or by sorting some list of stones every time we take a turn." ] }, { "question_id": 1047, "task_id": "remove-all-adjacent-duplicates-in-string", "drop": [], "similar": [ "remove-all-adjacent-duplicates-in-string-ii", "removing-stars-from-a-string", "minimize-string-length" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 42, "kept": 40, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "1 <= s.length <= 10**(5)" ] }, { "line": 43, "end_line": 43, "violates": [ "s consists of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a stack to process everything greedily." ] }, { "question_id": 1048, "task_id": "longest-string-chain", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 84, "kept": 60, "dropped": { "constraint_violation": 24 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= words[i].length <= 16" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= words[i].length <= 16" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Instead of adding a character, try deleting a character to form a chain in reverse.", "For each word in order of length, for each word2 which is word with one character removed, length[word2] = max(length[word2], length[word] + 1)." ] }, { "question_id": 1049, "task_id": "last-stone-weight-ii", "drop": [], "similar": [ "partition-array-into-two-arrays-to-minimize-sum-difference" ], "flags": [], "comparison": "exact", "parameter_names": [ "stones" ], "tests": { "total": 99, "kept": 86, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= stones[i] <= 100", "1 <= stones[i] <= 100" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= stones[i] <= 100" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= stones[i] <= 100", "1 <= stones[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Think of the final answer as a sum of weights with + or - sign symbols infront of each weight. Actually, all sums with 1 of each sign symbol are possible.", "Use dynamic programming: for every possible sum with N stones, those sums +x or -x is possible with N+1 stones, where x is the value of the newest stone. (This overcounts sums that are all positive or all negative, but those don't matter.)" ] }, { "question_id": 1051, "task_id": "height-checker", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "heights" ], "tests": { "total": 115, "kept": 111, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 53, "end_line": 53, "violates": [ "1 <= heights.length <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= heights.length <= 100" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= heights.length <= 100" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= heights[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Build the correct order of heights by sorting another array, then compare the two arrays." ] }, { "question_id": 1052, "task_id": "grumpy-bookstore-owner", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "customers", "grumpy", "minutes" ], "tests": { "total": 89, "kept": 86, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 59, "end_line": 59, "violates": [ "0 <= customers[i] <= 1000" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= customers[i] <= 1000" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= customers[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Say the store owner uses their power in minute 1 to X and we have some answer A. If they instead use their power from minute 2 to X+1, we only have to use data from minutes 1, 2, X and X+1 to update our answer A." ] }, { "question_id": 1053, "task_id": "previous-permutation-with-one-swap", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 140, "kept": 129, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 131, "end_line": 131, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 137, "end_line": 137, "violates": [ "1 <= arr[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "You need to swap two values, one larger than the other. Where is the larger one located?" ] }, { "question_id": 1054, "task_id": "distant-barcodes", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "barcodes" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We want to always choose the most common or second most common element to write next. What data structure allows us to query this effectively?" ] }, { "question_id": 1055, "task_id": "shortest-way-to-form-string", "drop": [ "premium" ] }, { "question_id": 1056, "task_id": "confusing-number", "drop": [ "premium" ] }, { "question_id": 1057, "task_id": "campus-bikes", "drop": [ "premium" ] }, { "question_id": 1058, "task_id": "minimize-rounding-error-to-meet-target", "drop": [ "premium" ] }, { "question_id": 1059, "task_id": "all-paths-from-source-lead-to-destination", "drop": [ "premium" ] }, { "question_id": 1060, "task_id": "missing-element-in-sorted-array", "drop": [ "premium" ] }, { "question_id": 1061, "task_id": "lexicographically-smallest-equivalent-string", "drop": [], "similar": [ "lexicographically-smallest-generated-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "s2", "baseStr" ], "tests": { "total": 98, "kept": 89, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "s1.length == s2.length" ] }, { "line": 30, "end_line": 30, "violates": [ "s1.length == s2.length" ] }, { "line": 35, "end_line": 35, "violates": [ "s1.length == s2.length" ] }, { "line": 37, "end_line": 37, "violates": [ "s1.length == s2.length" ] }, { "line": 42, "end_line": 42, "violates": [ "s1.length == s2.length" ] }, { "line": 53, "end_line": 53, "violates": [ "s1.length == s2.length" ] }, { "line": 54, "end_line": 54, "violates": [ "s1.length == s2.length" ] }, { "line": 87, "end_line": 87, "violates": [ "s1.length == s2.length" ] }, { "line": 92, "end_line": 92, "violates": [ "s1.length == s2.length" ] } ], "unchecked_constraints": [ "1 <= s1.length, s2.length, baseStr <= 1000" ], "public_tests": 3, "hints": [ "Model these equalities as edges of a graph.", "Group each connected component of the graph and assign each node of this component to the node with the lowest lexicographically character.", "Finally convert the string with the precalculated information." ], "similar_to_test": [ "3474 lexicographically-smallest-generated-string" ] }, { "question_id": 1062, "task_id": "longest-repeating-substring", "drop": [ "premium" ] }, { "question_id": 1063, "task_id": "number-of-valid-subarrays", "drop": [ "premium" ] }, { "question_id": 1064, "task_id": "fixed-point", "drop": [ "premium" ] }, { "question_id": 1065, "task_id": "index-pairs-of-a-string", "drop": [ "premium" ] }, { "question_id": 1066, "task_id": "campus-bikes-ii", "drop": [ "premium" ] }, { "question_id": 1067, "task_id": "digit-count-in-range", "drop": [ "premium" ] }, { "question_id": 1071, "task_id": "greatest-common-divisor-of-strings", "drop": [], "similar": [ "find-greatest-common-divisor-of-array", "smallest-even-multiple", "find-the-maximum-factor-score-of-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "str1", "str2" ], "tests": { "total": 175, "kept": 172, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 76, "end_line": 76, "violates": [ "1 <= str1.length, str2.length <= 1000" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= str1.length, str2.length <= 1000" ] }, { "line": 160, "end_line": 160, "violates": [ "1 <= str1.length, str2.length <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "The greatest common divisor must be a prefix of each string, so we can try all prefixes." ], "similar_to_test": [ "3334 find-the-maximum-factor-score-of-array" ] }, { "question_id": 1072, "task_id": "flip-columns-for-maximum-number-of-equal-rows", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 88, "kept": 87, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 71, "end_line": 71, "violates": [ "n == matrix[i].length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Flipping a subset of columns is like doing a bitwise XOR of some number K onto each row. We want rows X with X ^ K = all 0s or all 1s. This is the same as X = X^K ^K = (all 0s or all 1s) ^ K, so we want to count rows that have opposite bits set. For example, if K = 1, then we count rows X = (00000...001, or 1111....110)." ] }, { "question_id": 1073, "task_id": "adding-two-negabinary-numbers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr1", "arr2" ], "tests": { "total": 104, "kept": 104, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "arr1[i] and arr2[i] are 0 or 1", "arr1 and arr2 have no leading zeros" ], "public_tests": 3, "hints": [ "We can try to determine the last digit of the answer, then divide everything by 2 and repeat." ] }, { "question_id": 1074, "task_id": "number-of-submatrices-that-sum-to-target", "drop": [], "similar": [ "disconnect-path-in-a-binary-matrix-by-at-most-one-flip" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix", "target" ], "tests": { "total": 82, "kept": 82, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Using a 2D prefix sum, we can query the sum of any submatrix in O(1) time. Now for each (r1, r2), we can find the largest sum of a submatrix that uses every row in [r1, r2] in linear time using a sliding window." ] }, { "question_id": 1078, "task_id": "occurrences-after-bigram", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "text", "first", "second" ], "tests": { "total": 101, "kept": 98, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 44, "end_line": 44, "violates": [ "1 <= first.length, second.length <= 10" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= first.length, second.length <= 10" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= first.length, second.length <= 10" ] } ], "unchecked_constraints": [ "All the words in text are separated by a single space.", "text will not have any leading or trailing spaces." ], "public_tests": 2, "hints": [ "Split the string into words, then look at adjacent triples of words." ] }, { "question_id": 1079, "task_id": "letter-tile-possibilities", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "tiles" ], "tests": { "total": 74, "kept": 36, "dropped": { "constraint_violation": 38 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= tiles.length <= 7" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= tiles.length <= 7" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try to build the string with a backtracking DFS by considering what you can put in every position." ] }, { "question_id": 1080, "task_id": "insufficient-nodes-in-root-to-leaf-paths", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "count-nodes-equal-to-average-of-subtree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "limit" ], "tests": { "total": 18, "kept": 0, "dropped": { "unreadable": 18 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 5000].", "-10**(5) <= Node.val <= 10**(5)" ] }, { "question_id": 1081, "task_id": "smallest-subsequence-of-distinct-characters", "drop": [], "similar": [ "find-the-most-competitive-subsequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 124, "kept": 123, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 84, "end_line": 84, "violates": [ "s consists of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Greedily try to add one missing character. How to check if adding some character will not cause problems ? Use bit-masks to check whether you will be able to complete the sub-sequence if you add the character at some index i." ] }, { "question_id": 1085, "task_id": "sum-of-digits-in-the-minimum-number", "drop": [ "premium" ] }, { "question_id": 1086, "task_id": "high-five", "drop": [ "premium" ] }, { "question_id": 1087, "task_id": "brace-expansion", "drop": [ "premium" ] }, { "question_id": 1088, "task_id": "confusing-number-ii", "drop": [ "premium" ] }, { "question_id": 1089, "task_id": "duplicate-zeros", "drop": [ "in_place", "interface" ], "similar": [], "interface_problems": [ "rust: unparsed signature" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 96, "kept": 95, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 72, "end_line": 72, "violates": [ "0 <= arr[i] <= 9" ] } ], "unchecked_constraints": [] }, { "question_id": 1090, "task_id": "largest-values-from-labels", "drop": [], "similar": [ "maximize-ysum-by-picking-a-triplet-of-distinct-xvalues" ], "flags": [], "comparison": "exact", "parameter_names": [ "values", "labels", "numWanted", "useLimit" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Consider the items in order from largest to smallest value, and greedily take the items if they fall under the use_limit. We can keep track of how many items of each label are used by using a hash table." ] }, { "question_id": 1091, "task_id": "shortest-path-in-binary-matrix", "drop": [], "similar": [ "paths-in-matrix-whose-sum-is-divisible-by-k" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 67, "kept": 62, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "n == grid[i].length" ] }, { "line": 38, "end_line": 38, "violates": [ "n == grid[i].length" ] }, { "line": 54, "end_line": 54, "violates": [ "n == grid[i].length" ] }, { "line": 57, "end_line": 57, "violates": [ "n == grid[i].length" ] }, { "line": 63, "end_line": 63, "violates": [ "n == grid[i].length" ] } ], "unchecked_constraints": [ "grid[i][j] is 0 or 1" ], "public_tests": 3, "hints": [ "Do a breadth first search to find the shortest path." ] }, { "question_id": 1092, "task_id": "shortest-common-supersequence", "drop": [], "similar": [ "longest-common-subsequence", "shortest-string-that-contains-three-strings" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "str1", "str2" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We can find the length of the longest common subsequence between str1[i:] and str2[j:] (for all (i, j)) by using dynamic programming.", "We can use this information to recover the shortest common supersequence." ] }, { "question_id": 1093, "task_id": "statistics-from-a-large-sample", "drop": [ "too_few_tests" ], "similar": [], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "count" ], "tests": { "total": 7, "kept": 0, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "count.length == 256" ] }, { "line": 3, "end_line": 3, "violates": [ "count.length == 256" ] }, { "line": 4, "end_line": 4, "violates": [ "count.length == 256" ] }, { "line": 5, "end_line": 5, "violates": [ "count.length == 256" ] }, { "line": 6, "end_line": 6, "violates": [ "count.length == 256" ] }, { "line": 7, "end_line": 7, "violates": [ "count.length == 256" ] }, { "line": 8, "end_line": 8, "violates": [ "count.length == 256" ] } ], "unchecked_constraints": [ "The mode of the sample that count represents is unique." ] }, { "question_id": 1094, "task_id": "car-pooling", "drop": [], "similar": [ "meeting-rooms-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "trips", "capacity" ], "tests": { "total": 112, "kept": 110, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 45, "end_line": 45, "violates": [ "0 <= fromi < toi <= 1000" ] }, { "line": 104, "end_line": 104, "violates": [ "0 <= fromi < toi <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the pickup and dropoff events by location, then process them in order." ] }, { "question_id": 1096, "task_id": "brace-expansion-ii", "drop": [], "similar": [ "brace-expansion" ], "flags": [], "comparison": "exact", "parameter_names": [ "expression" ], "tests": { "total": 100, "kept": 93, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 57, "end_line": 57, "violates": [ "1 <= expression.length <= 60" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= expression.length <= 60" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= expression.length <= 60" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= expression.length <= 60" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= expression.length <= 60" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= expression.length <= 60" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= expression.length <= 60" ] } ], "unchecked_constraints": [ "The given expression represents a set of words based on the grammar given in the description." ], "public_tests": 2, "hints": [ "You can write helper methods to parse the next \"chunk\" of the expression. If you see eg. \"a\", the answer is just the set {a}. If you see \"{\", you parse until you complete the \"}\" (the number of { and } seen are equal) and that becomes a chunk that you find where the appropriate commas are, and parse each individual expression between the commas." ] }, { "question_id": 1099, "task_id": "two-sum-less-than-k", "drop": [ "premium" ] }, { "question_id": 1100, "task_id": "find-k-length-substrings-with-no-repeated-characters", "drop": [ "premium" ] }, { "question_id": 1101, "task_id": "the-earliest-moment-when-everyone-become-friends", "drop": [ "premium" ] }, { "question_id": 1102, "task_id": "path-with-maximum-minimum-value", "drop": [ "premium" ] }, { "question_id": 1103, "task_id": "distribute-candies-to-people", "drop": [], "similar": [ "distribute-money-to-maximum-children" ], "flags": [], "comparison": "exact", "parameter_names": [ "candies", "num_people" ], "tests": { "total": 88, "kept": 87, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 62, "end_line": 62, "violates": [ "1 <= candies <= 10**9" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Give candy to everyone each \"turn\" first [until you can't], then give candy to one person per turn." ] }, { "question_id": 1104, "task_id": "path-in-zigzag-labelled-binary-tree", "drop": [], "similar": [ "cycle-length-queries-in-a-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "label" ], "tests": { "total": 78, "kept": 68, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= label <= 10**6" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= label <= 10**6" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= label <= 10**6" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= label <= 10**6" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= label <= 10**6" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= label <= 10**6" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= label <= 10**6" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= label <= 10**6" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= label <= 10**6" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= label <= 10**6" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Based on the label of the current node, find what the label must be for the parent of that node." ] }, { "question_id": 1105, "task_id": "filling-bookcase-shelves", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "books", "shelfWidth" ], "tests": { "total": 101, "kept": 96, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= thicknessi <= shelfWidth <= 1000" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= thicknessi <= shelfWidth <= 1000" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= thicknessi <= shelfWidth <= 1000" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= thicknessi <= shelfWidth <= 1000" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= thicknessi <= shelfWidth <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use dynamic programming: dp(i) will be the answer to the problem for books[i:]." ] }, { "question_id": 1106, "task_id": "parsing-a-boolean-expression", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "expression" ], "tests": { "total": 130, "kept": 130, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "expression[i] is one following characters: '(', ')', '&', '|', '!', 't', 'f', and ','." ], "public_tests": 3, "hints": [ "Write a function \"parse\" which calls helper functions \"parse_or\", \"parse_and\", \"parse_not\"." ] }, { "question_id": 1108, "task_id": "defanging-an-ip-address", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "address" ], "tests": { "total": 48, "kept": 48, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The given address is a valid IPv4 address." ], "public_tests": 2, "hints": [] }, { "question_id": 1109, "task_id": "corporate-flight-bookings", "drop": [], "similar": [ "zero-array-transformation-ii", "zero-array-transformation-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "bookings", "n" ], "tests": { "total": 109, "kept": 105, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 63, "end_line": 63, "violates": [ "1 <= firsti <= lasti <= n" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= firsti <= lasti <= n" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= firsti <= lasti <= n" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= firsti <= lasti <= n" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [], "similar_to_test": [ "3356 zero-array-transformation-ii", "3362 zero-array-transformation-iii" ] }, { "question_id": 1111, "task_id": "maximum-nesting-depth-of-two-valid-parentheses-strings", "drop": [], "similar": [ "maximum-nesting-depth-of-the-parentheses" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "seq" ], "tests": { "total": 146, "kept": 146, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= seq.size <= 10000" ], "public_tests": 2, "hints": [] }, { "question_id": 1118, "task_id": "number-of-days-in-a-month", "drop": [ "premium" ] }, { "question_id": 1119, "task_id": "remove-vowels-from-a-string", "drop": [ "premium" ] }, { "question_id": 1120, "task_id": "maximum-average-subtree", "drop": [ "premium" ] }, { "question_id": 1121, "task_id": "divide-array-into-increasing-sequences", "drop": [ "premium" ] }, { "question_id": 1122, "task_id": "relative-sort-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr1", "arr2" ], "tests": { "total": 130, "kept": 128, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 54, "end_line": 54, "violates": [ "0 <= arr1[i], arr2[i] <= 1000" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= arr1[i], arr2[i] <= 1000" ] } ], "unchecked_constraints": [ "Each arr2[i] is in arr1." ], "public_tests": 2, "hints": [ "Using a hashmap, we can map the values of arr2 to their position in arr2.", "After, we can use a custom sorting function." ] }, { "question_id": 1123, "task_id": "lowest-common-ancestor-of-deepest-leaves", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "lowest-common-ancestor-of-a-binary-tree-iv" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the tree will be in the range [1, 1000].", "0 <= Node.val <= 1000", "The values of the nodes in the tree are unique." ] }, { "question_id": 1124, "task_id": "longest-well-performing-interval", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "hours" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Make a new array A of +1/-1s corresponding to if hours[i] is > 8 or not. The goal is to find the longest subarray with positive sum.", "Using prefix sums (PrefixSum[i+1] = A[0] + A[1] + ... + A[i]), you need to find for each j, the smallest i < j with PrefixSum[i] + 1 == PrefixSum[j]." ] }, { "question_id": 1125, "task_id": "smallest-sufficient-team", "drop": [], "similar": [ "the-number-of-good-subsets", "minimum-number-of-work-sessions-to-finish-the-tasks", "maximum-rows-covered-by-columns" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "req_skills", "people" ], "tests": { "total": 72, "kept": 45, "dropped": { "constraint_violation": 27 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 10, "end_line": 10, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 13, "end_line": 13, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters.", "All the strings of people[i] are unique." ] }, { "line": 14, "end_line": 14, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters.", "All the strings of people[i] are unique." ] }, { "line": 15, "end_line": 15, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 17, "end_line": 17, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 18, "end_line": 18, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 21, "end_line": 21, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 23, "end_line": 23, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 25, "end_line": 25, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= req_skills[i].length <= 16", "req_skills[i] consists of lowercase English letters.", "1 <= people[i][j].length <= 16", "people[i][j] consists of lowercase English letters." ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= req_skills[i].length <= 16", "req_skills[i] consists of lowercase English letters.", "1 <= people[i][j].length <= 16", "people[i][j] consists of lowercase English letters." ] }, { "line": 33, "end_line": 33, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= req_skills[i].length <= 16", "req_skills[i] consists of lowercase English letters.", "1 <= people[i][j].length <= 16", "people[i][j] consists of lowercase English letters." ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= req_skills[i].length <= 16", "req_skills[i] consists of lowercase English letters.", "1 <= people[i][j].length <= 16", "people[i][j] consists of lowercase English letters." ] }, { "line": 42, "end_line": 42, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 44, "end_line": 44, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= req_skills[i].length <= 16", "1 <= people[i][j].length <= 16" ] }, { "line": 48, "end_line": 48, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 50, "end_line": 50, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= req_skills[i].length <= 16", "req_skills[i] consists of lowercase English letters.", "1 <= people[i][j].length <= 16", "people[i][j] consists of lowercase English letters." ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= req_skills[i].length <= 16", "req_skills[i] consists of lowercase English letters.", "1 <= people[i][j].length <= 16", "people[i][j] consists of lowercase English letters." ] }, { "line": 66, "end_line": 66, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= req_skills[i].length <= 16", "req_skills[i] consists of lowercase English letters.", "1 <= people[i][j].length <= 16", "people[i][j] consists of lowercase English letters." ] }, { "line": 68, "end_line": 68, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 69, "end_line": 69, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] }, { "line": 71, "end_line": 71, "violates": [ "req_skills[i] consists of lowercase English letters.", "people[i][j] consists of lowercase English letters." ] } ], "unchecked_constraints": [ "Every skill in people[i] is a skill in req_skills.", "It is guaranteed a sufficient team exists." ], "public_tests": 2, "hints": [ "Do a bitmask DP.", "For each person, for each set of skills, we can update our understanding of a minimum set of people needed to perform this set of skills." ] }, { "question_id": 1128, "task_id": "number-of-equivalent-domino-pairs", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "dominoes" ], "tests": { "total": 89, "kept": 88, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= dominoes[i][j] <= 9" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each domino j, find the number of dominoes you've already seen (dominoes i with i < j) that are equivalent.", "You can keep track of what you've seen using a hashmap." ] }, { "question_id": 1129, "task_id": "shortest-path-with-alternating-colors", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "redEdges", "blueEdges" ], "tests": { "total": 97, "kept": 97, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= ai, bi, uj, vj < n" ], "public_tests": 2, "hints": [ "Do a breadth-first search, where the \"nodes\" are actually (Node, color of last edge taken)." ] }, { "question_id": 1130, "task_id": "minimum-cost-tree-from-leaf-values", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 108, "kept": 92, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= arr[i] <= 15" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= arr[i] <= 15" ] } ], "unchecked_constraints": [ "It is guaranteed that the answer fits into a 32-bit signed integer (i.e., it is less than 2**(31))." ], "public_tests": 2, "hints": [ "Do a DP, where dp(i, j) is the answer for the subarray arr[i]..arr[j].", "For each possible way to partition the subarray i <= k < j, the answer is max(arr[i]..arr[k]) * max(arr[k+1]..arr[j]) + dp(i, k) + dp(k+1, j)." ] }, { "question_id": 1131, "task_id": "maximum-of-absolute-value-expression", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr1", "arr2" ], "tests": { "total": 94, "kept": 93, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 80, "end_line": 80, "violates": [ "-10**6 <= arr1[i], arr2[i] <= 10**6" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use the idea that abs(A) + abs(B) = max(A+B, A-B, -A+B, -A-B)." ] }, { "question_id": 1133, "task_id": "largest-unique-number", "drop": [ "premium" ] }, { "question_id": 1134, "task_id": "armstrong-number", "drop": [ "premium" ] }, { "question_id": 1135, "task_id": "connecting-cities-with-minimum-cost", "drop": [ "premium" ] }, { "question_id": 1136, "task_id": "parallel-courses", "drop": [ "premium" ] }, { "question_id": 1137, "task_id": "n-th-tribonacci-number", "drop": [], "similar": [ "climbing-stairs", "fibonacci-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 18, "kept": 18, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The answer is guaranteed to fit within a 32-bit integer, ie. answer <= 2**31 - 1." ], "public_tests": 2, "hints": [ "Make an array F of length 38, and set F[0] = 0, F[1] = F[2] = 1.", "Now write a loop where you set F[n+3] = F[n] + F[n+1] + F[n+2], and return F[n]." ] }, { "question_id": 1138, "task_id": "alphabet-board-path", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "target" ], "tests": { "total": 103, "kept": 101, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= target.length <= 100" ] }, { "line": 97, "end_line": 97, "violates": [ "target consists only of English lowercase letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Create a hashmap from letter to position on the board.", "Now for each letter, try moving there in steps, where at each step you check if it is inside the boundaries of the board." ] }, { "question_id": 1139, "task_id": "largest-1-bordered-square", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 64, "kept": 64, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "grid[i][j] is 0 or 1" ], "public_tests": 2, "hints": [ "For each square, know how many ones are up, left, down, and right of this square. You can find it in O(N^2) using dynamic programming.", "Now for each square ( O(N^3) ), we can evaluate whether that square is 1-bordered in O(1)." ] }, { "question_id": 1140, "task_id": "stone-game-ii", "drop": [], "similar": [ "stone-game-v", "stone-game-vi", "stone-game-vii", "stone-game-viii", "stone-game-ix" ], "flags": [], "comparison": "exact", "parameter_names": [ "piles" ], "tests": { "total": 96, "kept": 95, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "1 <= piles[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use dynamic programming: the states are (i, m) for the answer of piles[i:] and that given m." ] }, { "question_id": 1143, "task_id": "longest-common-subsequence", "drop": [], "similar": [ "longest-palindromic-subsequence", "delete-operation-for-two-strings", "shortest-common-supersequence", "maximize-number-of-subsequences-in-a-string", "subsequence-with-the-minimum-score" ], "flags": [], "comparison": "exact", "parameter_names": [ "text1", "text2" ], "tests": { "total": 146, "kept": 138, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "1 <= text1.length, text2.length <= 1000" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= text1.length, text2.length <= 1000" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= text1.length, text2.length <= 1000" ] }, { "line": 56, "end_line": 56, "violates": [ "text1 and text2 consist of only lowercase English characters." ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= text1.length, text2.length <= 1000" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= text1.length, text2.length <= 1000" ] }, { "line": 135, "end_line": 135, "violates": [ "text1 and text2 consist of only lowercase English characters." ] }, { "line": 141, "end_line": 141, "violates": [ "text1 and text2 consist of only lowercase English characters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try dynamic programming. DP[i][j] represents the longest common subsequence of text1[0 ... i] & text2[0 ... j].", "DP[i][j] = DP[i - 1][j - 1] + 1 , if text1[i] == text2[j] DP[i][j] = max(DP[i - 1][j], DP[i][j - 1]) , otherwise" ] }, { "question_id": 1144, "task_id": "decrease-elements-to-make-array-zigzag", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 148, "kept": 146, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Do each case (even indexed is greater, odd indexed is greater) separately. In say the even case, you should decrease each even-indexed element until it is lower than its immediate neighbors." ] }, { "question_id": 1145, "task_id": "binary-tree-coloring-game", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "n", "x" ], "tests": { "total": 20, "kept": 0, "dropped": { "unreadable": 20 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is n.", "n is odd.", "1 <= Node.val <= n", "All the values of the tree are unique." ] }, { "question_id": 1147, "task_id": "longest-chunked-palindrome-decomposition", "drop": [], "similar": [ "palindrome-rearrangement-queries" ], "flags": [], "comparison": "exact", "parameter_names": [ "text" ], "tests": { "total": 181, "kept": 181, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Using a rolling hash, we can quickly check whether two strings are equal.", "Use that as the basis of a dp." ] }, { "question_id": 1150, "task_id": "check-if-a-number-is-majority-element-in-a-sorted-array", "drop": [ "premium" ] }, { "question_id": 1151, "task_id": "minimum-swaps-to-group-all-1s-together", "drop": [ "premium" ] }, { "question_id": 1152, "task_id": "analyze-user-website-visit-pattern", "drop": [ "premium" ] }, { "question_id": 1153, "task_id": "string-transforms-into-another-string", "drop": [ "premium" ] }, { "question_id": 1154, "task_id": "day-of-the-year", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "date" ], "tests": { "total": 119, "kept": 119, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "date[4] == date[7] == '-', and all other date[i]'s are digits", "date represents a calendar date between Jan 1**(st), 1900 and Dec 31**(st), 2019." ], "public_tests": 2, "hints": [ "Have a integer array of how many days there are per month. February gets one extra day if its a leap year. Then, we can manually count the ordinal as day + (number of days in months before this one)." ] }, { "question_id": 1155, "task_id": "number-of-dice-rolls-with-target-sum", "drop": [], "similar": [ "equal-sum-arrays-with-minimum-number-of-operations", "find-missing-observations" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k", "target" ], "tests": { "total": 108, "kept": 108, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming. The states are how many dice are remaining, and what sum total you have rolled so far." ] }, { "question_id": 1156, "task_id": "swap-for-longest-repeated-character-substring", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "text" ], "tests": { "total": 56, "kept": 56, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "There are two cases: a block of characters, or two blocks of characters between one different character. By keeping a run-length encoded version of the string, we can easily check these cases." ] }, { "question_id": 1160, "task_id": "find-words-that-can-be-formed-by-characters", "drop": [], "similar": [ "ransom-note", "rearrange-characters-to-make-target-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "words", "chars" ], "tests": { "total": 134, "kept": 132, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "words[i] and chars consist of lowercase English letters." ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= words[i].length, chars.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Solve the problem for each string in words independently.", "Now try to think in frequency of letters.", "Count how many times each character occurs in string chars.", "To form a string using characters from chars, the frequency of each character in chars must be greater than or equal the frequency of that character in the string to be formed." ] }, { "question_id": 1161, "task_id": "maximum-level-sum-of-a-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "kth-largest-sum-in-a-binary-tree", "cousins-in-binary-tree-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 88, "kept": 0, "dropped": { "unreadable": 88 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "-10**(5) <= Node.val <= 10**(5)" ] }, { "question_id": 1162, "task_id": "as-far-from-land-as-possible", "drop": [], "similar": [ "shortest-distance-from-all-buildings", "k-highest-ranked-items-within-a-price-range", "maximum-manhattan-distance-after-k-changes" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 62, "kept": 62, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "grid[i][j] is 0 or 1" ], "public_tests": 2, "hints": [ "Can you think of this problem in a backwards way ?", "Imagine expanding outward from each land cell. What kind of search does that ?", "Use BFS starting from all land cells in the same time.", "When do you reach the furthest water cell?" ], "similar_to_test": [ "3443 maximum-manhattan-distance-after-k-changes" ] }, { "question_id": 1163, "task_id": "last-substring-in-lexicographical-order", "drop": [], "similar": [ "find-the-lexicographically-largest-string-from-the-box-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 80, "kept": 79, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 55, "end_line": 55, "violates": [ "s contains only lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Assume that the answer is a sub-string from index i to j. If you add the character at index j+1 you get a better answer.", "The answer is always a suffix of the given string.", "Since the limits are high, we need an efficient data structure.", "Use suffix array." ], "similar_to_test": [ "3403 find-the-lexicographically-largest-string-from-the-box-i" ] }, { "question_id": 1165, "task_id": "single-row-keyboard", "drop": [ "premium" ] }, { "question_id": 1167, "task_id": "minimum-cost-to-connect-sticks", "drop": [ "premium" ] }, { "question_id": 1168, "task_id": "optimize-water-distribution-in-a-village", "drop": [ "premium" ] }, { "question_id": 1169, "task_id": "invalid-transactions", "drop": [], "similar": [], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "transactions" ], "tests": { "total": 78, "kept": 78, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Each transactions[i] takes the form \"{name},{time},{amount},{city}\"", "Each {name} and {city} consist of lowercase English letters, and have lengths between 1 and 10.", "Each {time} consist of digits, and represent an integer between 0 and 1000.", "Each {amount} consist of digits, and represent an integer between 0 and 2000." ], "public_tests": 3, "hints": [ "Split each string into four arrays.", "For each transaction check if it's invalid, you can do this with just a loop with help of the four arrays generated on step 1.", "At the end you perform O(N ^ 2) operations." ] }, { "question_id": 1170, "task_id": "compare-strings-by-frequency-of-the-smallest-character", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "queries", "words" ], "tests": { "total": 100, "kept": 92, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= queries[i].length, words[i].length <= 10" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= queries[i].length, words[i].length <= 10" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= queries[i].length, words[i].length <= 10" ] }, { "line": 64, "end_line": 64, "violates": [ "queries[i][j], words[i][j] consist of lowercase English letters." ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= queries[i].length, words[i].length <= 10" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= queries[i].length, words[i].length <= 10" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= queries[i].length, words[i].length <= 10" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= queries[i].length, words[i].length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each string from words calculate the leading count and store it in an array, then sort the integer array.", "For each string from queries calculate the leading count \"p\" and in base of the sorted array calculated on the step 1 do a binary search to count the number of items greater than \"p\"." ] }, { "question_id": 1171, "task_id": "remove-zero-sum-consecutive-nodes-from-linked-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "delete-n-nodes-after-m-nodes-of-a-linked-list" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 33, "kept": 0, "dropped": { "unreadable": 33 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 113, "end_line": 113, "unreadable": true }, { "line": 114, "end_line": 114, "unreadable": true }, { "line": 120, "end_line": 120, "unreadable": true } ], "unchecked_constraints": [ "The given linked list will contain between 1 and 1000 nodes.", "Each node in the linked list has -1000 <= node.val <= 1000." ] }, { "question_id": 1175, "task_id": "prime-arrangements", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 27, "kept": 27, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Solve the problem for prime numbers and composite numbers separately.", "Multiply the number of permutations of prime numbers over prime indices with the number of permutations of composite numbers over composite indices.", "The number of permutations equals the factorial." ] }, { "question_id": 1176, "task_id": "diet-plan-performance", "drop": [ "premium" ] }, { "question_id": 1177, "task_id": "can-make-palindrome-from-substring", "drop": [], "similar": [ "plates-between-candles", "maximize-the-number-of-partitions-after-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "queries" ], "tests": { "total": 93, "kept": 93, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Since we can rearrange the substring, all we care about is the frequency of each character in that substring.", "How to find the character frequencies efficiently ?", "As a preprocess, calculate the accumulate frequency of all characters for all prefixes of the string.", "How to check if a substring can be changed to a palindrome given its characters frequency ?", "Count the number of odd frequencies, there can be at most one odd frequency in a palindrome." ] }, { "question_id": 1178, "task_id": "number-of-valid-words-for-each-puzzle", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "words", "puzzles" ], "tests": { "total": 68, "kept": 10, "dropped": { "constraint_violation": 58 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "4 <= words[i].length <= 50" ] }, { "line": 5, "end_line": 5, "violates": [ "puzzles[i].length == 7" ] }, { "line": 6, "end_line": 6, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 7, "end_line": 7, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 8, "end_line": 8, "violates": [ "4 <= words[i].length <= 50" ] }, { "line": 9, "end_line": 9, "violates": [ "4 <= words[i].length <= 50" ] }, { "line": 10, "end_line": 10, "violates": [ "4 <= words[i].length <= 50" ] }, { "line": 11, "end_line": 11, "violates": [ "4 <= words[i].length <= 50" ] }, { "line": 12, "end_line": 12, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 14, "end_line": 14, "violates": [ "4 <= words[i].length <= 50" ] }, { "line": 16, "end_line": 16, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 17, "end_line": 17, "violates": [ "puzzles[i].length == 7" ] }, { "line": 18, "end_line": 18, "violates": [ "puzzles[i].length == 7" ] }, { "line": 19, "end_line": 19, "violates": [ "puzzles[i].length == 7" ] }, { "line": 20, "end_line": 20, "violates": [ "4 <= words[i].length <= 50" ] }, { "line": 21, "end_line": 21, "violates": [ "puzzles[i].length == 7" ] }, { "line": 22, "end_line": 22, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 25, "end_line": 25, "violates": [ "puzzles[i].length == 7" ] }, { "line": 26, "end_line": 26, "violates": [ "puzzles[i].length == 7" ] }, { "line": 27, "end_line": 27, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 28, "end_line": 28, "violates": [ "puzzles[i].length == 7" ] }, { "line": 29, "end_line": 29, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 30, "end_line": 30, "violates": [ "4 <= words[i].length <= 50" ] }, { "line": 31, "end_line": 31, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 32, "end_line": 32, "violates": [ "puzzles[i].length == 7" ] }, { "line": 33, "end_line": 33, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 34, "end_line": 34, "violates": [ "puzzles[i].length == 7" ] }, { "line": 35, "end_line": 35, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 36, "end_line": 36, "violates": [ "puzzles[i].length == 7" ] }, { "line": 37, "end_line": 37, "violates": [ "puzzles[i].length == 7" ] }, { "line": 39, "end_line": 39, "violates": [ "puzzles[i].length == 7" ] }, { "line": 40, "end_line": 40, "violates": [ "puzzles[i].length == 7" ] }, { "line": 41, "end_line": 41, "violates": [ "puzzles[i].length == 7" ] }, { "line": 42, "end_line": 42, "violates": [ "puzzles[i].length == 7" ] }, { "line": 43, "end_line": 43, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 44, "end_line": 44, "violates": [ "puzzles[i].length == 7" ] }, { "line": 45, "end_line": 45, "violates": [ "puzzles[i].length == 7" ] }, { "line": 46, "end_line": 46, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 47, "end_line": 47, "violates": [ "puzzles[i].length == 7" ] }, { "line": 49, "end_line": 49, "violates": [ "puzzles[i].length == 7" ] }, { "line": 50, "end_line": 50, "violates": [ "4 <= words[i].length <= 50" ] }, { "line": 51, "end_line": 51, "violates": [ "puzzles[i].length == 7" ] }, { "line": 52, "end_line": 52, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 53, "end_line": 53, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 54, "end_line": 54, "violates": [ "puzzles[i].length == 7" ] }, { "line": 55, "end_line": 55, "violates": [ "puzzles[i].length == 7" ] }, { "line": 57, "end_line": 57, "violates": [ "4 <= words[i].length <= 50" ] }, { "line": 58, "end_line": 58, "violates": [ "4 <= words[i].length <= 50" ] }, { "line": 59, "end_line": 59, "violates": [ "puzzles[i].length == 7" ] }, { "line": 60, "end_line": 60, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 61, "end_line": 61, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 62, "end_line": 62, "violates": [ "puzzles[i].length == 7" ] }, { "line": 63, "end_line": 63, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 64, "end_line": 64, "violates": [ "puzzles[i].length == 7" ] }, { "line": 65, "end_line": 65, "violates": [ "4 <= words[i].length <= 50", "puzzles[i].length == 7" ] }, { "line": 66, "end_line": 66, "violates": [ "4 <= words[i].length <= 50" ] }, { "line": 67, "end_line": 67, "violates": [ "puzzles[i].length == 7" ] }, { "line": 68, "end_line": 68, "violates": [ "puzzles[i].length == 7" ] } ], "unchecked_constraints": [ "Each puzzles[i] does not contain repeated characters." ], "public_tests": 2, "hints": [ "Exploit the fact that the length of the puzzle is only 7.", "Use bit-masks to represent the word and puzzle strings.", "For each puzzle, count the number of words whose bit-mask is a sub-mask of the puzzle's bit-mask." ] }, { "question_id": 1180, "task_id": "count-substrings-with-only-one-distinct-letter", "drop": [ "premium" ] }, { "question_id": 1181, "task_id": "before-and-after-puzzle", "drop": [ "premium" ] }, { "question_id": 1182, "task_id": "shortest-distance-to-target-color", "drop": [ "premium" ] }, { "question_id": 1183, "task_id": "maximum-number-of-ones", "drop": [ "premium" ] }, { "question_id": 1184, "task_id": "distance-between-bus-stops", "drop": [], "similar": [ "minimum-costs-using-the-train-line" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "distance", "start", "destination" ], "tests": { "total": 68, "kept": 68, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the distance between the two stops if the bus moved in clockwise or counterclockwise directions." ] }, { "question_id": 1185, "task_id": "day-of-the-week", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "day", "month", "year" ], "tests": { "total": 19, "kept": 19, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The given dates are valid dates between the years 1971 and 2100." ], "public_tests": 3, "hints": [ "Sum up the number of days for the years before the given year.", "Handle the case of a leap year.", "Find the number of days for each month of the given year." ] }, { "question_id": 1186, "task_id": "maximum-subarray-sum-with-one-deletion", "drop": [], "similar": [ "maximize-subarray-sum-after-removing-all-occurrences-of-one-element", "maximum-unique-subarray-sum-after-deletion" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 139, "kept": 139, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "How to solve this problem if no deletions are allowed ?", "Try deleting each element and find the maximum subarray sum to both sides of that element.", "To do that efficiently, use the idea of Kadane's algorithm." ], "similar_to_test": [ "3410 maximize-subarray-sum-after-removing-all-occurrences-of-one-element", "3487 maximum-unique-subarray-sum-after-deletion" ] }, { "question_id": 1187, "task_id": "make-array-strictly-increasing", "drop": [], "similar": [ "make-array-non-decreasing-or-non-increasing" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr1", "arr2" ], "tests": { "total": 145, "kept": 144, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 48, "end_line": 48, "violates": [ "0 <= arr1[i], arr2[i] <= 10**9" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming.", "The state would be the index in arr1 and the index of the previous element in arr2 after sorting it and removing duplicates." ] }, { "question_id": 1189, "task_id": "maximum-number-of-balloons", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "text" ], "tests": { "total": 117, "kept": 116, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= text.length <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Count the frequency of letters in the given string.", "Find the letter than can make the minimum number of instances of the word \"balloon\"." ] }, { "question_id": 1190, "task_id": "reverse-substrings-between-each-pair-of-parentheses", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 93, "kept": 93, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s only contains lower case English characters and parentheses.", "It is guaranteed that all parentheses are balanced." ], "public_tests": 3, "hints": [ "Find all brackets in the string.", "Does the order of the reverse matter ?", "The order does not matter." ] }, { "question_id": 1191, "task_id": "k-concatenation-maximum-sum", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "k" ], "tests": { "total": 106, "kept": 103, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 26, "end_line": 26, "violates": [ "-10**(4) <= arr[i] <= 10**(4)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= k <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "How to solve the problem for k=1 ?", "Use Kadane's algorithm for k=1.", "What are the possible cases for the answer ?", "The answer is the maximum between, the answer for k=1, the sum of the whole array multiplied by k, or the maximum suffix sum plus the maximum prefix sum plus (k-2) multiplied by the whole array sum for k > 1." ] }, { "question_id": 1192, "task_id": "critical-connections-in-a-network", "drop": [], "similar": [], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "n", "connections" ], "tests": { "total": 71, "kept": 71, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There are no repeated connections." ], "public_tests": 2, "hints": [ "Use Tarjan's algorithm." ] }, { "question_id": 1196, "task_id": "how-many-apples-can-you-put-into-the-basket", "drop": [ "premium" ] }, { "question_id": 1197, "task_id": "minimum-knight-moves", "drop": [ "premium" ] }, { "question_id": 1198, "task_id": "find-smallest-common-element-in-all-rows", "drop": [ "premium" ] }, { "question_id": 1199, "task_id": "minimum-time-to-build-blocks", "drop": [ "premium" ] }, { "question_id": 1200, "task_id": "minimum-absolute-difference", "drop": [], "similar": [ "minimum-cost-of-buying-candies-with-discount", "minimize-the-maximum-difference-of-pairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 101, "kept": 96, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "-10**(6) <= arr[i] <= 10**(6)" ] }, { "line": 37, "end_line": 37, "violates": [ "-10**(6) <= arr[i] <= 10**(6)" ] }, { "line": 38, "end_line": 38, "violates": [ "-10**(6) <= arr[i] <= 10**(6)" ] }, { "line": 59, "end_line": 59, "violates": [ "-10**(6) <= arr[i] <= 10**(6)" ] }, { "line": 83, "end_line": 83, "violates": [ "-10**(6) <= arr[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the minimum absolute difference between two elements in the array.", "The minimum absolute difference must be a difference between two consecutive elements in the sorted array." ] }, { "question_id": 1201, "task_id": "ugly-number-iii", "drop": [], "similar": [ "ugly-number-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "a", "b", "c" ], "tests": { "total": 133, "kept": 123, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= a * b * c <= 10**(18)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= a * b * c <= 10**(18)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= n, a, b, c <= 10**(9)", "1 <= a * b * c <= 10**(18)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= a * b * c <= 10**(18)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= a * b * c <= 10**(18)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= a * b * c <= 10**(18)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= n, a, b, c <= 10**(9)", "1 <= a * b * c <= 10**(18)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= a * b * c <= 10**(18)" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= a * b * c <= 10**(18)" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= a * b * c <= 10**(18)" ] } ], "unchecked_constraints": [ "It is guaranteed that the result will be in range [1, 2 * 10**(9)]." ], "public_tests": 3, "hints": [ "Write a function f(k) to determine how many ugly numbers smaller than k. As f(k) is non-decreasing, try binary search.", "Find all ugly numbers in [1, LCM(a, b, c)] (LCM is Least Common Multiple). Use inclusion-exclusion principle to expand the result." ] }, { "question_id": 1202, "task_id": "smallest-string-with-swaps", "drop": [], "similar": [ "minimize-hamming-distance-after-swap-operations", "process-restricted-friend-requests", "largest-number-after-digit-swaps-by-parity", "lexicographically-smallest-beautiful-string", "make-lexicographically-smallest-array-by-swapping-elements" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "pairs" ], "tests": { "total": 74, "kept": 74, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s only contains lower case English letters." ], "public_tests": 3, "hints": [ "Think of it as a graph problem.", "Consider the pairs as connected nodes in the graph, what can you do with a connected component of indices ?", "We can sort each connected component alone to get the lexicographically minimum string." ] }, { "question_id": 1203, "task_id": "sort-items-by-groups-respecting-dependencies", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "m", "group", "beforeItems" ], "tests": { "total": 72, "kept": 44, "dropped": { "constraint_violation": 28 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 7, "end_line": 7, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 13, "end_line": 13, "violates": [ "group.length == beforeItems.length == n", "i != beforeItems[i][j]" ] }, { "line": 15, "end_line": 15, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 16, "end_line": 16, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 18, "end_line": 18, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 20, "end_line": 20, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 22, "end_line": 22, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 25, "end_line": 25, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 26, "end_line": 26, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 27, "end_line": 27, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 30, "end_line": 30, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 32, "end_line": 32, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 37, "end_line": 37, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 38, "end_line": 38, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 44, "end_line": 44, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 48, "end_line": 48, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 51, "end_line": 51, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 52, "end_line": 52, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 54, "end_line": 54, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 58, "end_line": 58, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 60, "end_line": 60, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 62, "end_line": 62, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 65, "end_line": 65, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 67, "end_line": 67, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 69, "end_line": 69, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 71, "end_line": 71, "violates": [ "i != beforeItems[i][j]" ] }, { "line": 72, "end_line": 72, "violates": [ "group.length == beforeItems.length == n", "i != beforeItems[i][j]" ] } ], "unchecked_constraints": [ "beforeItems[i] does not contain duplicates elements." ], "public_tests": 2, "hints": [ "Think of it as a graph problem.", "We need to find a topological order on the dependency graph.", "Build two graphs, one for the groups and another for the items." ] }, { "question_id": 1207, "task_id": "unique-number-of-occurrences", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 107, "kept": 107, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the number of occurrences of each element in the array using a hash map.", "Iterate through the hash map and check if there is a repeated value." ] }, { "question_id": 1208, "task_id": "get-equal-substrings-within-budget", "drop": [], "similar": [ "longest-nice-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t", "maxCost" ], "tests": { "total": 95, "kept": 87, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "t.length == s.length" ] }, { "line": 38, "end_line": 38, "violates": [ "t.length == s.length" ] }, { "line": 52, "end_line": 52, "violates": [ "t.length == s.length" ] }, { "line": 61, "end_line": 61, "violates": [ "t.length == s.length" ] }, { "line": 66, "end_line": 66, "violates": [ "t.length == s.length" ] }, { "line": 72, "end_line": 72, "violates": [ "t.length == s.length" ] }, { "line": 78, "end_line": 78, "violates": [ "t.length == s.length" ] }, { "line": 83, "end_line": 83, "violates": [ "t.length == s.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Calculate the differences between s[i] and t[i].", "Use a sliding window to track the longest valid substring." ] }, { "question_id": 1209, "task_id": "remove-all-adjacent-duplicates-in-string-ii", "drop": [], "similar": [ "remove-all-adjacent-duplicates-in-string", "replace-non-coprime-numbers-in-array", "minimize-string-length" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 107, "kept": 106, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "2 <= k <= 10**(4)" ] } ], "unchecked_constraints": [ "s only contains lowercase English letters." ], "public_tests": 3, "hints": [ "Use a stack to store the characters, when there are k same characters, delete them.", "To make it more efficient, use a pair to store the value and the count of each character." ] }, { "question_id": 1210, "task_id": "minimum-moves-to-reach-target-with-rotations", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 64, "kept": 64, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "2 <= n <= 100", "It is guaranteed that the snake starts at empty cells." ], "public_tests": 2, "hints": [ "Use BFS to find the answer.", "The state of the BFS is the position (x, y) along with a binary value that specifies if the position is horizontal or vertical." ] }, { "question_id": 1213, "task_id": "intersection-of-three-sorted-arrays", "drop": [ "premium" ] }, { "question_id": 1214, "task_id": "two-sum-bsts", "drop": [ "premium" ] }, { "question_id": 1215, "task_id": "stepping-numbers", "drop": [ "premium" ] }, { "question_id": 1216, "task_id": "valid-palindrome-iii", "drop": [ "premium" ] }, { "question_id": 1217, "task_id": "minimum-cost-to-move-chips-to-the-same-position", "drop": [], "similar": [ "minimum-number-of-operations-to-move-all-balls-to-each-box", "split-with-minimum-sum" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "position" ], "tests": { "total": 105, "kept": 97, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "1 <= position[i] <= 10**9" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= position[i] <= 10**9" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= position[i] <= 10**9" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= position[i] <= 10**9" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= position[i] <= 10**9", "1 <= position[i] <= 10**9" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= position[i] <= 10**9", "1 <= position[i] <= 10**9" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= position[i] <= 10**9" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= position[i] <= 10**9" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The first move keeps the parity of the element as it is.", "The second move changes the parity of the element.", "Since the first move is free, if all the numbers have the same parity, the answer would be zero.", "Find the minimum cost to make all the numbers have the same parity." ] }, { "question_id": 1218, "task_id": "longest-arithmetic-subsequence-of-given-difference", "drop": [], "similar": [ "destroy-sequential-targets" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "difference" ], "tests": { "total": 154, "kept": 153, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 140, "end_line": 140, "violates": [ "-10**(4) <= arr[i], difference <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming.", "Let dp[i] be the maximum length of a subsequence of the given difference whose last element is i.", "dp[i] = 1 + dp[i-k]" ] }, { "question_id": 1219, "task_id": "path-with-maximum-gold", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 99, "kept": 98, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "0 <= grid[i][j] <= 100" ] } ], "unchecked_constraints": [ "There are at most 25 cells containing gold." ], "public_tests": 2, "hints": [ "Use recursion to try all such paths and find the one with the maximum value." ] }, { "question_id": 1220, "task_id": "count-vowels-permutation", "drop": [], "similar": [ "number-of-strings-which-can-be-rearranged-to-contain-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 26, "kept": 25, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= n <= 2 * 10**4" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use dynamic programming.", "Let dp[i][j] be the number of strings of length i that ends with the j-th vowel.", "Deduce the recurrence from the given relations between vowels." ] }, { "question_id": 1221, "task_id": "split-a-string-in-balanced-strings", "drop": [], "similar": [ "split-strings-by-separator" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 118, "kept": 118, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s is a balanced string." ], "public_tests": 3, "hints": [ "Loop from left to right maintaining a balance variable when it gets an L increase it by one otherwise decrease it by one.", "Whenever the balance variable reaches zero then we increase the answer by one." ] }, { "question_id": 1222, "task_id": "queens-that-can-attack-the-king", "drop": [], "similar": [ "minimum-moves-to-capture-the-queen" ], "flags": [ "any_order", "figure_reference", "has_images" ], "comparison": "unordered", "parameter_names": [ "queens", "king" ], "tests": { "total": 102, "kept": 102, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= xQueeni, yQueeni, xKing, yKing < 8", "All the given positions are unique." ], "public_tests": 2, "hints": [ "Check 8 directions around the King.", "Find the nearest queen in each direction." ] }, { "question_id": 1223, "task_id": "dice-roll-simulation", "drop": [], "similar": [ "find-missing-observations", "number-of-distinct-roll-sequences" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "rollMax" ], "tests": { "total": 41, "kept": 41, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think on Dynamic Programming.", "DP(pos, last) which means we are at the position pos having as last the last character seen." ] }, { "question_id": 1224, "task_id": "maximum-equal-frequency", "drop": [], "similar": [ "remove-letter-to-equalize-frequency", "count-submatrices-with-equal-frequency-of-x-and-y" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 104, "kept": 104, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Keep track of the min and max frequencies.", "The number to be eliminated must have a frequency of 1, same as the others or the same +1." ] }, { "question_id": 1227, "task_id": "airplane-seat-assignment-probability", "drop": [], "similar": [], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "n" ], "tests": { "total": 32, "kept": 26, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= n <= 10**(5)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= n <= 10**(5)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= n <= 10**(5)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= n <= 10**(5)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= n <= 10**(5)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= n <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let f(n) denote the probability of the n-th person getting correct seat in n-person case, then: f(1) = 1 (base case, trivial) f(2) = 1/2 (also trivial)", "Try to calculate f(3), f(4), and f(5) using the base cases. What is the value of them? f(i) for i >= 2 will also be 1/2.", "Try to proof why f(i) = 1/2 for i >= 2." ] }, { "question_id": 1228, "task_id": "missing-number-in-arithmetic-progression", "drop": [ "premium" ] }, { "question_id": 1229, "task_id": "meeting-scheduler", "drop": [ "premium" ], "similar_to_test": [ "3439 reschedule-meetings-for-maximum-free-time-i" ] }, { "question_id": 1230, "task_id": "toss-strange-coins", "drop": [ "premium" ] }, { "question_id": 1231, "task_id": "divide-chocolate", "drop": [ "premium" ] }, { "question_id": 1232, "task_id": "check-if-it-is-a-straight-line", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "coordinates" ], "tests": { "total": 125, "kept": 124, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 58, "end_line": 58, "violates": [ "-10**4 <= coordinates[i][0], coordinates[i][1] <= 10**4" ] } ], "unchecked_constraints": [ "coordinates contains no duplicate point." ], "public_tests": 2, "hints": [ "If there're only 2 points, return true.", "Check if all other points lie on the line defined by the first 2 points.", "Use cross product to check collinearity." ] }, { "question_id": 1233, "task_id": "remove-sub-folders-from-the-filesystem", "drop": [], "similar": [], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "folder" ], "tests": { "total": 97, "kept": 53, "dropped": { "constraint_violation": 44 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 18, "end_line": 18, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 19, "end_line": 19, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 21, "end_line": 21, "violates": [ "2 <= folder[i].length <= 100", "folder[i] contains only lowercase letters and '/'." ] }, { "line": 22, "end_line": 22, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 23, "end_line": 23, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 26, "end_line": 26, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 27, "end_line": 27, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 29, "end_line": 29, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 30, "end_line": 30, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 34, "end_line": 34, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 35, "end_line": 35, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 36, "end_line": 36, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 38, "end_line": 38, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 39, "end_line": 39, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 40, "end_line": 40, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 41, "end_line": 41, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 43, "end_line": 43, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 45, "end_line": 45, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 49, "end_line": 49, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 50, "end_line": 50, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 51, "end_line": 51, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 57, "end_line": 57, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 58, "end_line": 58, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 59, "end_line": 59, "violates": [ "2 <= folder[i].length <= 100", "folder[i] contains only lowercase letters and '/'." ] }, { "line": 62, "end_line": 62, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 63, "end_line": 63, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 65, "end_line": 65, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 67, "end_line": 67, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 69, "end_line": 69, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 70, "end_line": 70, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 72, "end_line": 72, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 73, "end_line": 73, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 78, "end_line": 78, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 79, "end_line": 79, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 80, "end_line": 80, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 81, "end_line": 81, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 87, "end_line": 87, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 89, "end_line": 89, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 91, "end_line": 91, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 93, "end_line": 93, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 94, "end_line": 94, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 97, "end_line": 97, "violates": [ "folder[i] contains only lowercase letters and '/'." ] }, { "line": 98, "end_line": 98, "violates": [ "folder[i] contains only lowercase letters and '/'." ] } ], "unchecked_constraints": [ "folder[i] always starts with the character '/'.", "Each folder name is unique." ], "public_tests": 3, "hints": [ "Sort the folders lexicographically.", "Insert the current element in an array and then loop until we get rid of all of their subfolders, repeat this until no element is left." ] }, { "question_id": 1234, "task_id": "replace-the-substring-for-balanced-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 158, "kept": 63, "dropped": { "constraint_violation": 95 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "n is a multiple of 4." ] }, { "line": 5, "end_line": 5, "violates": [ "n is a multiple of 4." ] }, { "line": 6, "end_line": 6, "violates": [ "n is a multiple of 4." ] }, { "line": 8, "end_line": 8, "violates": [ "n is a multiple of 4." ] }, { "line": 17, "end_line": 17, "violates": [ "n is a multiple of 4." ] }, { "line": 20, "end_line": 20, "violates": [ "n is a multiple of 4." ] }, { "line": 21, "end_line": 21, "violates": [ "n is a multiple of 4." ] }, { "line": 26, "end_line": 26, "violates": [ "n is a multiple of 4." ] }, { "line": 28, "end_line": 28, "violates": [ "n is a multiple of 4." ] }, { "line": 31, "end_line": 31, "violates": [ "n is a multiple of 4." ] }, { "line": 32, "end_line": 32, "violates": [ "n is a multiple of 4." ] }, { "line": 33, "end_line": 33, "violates": [ "n is a multiple of 4." ] }, { "line": 34, "end_line": 34, "violates": [ "n is a multiple of 4." ] }, { "line": 36, "end_line": 36, "violates": [ "n is a multiple of 4." ] }, { "line": 37, "end_line": 37, "violates": [ "n is a multiple of 4." ] }, { "line": 38, "end_line": 38, "violates": [ "n is a multiple of 4." ] }, { "line": 39, "end_line": 39, "violates": [ "n is a multiple of 4." ] }, { "line": 40, "end_line": 40, "violates": [ "n is a multiple of 4." ] }, { "line": 41, "end_line": 41, "violates": [ "n is a multiple of 4." ] }, { "line": 42, "end_line": 42, "violates": [ "n is a multiple of 4." ] }, { "line": 43, "end_line": 43, "violates": [ "n is a multiple of 4." ] }, { "line": 44, "end_line": 44, "violates": [ "n is a multiple of 4." ] }, { "line": 46, "end_line": 46, "violates": [ "n is a multiple of 4." ] }, { "line": 48, "end_line": 48, "violates": [ "n is a multiple of 4." ] }, { "line": 50, "end_line": 50, "violates": [ "n is a multiple of 4." ] }, { "line": 53, "end_line": 53, "violates": [ "n is a multiple of 4." ] }, { "line": 55, "end_line": 55, "violates": [ "n is a multiple of 4." ] }, { "line": 57, "end_line": 57, "violates": [ "n is a multiple of 4." ] }, { "line": 58, "end_line": 58, "violates": [ "n is a multiple of 4." ] }, { "line": 59, "end_line": 59, "violates": [ "n is a multiple of 4." ] }, { "line": 60, "end_line": 60, "violates": [ "n is a multiple of 4." ] }, { "line": 61, "end_line": 61, "violates": [ "n is a multiple of 4." ] }, { "line": 63, "end_line": 63, "violates": [ "n is a multiple of 4." ] }, { "line": 64, "end_line": 64, "violates": [ "n is a multiple of 4." ] }, { "line": 65, "end_line": 65, "violates": [ "n is a multiple of 4." ] }, { "line": 66, "end_line": 66, "violates": [ "n is a multiple of 4." ] }, { "line": 68, "end_line": 68, "violates": [ "n is a multiple of 4." ] }, { "line": 69, "end_line": 69, "violates": [ "n is a multiple of 4." ] }, { "line": 70, "end_line": 70, "violates": [ "n is a multiple of 4." ] }, { "line": 71, "end_line": 71, "violates": [ "n is a multiple of 4." ] }, { "line": 73, "end_line": 73, "violates": [ "n is a multiple of 4." ] }, { "line": 74, "end_line": 74, "violates": [ "n is a multiple of 4." ] }, { "line": 75, "end_line": 75, "violates": [ "n is a multiple of 4." ] }, { "line": 76, "end_line": 76, "violates": [ "n is a multiple of 4." ] }, { "line": 77, "end_line": 77, "violates": [ "n is a multiple of 4." ] }, { "line": 78, "end_line": 78, "violates": [ "n is a multiple of 4." ] }, { "line": 79, "end_line": 79, "violates": [ "n is a multiple of 4." ] }, { "line": 80, "end_line": 80, "violates": [ "n is a multiple of 4." ] }, { "line": 81, "end_line": 81, "violates": [ "n is a multiple of 4." ] }, { "line": 82, "end_line": 82, "violates": [ "n is a multiple of 4." ] }, { "line": 83, "end_line": 83, "violates": [ "n is a multiple of 4." ] }, { "line": 85, "end_line": 85, "violates": [ "n is a multiple of 4." ] }, { "line": 88, "end_line": 88, "violates": [ "n is a multiple of 4." ] }, { "line": 89, "end_line": 89, "violates": [ "n is a multiple of 4." ] }, { "line": 92, "end_line": 92, "violates": [ "n is a multiple of 4." ] }, { "line": 96, "end_line": 96, "violates": [ "n is a multiple of 4." ] }, { "line": 98, "end_line": 98, "violates": [ "n is a multiple of 4." ] }, { "line": 99, "end_line": 99, "violates": [ "n is a multiple of 4." ] }, { "line": 100, "end_line": 100, "violates": [ "n is a multiple of 4." ] }, { "line": 102, "end_line": 102, "violates": [ "n is a multiple of 4." ] }, { "line": 103, "end_line": 103, "violates": [ "n is a multiple of 4." ] }, { "line": 104, "end_line": 104, "violates": [ "n is a multiple of 4." ] }, { "line": 105, "end_line": 105, "violates": [ "n is a multiple of 4." ] }, { "line": 106, "end_line": 106, "violates": [ "n is a multiple of 4." ] }, { "line": 107, "end_line": 107, "violates": [ "n is a multiple of 4." ] }, { "line": 109, "end_line": 109, "violates": [ "n is a multiple of 4." ] }, { "line": 110, "end_line": 110, "violates": [ "n is a multiple of 4." ] }, { "line": 111, "end_line": 111, "violates": [ "n is a multiple of 4." ] }, { "line": 113, "end_line": 113, "violates": [ "n is a multiple of 4." ] }, { "line": 115, "end_line": 115, "violates": [ "n is a multiple of 4." ] }, { "line": 116, "end_line": 116, "violates": [ "n is a multiple of 4." ] }, { "line": 117, "end_line": 117, "violates": [ "n is a multiple of 4." ] }, { "line": 118, "end_line": 118, "violates": [ "n is a multiple of 4." ] }, { "line": 119, "end_line": 119, "violates": [ "n is a multiple of 4." ] }, { "line": 121, "end_line": 121, "violates": [ "n is a multiple of 4." ] }, { "line": 122, "end_line": 122, "violates": [ "n is a multiple of 4." ] }, { "line": 123, "end_line": 123, "violates": [ "n is a multiple of 4." ] }, { "line": 124, "end_line": 124, "violates": [ "n is a multiple of 4." ] }, { "line": 125, "end_line": 125, "violates": [ "n is a multiple of 4." ] }, { "line": 129, "end_line": 129, "violates": [ "n is a multiple of 4." ] }, { "line": 130, "end_line": 130, "violates": [ "n is a multiple of 4." ] }, { "line": 131, "end_line": 131, "violates": [ "n is a multiple of 4." ] }, { "line": 132, "end_line": 132, "violates": [ "n is a multiple of 4." ] }, { "line": 134, "end_line": 134, "violates": [ "n is a multiple of 4." ] }, { "line": 135, "end_line": 135, "violates": [ "n is a multiple of 4." ] }, { "line": 139, "end_line": 139, "violates": [ "n is a multiple of 4." ] }, { "line": 142, "end_line": 142, "violates": [ "n is a multiple of 4." ] }, { "line": 145, "end_line": 145, "violates": [ "n is a multiple of 4." ] }, { "line": 147, "end_line": 147, "violates": [ "n is a multiple of 4." ] }, { "line": 149, "end_line": 149, "violates": [ "n is a multiple of 4." ] }, { "line": 151, "end_line": 151, "violates": [ "n is a multiple of 4." ] }, { "line": 153, "end_line": 153, "violates": [ "n is a multiple of 4." ] }, { "line": 157, "end_line": 157, "violates": [ "n is a multiple of 4." ] }, { "line": 158, "end_line": 158, "violates": [ "n is a multiple of 4." ] }, { "line": 159, "end_line": 159, "violates": [ "n is a multiple of 4." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use 2-pointers algorithm to make sure all amount of characters outside the 2 pointers are smaller or equal to n/4.", "That means you need to count the amount of each letter and make sure the amount is enough." ] }, { "question_id": 1235, "task_id": "maximum-profit-in-job-scheduling", "drop": [], "similar": [ "maximum-earnings-from-taxi", "two-best-non-overlapping-events" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "startTime", "endTime", "profit" ], "tests": { "total": 92, "kept": 81, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= startTime[i] < endTime[i] <= 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= startTime[i] < endTime[i] <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= startTime[i] < endTime[i] <= 10**(9)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= profit[i] <= 10**(4)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= startTime[i] < endTime[i] <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= startTime[i] < endTime[i] <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= startTime[i] < endTime[i] <= 10**(9)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= profit[i] <= 10**(4)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= startTime[i] < endTime[i] <= 10**(9)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= startTime[i] < endTime[i] <= 10**(9)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= profit[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think on DP.", "Sort the elements by starting time, then define the dp[i] as the maximum profit taking elements from the suffix starting at i.", "Use binarySearch (lower_bound/upper_bound on C++) to get the next index for the DP transition." ] }, { "question_id": 1238, "task_id": "circular-permutation-in-binary-representation", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "start" ], "tests": { "total": 55, "kept": 55, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use gray code to generate a n-bit sequence.", "Rotate the sequence such that its first element is start." ] }, { "question_id": 1239, "task_id": "maximum-length-of-a-concatenated-string-with-unique-characters", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 87, "kept": 68, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= arr[i].length <= 26" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= arr.length <= 16", "1 <= arr.length <= 16" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= arr.length <= 16", "1 <= arr.length <= 16" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= arr[i].length <= 26" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= arr.length <= 16" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= arr[i].length <= 26" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "You can try all combinations and keep mask of characters you have.", "You can use DP." ] }, { "question_id": 1240, "task_id": "tiling-a-rectangle-with-the-fewest-squares", "drop": [], "similar": [ "selling-pieces-of-wood" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "m" ], "tests": { "total": 66, "kept": 57, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= n, m <= 13" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= n, m <= 13" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= n, m <= 13" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= n, m <= 13" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= n, m <= 13" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= n, m <= 13" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= n, m <= 13" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= n, m <= 13" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= n, m <= 13" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can you use backtracking to solve this problem ?.", "Suppose you've placed a bunch of squares. Where is the natural spot to place the next square ?.", "The maximum number of squares to be placed will be \u2264 max(n,m)." ] }, { "question_id": 1242, "task_id": "web-crawler-multithreaded", "drop": [ "premium" ] }, { "question_id": 1243, "task_id": "array-transformation", "drop": [ "premium" ] }, { "question_id": 1245, "task_id": "tree-diameter", "drop": [ "premium" ] }, { "question_id": 1246, "task_id": "palindrome-removal", "drop": [ "premium" ] }, { "question_id": 1247, "task_id": "minimum-swaps-to-make-strings-equal", "drop": [], "similar": [ "determine-if-two-strings-are-close", "make-number-of-distinct-characters-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "s2" ], "tests": { "total": 103, "kept": 103, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s1, s2 only contain 'x' or 'y'." ], "public_tests": 3, "hints": [ "First, ignore all the already matched positions, they don't affect the answer at all. For the unmatched positions, there are three basic cases (already given in the examples):", "(\"xx\", \"yy\") => 1 swap, (\"xy\", \"yx\") => 2 swaps", "So the strategy is, apply case 1 as much as possible, then apply case 2 if the last two unmatched are in this case, or fall into impossible if only one pair of unmatched left. This can be done via a simple math." ] }, { "question_id": 1248, "task_id": "count-number-of-nice-subarrays", "drop": [], "similar": [ "k-divisible-elements-subarrays", "count-subarrays-with-fixed-bounds", "ways-to-split-array-into-good-subarrays", "count-of-interesting-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 68, "kept": 60, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= k <= nums.length" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= k <= nums.length" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= k <= nums.length" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= nums[i] <= 10**5" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10**5" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= k <= nums.length" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= k <= nums.length" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 10**5" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "After replacing each even by zero and every odd by one can we use prefix sum to find answer ?", "Can we use two pointers to count number of sub-arrays ?", "Can we store the indices of odd numbers and for each k indices count the number of sub-arrays that contains them ?" ] }, { "question_id": 1249, "task_id": "minimum-remove-to-make-valid-parentheses", "drop": [], "similar": [ "minimum-number-of-swaps-to-make-the-string-balanced", "check-if-a-parentheses-string-can-be-valid" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 77, "kept": 76, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= s.length <= 10**(5)" ] } ], "unchecked_constraints": [ "s[i] is either '(' , ')', or lowercase English letter." ], "public_tests": 3, "hints": [ "Each prefix of a balanced parentheses has a number of open parentheses greater or equal than closed parentheses, similar idea with each suffix.", "Check the array from left to right, remove characters that do not meet the property mentioned above, same idea in backward way." ] }, { "question_id": 1250, "task_id": "check-if-it-is-a-good-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 138, "kept": 128, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10**9" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 10**9" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 10**9" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 10**9" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 10**9" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 10**9" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 10**9" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums[i] <= 10**9" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= nums[i] <= 10**9" ] }, { "line": 133, "end_line": 133, "violates": [ "1 <= nums[i] <= 10**9" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Eq. ax+by=1 has solution x, y if gcd(a,b) = 1.", "Can you generalize the formula?. Check B\u00e9zout's lemma." ] }, { "question_id": 1252, "task_id": "cells-with-odd-values-in-a-matrix", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n", "indices" ], "tests": { "total": 75, "kept": 75, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simulation : With small constraints, it is possible to apply changes to each row and column and count odd cells after applying it.", "You can accumulate the number you should add to each row and column and then you can count the number of odd cells." ] }, { "question_id": 1253, "task_id": "reconstruct-a-2-row-binary-matrix", "drop": [], "similar": [ "find-valid-matrix-given-row-and-column-sums" ], "flags": [], "comparison": "exact", "parameter_names": [ "upper", "lower", "colsum" ], "tests": { "total": 72, "kept": 72, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "You cannot do anything about colsum[i] = 2 case or colsum[i] = 0 case. Then you put colsum[i] = 1 case to the upper row until upper has reached. Then put the rest into lower row.", "Fill 0 and 2 first, then fill 1 in the upper row or lower row in turn but be careful about exhausting permitted 1s in each row." ] }, { "question_id": 1254, "task_id": "number-of-closed-islands", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 63, "kept": 63, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Exclude connected group of 0s on the corners because they are not closed island.", "Return number of connected component of 0s on the grid." ] }, { "question_id": 1255, "task_id": "maximum-score-words-formed-by-letters", "drop": [], "similar": [ "maximum-good-people-based-on-statements" ], "flags": [], "comparison": "exact", "parameter_names": [ "words", "letters", "score" ], "tests": { "total": 76, "kept": 51, "dropped": { "constraint_violation": 25 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= words[i].length <= 15", "0 <= score[i] <= 10" ] }, { "line": 6, "end_line": 6, "violates": [ "score.length == 26" ] }, { "line": 10, "end_line": 10, "violates": [ "0 <= score[i] <= 10" ] }, { "line": 12, "end_line": 12, "violates": [ "0 <= score[i] <= 10" ] }, { "line": 15, "end_line": 15, "violates": [ "0 <= score[i] <= 10" ] }, { "line": 18, "end_line": 18, "violates": [ "0 <= score[i] <= 10" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= score[i] <= 10" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= score[i] <= 10" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= score[i] <= 10" ] }, { "line": 36, "end_line": 36, "violates": [ "score.length == 26" ] }, { "line": 40, "end_line": 40, "violates": [ "score.length == 26" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= score[i] <= 10" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= score[i] <= 10" ] }, { "line": 48, "end_line": 48, "violates": [ "score.length == 26" ] }, { "line": 51, "end_line": 51, "violates": [ "score.length == 26" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= score[i] <= 10" ] }, { "line": 53, "end_line": 53, "violates": [ "score.length == 26" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= words[i].length <= 15" ] }, { "line": 60, "end_line": 60, "violates": [ "score.length == 26" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= score[i] <= 10" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= words.length <= 14", "0 <= score[i] <= 10" ] }, { "line": 65, "end_line": 65, "violates": [ "score.length == 26" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= score[i] <= 10" ] }, { "line": 72, "end_line": 72, "violates": [ "0 <= score[i] <= 10" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= score[i] <= 10" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Note that words.length is small. This means you can iterate over every subset of words (2^N)." ] }, { "question_id": 1256, "task_id": "encode-number", "drop": [ "premium" ] }, { "question_id": 1257, "task_id": "smallest-common-region", "drop": [ "premium" ] }, { "question_id": 1258, "task_id": "synonymous-sentences", "drop": [ "premium" ] }, { "question_id": 1259, "task_id": "handshakes-that-dont-cross", "drop": [ "premium" ] }, { "question_id": 1260, "task_id": "shift-2d-grid", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid", "k" ], "tests": { "total": 84, "kept": 80, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "-1000 <= grid[i][j] <= 1000" ] }, { "line": 30, "end_line": 30, "violates": [ "-1000 <= grid[i][j] <= 1000" ] }, { "line": 55, "end_line": 55, "violates": [ "-1000 <= grid[i][j] <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "-1000 <= grid[i][j] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Simulate step by step. move grid[i][j] to grid[i][j+1]. handle last column of the grid.", "Put the matrix row by row to a vector. take k % vector.length and move last k of the vector to the beginning. put the vector to the matrix back the same way." ] }, { "question_id": 1262, "task_id": "greatest-sum-divisible-by-three", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 139, "kept": 127, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= 10**(4)", "1 <= nums[i] <= 10**(4)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 10**(4)", "1 <= nums[i] <= 10**(4)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 125, "end_line": 125, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Represent the state as DP[pos][mod]: maximum possible sum starting in the position \"pos\" in the array where the current sum modulo 3 is equal to mod." ] }, { "question_id": 1263, "task_id": "minimum-moves-to-move-a-box-to-their-target-location", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 82, "kept": 72, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "n == grid[i].length" ] }, { "line": 19, "end_line": 19, "violates": [ "n == grid[i].length" ] }, { "line": 26, "end_line": 26, "violates": [ "n == grid[i].length" ] }, { "line": 40, "end_line": 40, "violates": [ "n == grid[i].length" ] }, { "line": 50, "end_line": 50, "violates": [ "n == grid[i].length" ] }, { "line": 52, "end_line": 52, "violates": [ "n == grid[i].length" ] }, { "line": 57, "end_line": 57, "violates": [ "n == grid[i].length" ] }, { "line": 66, "end_line": 66, "violates": [ "n == grid[i].length" ] }, { "line": 73, "end_line": 73, "violates": [ "n == grid[i].length" ] }, { "line": 74, "end_line": 74, "violates": [ "n == grid[i].length" ] } ], "unchecked_constraints": [ "There is only one character 'S', 'B', and 'T' in the grid." ], "public_tests": 3, "hints": [ "We represent the search state as (player_row, player_col, box_row, box_col).", "You need to count only the number of pushes. Then inside of your BFS check if the box could be pushed (in any direction) given the current position of the player." ] }, { "question_id": 1266, "task_id": "minimum-time-visiting-all-points", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "points" ], "tests": { "total": 120, "kept": 120, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "To walk from point A to point B there will be an optimal strategy to walk ?", "Advance in diagonal as possible then after that go in straight line.", "Repeat the process until visiting all the points." ] }, { "question_id": 1267, "task_id": "count-servers-that-communicate", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 50, "kept": 50, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Store number of computer in each row and column.", "Count all servers that are not isolated." ] }, { "question_id": 1268, "task_id": "search-suggestions-system", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "products", "searchWord" ], "tests": { "total": 109, "kept": 83, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "All the strings of products are unique." ] }, { "line": 30, "end_line": 30, "violates": [ "products[i] consists of lowercase English letters." ] }, { "line": 34, "end_line": 34, "violates": [ "All the strings of products are unique." ] }, { "line": 38, "end_line": 38, "violates": [ "All the strings of products are unique." ] }, { "line": 39, "end_line": 39, "violates": [ "All the strings of products are unique." ] }, { "line": 43, "end_line": 43, "violates": [ "All the strings of products are unique." ] }, { "line": 49, "end_line": 49, "violates": [ "All the strings of products are unique." ] }, { "line": 51, "end_line": 51, "violates": [ "All the strings of products are unique." ] }, { "line": 55, "end_line": 55, "violates": [ "All the strings of products are unique." ] }, { "line": 57, "end_line": 57, "violates": [ "All the strings of products are unique." ] }, { "line": 58, "end_line": 58, "violates": [ "All the strings of products are unique." ] }, { "line": 64, "end_line": 64, "violates": [ "All the strings of products are unique." ] }, { "line": 69, "end_line": 69, "violates": [ "All the strings of products are unique." ] }, { "line": 72, "end_line": 72, "violates": [ "All the strings of products are unique." ] }, { "line": 73, "end_line": 73, "violates": [ "All the strings of products are unique." ] }, { "line": 77, "end_line": 77, "violates": [ "All the strings of products are unique." ] }, { "line": 78, "end_line": 78, "violates": [ "All the strings of products are unique." ] }, { "line": 83, "end_line": 83, "violates": [ "All the strings of products are unique." ] }, { "line": 88, "end_line": 88, "violates": [ "All the strings of products are unique." ] }, { "line": 89, "end_line": 89, "violates": [ "All the strings of products are unique." ] }, { "line": 93, "end_line": 93, "violates": [ "All the strings of products are unique." ] }, { "line": 94, "end_line": 94, "violates": [ "All the strings of products are unique." ] }, { "line": 98, "end_line": 98, "violates": [ "All the strings of products are unique." ] }, { "line": 102, "end_line": 102, "violates": [ "All the strings of products are unique." ] }, { "line": 108, "end_line": 108, "violates": [ "All the strings of products are unique." ] }, { "line": 109, "end_line": 109, "violates": [ "All the strings of products are unique." ] } ], "unchecked_constraints": [ "1 <= sum(products[i].length) <= 2 * 10**(4)" ], "public_tests": 2, "hints": [ "Brute force is a good choice because length of the string is \u2264 1000.", "Binary search the answer.", "Use Trie data structure to store the best three matching. Traverse the Trie." ] }, { "question_id": 1269, "task_id": "number-of-ways-to-stay-in-the-same-place-after-some-steps", "drop": [], "similar": [ "number-of-ways-to-reach-a-position-after-exactly-k-steps" ], "flags": [], "comparison": "exact", "parameter_names": [ "steps", "arrLen" ], "tests": { "total": 65, "kept": 65, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try with Dynamic programming, dp(pos,steps): number of ways to back pos = 0 using exactly \"steps\" moves.", "Notice that the computational complexity does not depend of \"arrlen\"." ] }, { "question_id": 1271, "task_id": "hexspeak", "drop": [ "premium" ] }, { "question_id": 1272, "task_id": "remove-interval", "drop": [ "premium" ] }, { "question_id": 1273, "task_id": "delete-tree-nodes", "drop": [ "premium" ] }, { "question_id": 1275, "task_id": "find-winner-on-a-tic-tac-toe-game", "drop": [], "similar": [ "categorize-box-according-to-criteria" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "moves" ], "tests": { "total": 114, "kept": 114, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There are no repeated elements on moves.", "moves follow the rules of tic tac toe." ], "public_tests": 3, "hints": [ "It's straightforward to check if A or B won or not, check for each row/column/diag if all the three are the same.", "Then if no one wins, the game is a draw iff the board is full, i.e. moves.length = 9 otherwise is pending." ] }, { "question_id": 1276, "task_id": "number-of-burgers-with-no-waste-of-ingredients", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "tomatoSlices", "cheeseSlices" ], "tests": { "total": 73, "kept": 69, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "0 <= tomatoSlices, cheeseSlices <= 10**(7)" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= tomatoSlices, cheeseSlices <= 10**(7)" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= tomatoSlices, cheeseSlices <= 10**(7)" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= tomatoSlices, cheeseSlices <= 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we have an answer if the number of tomatoes is odd ?", "If we have answer will be there multiple answers or just one answer ?", "Let us define number of jumbo burgers as X and number of small burgers as Y We have to find an x and y in this equation", "1. 4X + 2Y = tomato", "2. X + Y = cheese" ] }, { "question_id": 1277, "task_id": "count-square-submatrices-with-all-ones", "drop": [], "similar": [ "minimum-cost-homecoming-of-a-robot-in-a-grid", "count-fertile-pyramids-in-a-land" ], "flags": [], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 67, "kept": 67, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= arr.length <= 300", "1 <= arr[0].length <= 300", "0 <= arr[i][j] <= 1" ], "public_tests": 2, "hints": [ "Create an additive table that counts the sum of elements of submatrix with the superior corner at (0,0).", "Loop over all subsquares in O(n^3) and check if the sum make the whole array to be ones, if it checks then add 1 to the answer." ] }, { "question_id": 1278, "task_id": "palindrome-partitioning-iii", "drop": [], "similar": [ "palindrome-partitioning-iv", "maximum-number-of-non-overlapping-palindrome-substrings", "minimum-changes-to-make-k-semi-palindromes" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 89, "kept": 89, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s only contains lowercase English letters." ], "public_tests": 3, "hints": [ "For each substring calculate the minimum number of steps to make it palindrome and store it in a table.", "Create a dp(pos, cnt) which means the minimum number of characters changed for the suffix of s starting on pos splitting the suffix on cnt chunks." ] }, { "question_id": 1281, "task_id": "subtract-the-product-and-sum-of-digits-of-an-integer", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 55, "kept": 42, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= n <= 10**5" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= n <= 10**5" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= n <= 10**5" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= n <= 10**5" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= n <= 10**5" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= n <= 10**5" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= n <= 10**5" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= n <= 10**5" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= n <= 10**5" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= n <= 10**5" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= n <= 10**5" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= n <= 10**5" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= n <= 10**5" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How to compute all digits of the number ?", "Use modulus operator (%) to compute the last digit.", "Generalise modulus operator idea to compute all digits." ] }, { "question_id": 1282, "task_id": "group-the-people-given-the-group-size-they-belong-to", "drop": [], "similar": [ "rabbits-in-forest", "maximum-number-of-groups-with-increasing-length" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "groupSizes" ], "tests": { "total": 83, "kept": 83, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Put people's IDs with same groupSize into buckets, then split each bucket into groups.", "Greedy fill until you need a new group." ] }, { "question_id": 1283, "task_id": "find-the-smallest-divisor-given-a-threshold", "drop": [], "similar": [ "minimized-maximum-of-products-distributed-to-any-store" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "threshold" ], "tests": { "total": 81, "kept": 56, "dropped": { "constraint_violation": 25 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 7, "end_line": 7, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= nums[i] <= 10**(6)", "nums.length <= threshold <= 10**(6)" ] }, { "line": 19, "end_line": 19, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 26, "end_line": 26, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 27, "end_line": 27, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 10**(6)", "nums.length <= threshold <= 10**(6)" ] }, { "line": 30, "end_line": 30, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 34, "end_line": 34, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 39, "end_line": 39, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 40, "end_line": 40, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 45, "end_line": 45, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 47, "end_line": 47, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 53, "end_line": 53, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 10**(6)", "nums.length <= threshold <= 10**(6)" ] }, { "line": 59, "end_line": 59, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 61, "end_line": 61, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 68, "end_line": 68, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 69, "end_line": 69, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 70, "end_line": 70, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 71, "end_line": 71, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 73, "end_line": 73, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 76, "end_line": 76, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 77, "end_line": 77, "violates": [ "nums.length <= threshold <= 10**(6)" ] }, { "line": 81, "end_line": 81, "violates": [ "nums.length <= threshold <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Examine every possible number for solution. Choose the largest of them.", "Use binary search to reduce the time complexity." ] }, { "question_id": 1284, "task_id": "minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix", "drop": [], "similar": [ "minimum-operations-to-remove-adjacent-ones-in-matrix", "remove-all-ones-with-row-and-column-flips", "remove-all-ones-with-row-and-column-flips-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat" ], "tests": { "total": 53, "kept": 20, "dropped": { "constraint_violation": 33 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= m, n <= 3" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= m, n <= 3" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= m, n <= 3" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= m, n <= 3" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= m, n <= 3" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= m, n <= 3" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= m, n <= 3" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= m, n <= 3" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= m, n <= 3" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= m, n <= 3" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= m, n <= 3" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= m, n <= 3" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= m, n <= 3" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= m, n <= 3" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= m, n <= 3" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= m, n <= 3" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= m, n <= 3" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= m, n <= 3" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= m, n <= 3" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= m, n <= 3" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= m, n <= 3" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= m, n <= 3" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= m, n <= 3" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= m, n <= 3" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= m, n <= 3" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= m, n <= 3" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= m, n <= 3" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= m, n <= 3" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= m, n <= 3" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= m, n <= 3" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= m, n <= 3" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= m, n <= 3" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= m, n <= 3" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Flipping same index two times is like not flipping it at all. Each index can be flipped one time. Try all possible combinations. O(2^(n*m))." ] }, { "question_id": 1287, "task_id": "element-appearing-more-than-25-in-sorted-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 83, "kept": 83, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Divide the array in four parts [1 - 25%] [25 - 50 %] [50 - 75 %] [75% - 100%]", "The answer should be in one of the ends of the intervals.", "In order to check which is element is the answer we can count the frequency with binarySearch." ] }, { "question_id": 1288, "task_id": "remove-covered-intervals", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "intervals" ], "tests": { "total": 111, "kept": 105, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "0 <= li < ri <= 10**(5)" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= li < ri <= 10**(5)" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= li < ri <= 10**(5)" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= li < ri <= 10**(5)" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= li < ri <= 10**(5)" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= li < ri <= 10**(5)" ] } ], "unchecked_constraints": [ "All the given intervals are unique." ], "public_tests": 2, "hints": [ "How to check if an interval is covered by another?", "Compare each interval to all others and check if it is covered by any interval." ] }, { "question_id": 1289, "task_id": "minimum-falling-path-sum-ii", "drop": [], "similar": [ "minimum-falling-path-sum" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 83, "kept": 62, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "-99 <= grid[i][j] <= 99" ] }, { "line": 15, "end_line": 15, "violates": [ "-99 <= grid[i][j] <= 99" ] }, { "line": 19, "end_line": 19, "violates": [ "-99 <= grid[i][j] <= 99" ] }, { "line": 21, "end_line": 21, "violates": [ "-99 <= grid[i][j] <= 99" ] }, { "line": 22, "end_line": 22, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 28, "end_line": 28, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 32, "end_line": 32, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 38, "end_line": 38, "violates": [ "-99 <= grid[i][j] <= 99" ] }, { "line": 43, "end_line": 43, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 48, "end_line": 48, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 52, "end_line": 52, "violates": [ "-99 <= grid[i][j] <= 99" ] }, { "line": 54, "end_line": 54, "violates": [ "-99 <= grid[i][j] <= 99" ] }, { "line": 56, "end_line": 56, "violates": [ "-99 <= grid[i][j] <= 99" ] }, { "line": 57, "end_line": 57, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 61, "end_line": 61, "violates": [ "-99 <= grid[i][j] <= 99" ] }, { "line": 63, "end_line": 63, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 66, "end_line": 66, "violates": [ "n == grid.length == grid[i].length", "-99 <= grid[i][j] <= 99" ] }, { "line": 67, "end_line": 67, "violates": [ "-99 <= grid[i][j] <= 99" ] }, { "line": 73, "end_line": 73, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 75, "end_line": 75, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 78, "end_line": 78, "violates": [ "-99 <= grid[i][j] <= 99" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use dynamic programming.", "Let dp[i][j] be the answer for the first i rows such that column j is chosen from row i.", "Use the concept of cumulative array to optimize the complexity of the solution." ] }, { "question_id": 1290, "task_id": "convert-binary-number-in-a-linked-list-to-integer", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 61, "kept": 0, "dropped": { "unreadable": 61 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true } ], "unchecked_constraints": [ "The Linked List is not empty.", "Number of nodes will not exceed 30.", "Each node's value is either 0 or 1." ] }, { "question_id": 1291, "task_id": "sequential-digits", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "low", "high" ], "tests": { "total": 88, "kept": 85, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "10 <= low <= high <= 10**9" ] }, { "line": 15, "end_line": 15, "violates": [ "10 <= low <= high <= 10**9" ] }, { "line": 34, "end_line": 34, "violates": [ "10 <= low <= high <= 10**9" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Generate all numbers with sequential digits and check if they are in the given range.", "Fix the starting digit then do a recursion that tries to append all valid digits." ] }, { "question_id": 1292, "task_id": "maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat", "threshold" ], "tests": { "total": 85, "kept": 85, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Store prefix sum of all grids in another 2D array.", "Try all possible solutions and if you cannot find one return 0.", "If x is a valid answer then any y < x is also valid answer. Use binary search to find answer." ] }, { "question_id": 1293, "task_id": "shortest-path-in-a-grid-with-obstacles-elimination", "drop": [], "similar": [ "shortest-path-to-get-food", "minimum-obstacle-removal-to-reach-corner", "find-a-safe-walk-through-a-grid" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid", "k" ], "tests": { "total": 75, "kept": 70, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "grid[0][0] == grid[m - 1][n - 1] == 0" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= k <= m * n" ] }, { "line": 33, "end_line": 33, "violates": [ "grid[0][0] == grid[m - 1][n - 1] == 0" ] }, { "line": 52, "end_line": 52, "violates": [ "grid[0][0] == grid[m - 1][n - 1] == 0" ] }, { "line": 61, "end_line": 61, "violates": [ "grid[0][0] == grid[m - 1][n - 1] == 0" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use BFS.", "BFS on (x,y,r) x,y is coordinate, r is remain number of obstacles you can remove." ], "similar_to_test": [ "3286 find-a-safe-walk-through-a-grid" ] }, { "question_id": 1295, "task_id": "find-numbers-with-even-number-of-digits", "drop": [], "similar": [ "finding-3-digit-even-numbers", "number-of-even-and-odd-bits", "find-if-digit-game-can-be-won" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 110, "kept": 28, "dropped": { "constraint_violation": 82 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= nums[i] <= 10**(5)", "1 <= nums[i] <= 10**(5)" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i] <= 10**(5)", "1 <= nums[i] <= 10**(5)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How to compute the number of digits of a number ?", "Divide the number by 10 again and again to get the number of digits." ] }, { "question_id": 1296, "task_id": "divide-array-in-sets-of-k-consecutive-numbers", "drop": [], "similar": [ "split-array-into-consecutive-subsequences", "all-divisions-with-the-highest-score-of-a-binary-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 90, "kept": 90, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If the smallest number in the possible-to-split array is V, then numbers V+1, V+2, ... V+k-1 must contain there as well.", "You can iteratively find k sets and remove them from array until it becomes empty.", "Failure to do so would mean that array is unsplittable." ] }, { "question_id": 1297, "task_id": "maximum-number-of-occurrences-of-a-substring", "drop": [], "similar": [ "rearrange-characters-to-make-target-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "maxLetters", "minSize", "maxSize" ], "tests": { "total": 117, "kept": 114, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 57, "end_line": 57, "violates": [ "1 <= minSize <= maxSize <= min(26, s.length)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= minSize <= maxSize <= min(26, s.length)" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= minSize <= maxSize <= min(26, s.length)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Check out the constraints, (maxSize <=26).", "This means you can explore all substrings in O(n * 26).", "Find the Maximum Number of Occurrences of a Substring with bruteforce." ] }, { "question_id": 1298, "task_id": "maximum-candies-you-can-get-from-boxes", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "status", "candies", "keys", "containedBoxes", "initialBoxes" ], "tests": { "total": 83, "kept": 81, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "n == status.length == candies.length == keys.length == containedBoxes.length" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= containedBoxes[i][j] < n" ] } ], "unchecked_constraints": [ "Each box is contained in one box at most.", "All values of keys[i] are unique.", "All values of containedBoxes[i] are unique." ], "public_tests": 2, "hints": [ "Use Breadth First Search (BFS) to traverse all possible boxes you can open. Only push to the queue the boxes the you have with their keys." ] }, { "question_id": 1299, "task_id": "replace-elements-with-greatest-element-on-right-side", "drop": [], "similar": [ "two-furthest-houses-with-different-colors", "next-greater-element-iv" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 104, "kept": 100, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "1 <= arr[i] <= 10**(5)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= arr[i] <= 10**(5)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= arr[i] <= 10**(5)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= arr[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Loop through the array starting from the end.", "Keep the maximum value seen so far." ] }, { "question_id": 1300, "task_id": "sum-of-mutated-array-closest-to-target", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "target" ], "tests": { "total": 113, "kept": 95, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= arr[i], target <= 10**(5)" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= arr[i], target <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If you draw a graph with the value on one axis and the absolute difference between the target and the array sum, what will you get?", "That graph is uni-modal.", "Use ternary search on that graph to find the best value." ] }, { "question_id": 1301, "task_id": "number-of-paths-with-max-score", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "board" ], "tests": { "total": 95, "kept": 67, "dropped": { "constraint_violation": 28 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 8, "end_line": 8, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 9, "end_line": 9, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 14, "end_line": 14, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 15, "end_line": 15, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 18, "end_line": 18, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 21, "end_line": 21, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 22, "end_line": 22, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 30, "end_line": 30, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 33, "end_line": 33, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 39, "end_line": 39, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 41, "end_line": 41, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 42, "end_line": 42, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 43, "end_line": 43, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 46, "end_line": 46, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 53, "end_line": 53, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 59, "end_line": 59, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 66, "end_line": 66, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 67, "end_line": 67, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 68, "end_line": 68, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 76, "end_line": 76, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 79, "end_line": 79, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 86, "end_line": 86, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 89, "end_line": 89, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 90, "end_line": 90, "violates": [ "2 <= board.length == board[i].length <= 100" ] }, { "line": 91, "end_line": 91, "violates": [ "2 <= board.length == board[i].length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming to find the path with the max score.", "Use another dynamic programming array to count the number of paths with max score." ] }, { "question_id": 1302, "task_id": "deepest-leaves-sum", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 98, "kept": 0, "dropped": { "unreadable": 98 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "1 <= Node.val <= 100" ] }, { "question_id": 1304, "task_id": "find-n-unique-integers-sum-up-to-zero", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 60, "kept": 60, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Return an array where the values are symmetric. (+x , -x).", "If n is odd, append value 0 in your returned array." ] }, { "question_id": 1305, "task_id": "all-elements-in-two-binary-search-trees", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root1", "root2" ], "tests": { "total": 95, "kept": 0, "dropped": { "unreadable": 95 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in each tree is in the range [0, 5000].", "-10**(5) <= Node.val <= 10**(5)" ] }, { "question_id": 1306, "task_id": "jump-game-iii", "drop": [], "similar": [ "jump-game-ii", "jump-game", "jump-game-vii", "jump-game-viii", "maximum-number-of-jumps-to-reach-the-last-index" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "start" ], "tests": { "total": 111, "kept": 109, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "0 <= arr[i] < arr.length" ] }, { "line": 99, "end_line": 99, "violates": [ "0 <= arr[i] < arr.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think of BFS to solve the problem.", "When you reach a position with a value = 0 then return true." ] }, { "question_id": 1307, "task_id": "verbal-arithmetic-puzzle", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "words", "result" ], "tests": { "total": 148, "kept": 107, "dropped": { "constraint_violation": 41 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 124, "end_line": 124, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 132, "end_line": 132, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 134, "end_line": 134, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 135, "end_line": 135, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 143, "end_line": 143, "violates": [ "1 <= words[i].length, result.length <= 7" ] }, { "line": 146, "end_line": 146, "violates": [ "1 <= words[i].length, result.length <= 7", "words[i], result contain only uppercase English letters." ] } ], "unchecked_constraints": [ "The number of different characters used in the expression is at most 10." ], "public_tests": 3, "hints": [ "Use Backtracking and pruning to solve this problem.", "If you set the values of some digits (from right to left), the other digits will be constrained." ] }, { "question_id": 1309, "task_id": "decrypt-string-from-alphabet-to-integer-mapping", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 43, "kept": 43, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s will be a valid string such that mapping is always possible." ], "public_tests": 2, "hints": [ "Scan from right to left, in each step of the scanning check whether there is a trailing \"#\" 2 indexes away." ] }, { "question_id": 1310, "task_id": "xor-queries-of-a-subarray", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "queries" ], "tests": { "total": 77, "kept": 74, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 34, "end_line": 34, "violates": [ "1 <= arr[i] <= 10**(9)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= arr[i] <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= arr[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What is the result of x ^ y ^ x ?", "Compute the prefix sum for XOR.", "Process the queries with the prefix sum values." ] }, { "question_id": 1311, "task_id": "get-watched-videos-by-your-friends", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "watchedVideos", "friends", "id", "level" ], "tests": { "total": 67, "kept": 32, "dropped": { "constraint_violation": 35 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 41, "end_line": 41, "violates": [ "n == watchedVideos.length == friends.length", "1 <= watchedVideos[i][j].length <= 8", "0 <= friends[i][j] < n" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 53, "end_line": 53, "violates": [ "n == watchedVideos.length == friends.length", "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= watchedVideos[i][j].length <= 8" ] } ], "unchecked_constraints": [ "if friends[i] contains j, then friends[j] contains i" ], "public_tests": 2, "hints": [ "Do BFS to find the kth level friends.", "Then collect movies saw by kth level friends and sort them accordingly." ] }, { "question_id": 1312, "task_id": "minimum-insertion-steps-to-make-a-string-palindrome", "drop": [], "similar": [ "minimum-number-of-moves-to-make-palindrome" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 123, "kept": 123, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Is dynamic programming suitable for this problem ?", "If we know the longest palindromic sub-sequence is x and the length of the string is n then, what is the answer to this problem? It is n - x as we need n - x insertions to make the remaining characters also palindrome." ] }, { "question_id": 1313, "task_id": "decompress-run-length-encoded-list", "drop": [], "similar": [ "string-compression" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 86, "kept": 86, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Decompress the given array by repeating nums[2*i+1] a number of times equal to nums[2*i]." ] }, { "question_id": 1314, "task_id": "matrix-block-sum", "drop": [], "similar": [ "stamping-the-grid", "maximum-sum-of-an-hourglass", "design-neighbor-sum-service" ], "flags": [], "comparison": "exact", "parameter_names": [ "mat", "k" ], "tests": { "total": 88, "kept": 63, "dropped": { "constraint_violation": 25 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= m, n, k <= 100" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= m, n, k <= 100" ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= m, n, k <= 100" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= m, n, k <= 100" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= m, n, k <= 100" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= m, n, k <= 100" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= m, n, k <= 100" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= mat[i][j] <= 100", "1 <= mat[i][j] <= 100" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= m, n, k <= 100" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= m, n, k <= 100" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= mat[i][j] <= 100", "1 <= mat[i][j] <= 100" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= m, n, k <= 100" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= m, n, k <= 100" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= m, n, k <= 100", "1 <= mat[i][j] <= 100" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= m, n, k <= 100" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= mat[i][j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How to calculate the required sum for a cell (i,j) fast ?", "Use the concept of cumulative sum array.", "Create a cumulative sum matrix where dp[i][j] is the sum of all cells in the rectangle from (0,0) to (i,j), use inclusion-exclusion idea." ] }, { "question_id": 1315, "task_id": "sum-of-nodes-with-even-valued-grandparent", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 88, "kept": 0, "dropped": { "unreadable": 88 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "1 <= Node.val <= 100" ] }, { "question_id": 1316, "task_id": "distinct-echo-substrings", "drop": [], "similar": [ "find-substring-with-given-hash-value" ], "flags": [], "comparison": "exact", "parameter_names": [ "text" ], "tests": { "total": 98, "kept": 97, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= text.length <= 2000" ] } ], "unchecked_constraints": [ "text has only lowercase English letters." ], "public_tests": 2, "hints": [ "Given a substring of the text, how to check if it can be written as the concatenation of a string with itself ?", "We can do that in linear time, a faster way is to use hashing.", "Try all substrings and use hashing to check them." ] }, { "question_id": 1317, "task_id": "convert-integer-to-the-sum-of-two-no-zero-integers", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 115, "kept": 89, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 19, "end_line": 19, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 21, "end_line": 21, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 22, "end_line": 22, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 31, "end_line": 31, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 32, "end_line": 32, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 33, "end_line": 33, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 36, "end_line": 36, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 42, "end_line": 42, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 44, "end_line": 44, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 45, "end_line": 45, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 48, "end_line": 48, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 51, "end_line": 51, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 55, "end_line": 55, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 58, "end_line": 58, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 61, "end_line": 61, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 76, "end_line": 76, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 80, "end_line": 80, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 86, "end_line": 86, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 88, "end_line": 88, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 89, "end_line": 89, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 90, "end_line": 90, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 107, "end_line": 107, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 110, "end_line": 110, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 115, "end_line": 115, "violates": [ "2 <= n <= 10**(4)" ] }, { "line": 116, "end_line": 116, "violates": [ "2 <= n <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Loop through all elements from 1 to n.", "Choose A = i and B = n - i then check if A and B are both No-Zero integers." ] }, { "question_id": 1318, "task_id": "minimum-flips-to-make-a-or-b-equal-to-c", "drop": [], "similar": [ "minimum-bit-flips-to-convert-number" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "a", "b", "c" ], "tests": { "total": 92, "kept": 75, "dropped": { "constraint_violation": 17 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= a <= 10**9", "1 <= b <= 10**9", "1 <= c <= 10**9" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= c <= 10**9" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= b <= 10**9", "1 <= c <= 10**9" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= c <= 10**9" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= a <= 10**9", "1 <= c <= 10**9" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= a <= 10**9", "1 <= b <= 10**9", "1 <= c <= 10**9" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= c <= 10**9" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= a <= 10**9", "1 <= b <= 10**9", "1 <= c <= 10**9" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= a <= 10**9" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= a <= 10**9", "1 <= b <= 10**9" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= c <= 10**9" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= c <= 10**9" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= a <= 10**9", "1 <= b <= 10**9", "1 <= c <= 10**9" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= c <= 10**9" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= b <= 10**9", "1 <= c <= 10**9" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= b <= 10**9", "1 <= c <= 10**9" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= a <= 10**9", "1 <= b <= 10**9", "1 <= c <= 10**9" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Check the bits one by one whether they need to be flipped." ] }, { "question_id": 1319, "task_id": "number-of-operations-to-make-network-connected", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "connections" ], "tests": { "total": 89, "kept": 87, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= connections.length <= min(n * (n - 1) / 2, 10**(5))" ] }, { "line": 56, "end_line": 56, "violates": [ "ai != bi" ] } ], "unchecked_constraints": [ "There are no repeated connections.", "No two computers are connected by more than one cable." ], "public_tests": 3, "hints": [ "As long as there are at least (n - 1) connections, there is definitely a way to connect all computers.", "Use DFS to determine the number of isolated computer clusters." ] }, { "question_id": 1320, "task_id": "minimum-distance-to-type-a-word-using-two-fingers", "drop": [], "similar": [ "minimum-time-to-type-word-using-special-typewriter" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 450, "kept": 449, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "2 <= word.length <= 300" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use dynamic programming.", "dp[i][j][k]: smallest movements when you have one finger on i-th char and the other one on j-th char already having written k first characters from word." ] }, { "question_id": 1324, "task_id": "print-words-vertically", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 140, "kept": 140, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "It's guaranteed that there is only one space between 2 words.", "s contains only upper case English letters." ], "public_tests": 3, "hints": [ "Use the maximum length of words to determine the length of the returned answer. However, don't forget to remove trailing spaces." ] }, { "question_id": 1325, "task_id": "delete-leaves-with-a-given-value", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "target" ], "tests": { "total": 7, "kept": 0, "dropped": { "unreadable": 7 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 3000].", "1 <= Node.val, target <= 1000" ] }, { "question_id": 1326, "task_id": "minimum-number-of-taps-to-open-to-water-a-garden", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "ranges" ], "tests": { "total": 93, "kept": 84, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "ranges.length == n + 1" ] }, { "line": 27, "end_line": 27, "violates": [ "ranges.length == n + 1" ] }, { "line": 51, "end_line": 51, "violates": [ "ranges.length == n + 1" ] }, { "line": 72, "end_line": 72, "violates": [ "ranges.length == n + 1" ] }, { "line": 77, "end_line": 77, "violates": [ "ranges.length == n + 1" ] }, { "line": 78, "end_line": 78, "violates": [ "ranges.length == n + 1" ] }, { "line": 86, "end_line": 86, "violates": [ "ranges.length == n + 1" ] }, { "line": 88, "end_line": 88, "violates": [ "ranges.length == n + 1" ] }, { "line": 93, "end_line": 93, "violates": [ "ranges.length == n + 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Create intervals of the area covered by each tap, sort intervals by the left end.", "We need to cover the interval [0, n]. we can start with the first interval and out of all intervals that intersect with it we choose the one that covers the farthest point to the right.", "What if there is a gap between intervals that is not covered ? we should stop and return -1 as there is some interval that cannot be covered." ] }, { "question_id": 1328, "task_id": "break-a-palindrome", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "palindrome" ], "tests": { "total": 118, "kept": 118, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How to detect if there is impossible to perform the replacement? Only when the length = 1.", "Change the first non 'a' character to 'a'.", "What if the string has only 'a'?", "Change the last character to 'b'." ] }, { "question_id": 1329, "task_id": "sort-the-matrix-diagonally", "drop": [], "similar": [ "sort-matrix-by-diagonals" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat" ], "tests": { "total": 81, "kept": 75, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= mat[i][j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a data structure to store all values of each diagonal.", "How to index the data structure with the id of the diagonal?", "All cells in the same diagonal (i,j) have the same difference so we can get the diagonal of a cell using the difference i-j." ], "similar_to_test": [ "3446 sort-matrix-by-diagonals" ] }, { "question_id": 1330, "task_id": "reverse-subarray-to-maximize-array-value", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 99, "kept": 98, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 95, "end_line": 95, "violates": [ "-10**(5) <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [ "The answer is guaranteed to fit in a 32-bit integer." ], "public_tests": 2, "hints": [ "What's the score after reversing a sub-array [L, R] ?", "It's the score without reversing it + abs(a[R] - a[L-1]) + abs(a[L] - a[R+1]) - abs(a[L] - a[L-1]) - abs(a[R] - a[R+1])", "How to maximize that formula given that abs(x - y) = max(x - y, y - x) ?", "This can be written as max(max(a[R] - a[L - 1], a[L - 1] - a[R]) + max(a[R + 1] - a[L], a[L] - a[R + 1]) - value(L) - value(R + 1)) over all L < R where value(i) = abs(a[i] - a[i-1])", "This can be divided into 4 cases." ] }, { "question_id": 1331, "task_id": "rank-transform-of-an-array", "drop": [], "similar": [ "rank-transform-of-a-matrix", "find-target-indices-after-sorting-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 113, "kept": 112, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "-10**(9) <= arr[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a temporary array to copy the array and sort it.", "The rank of each element is the number of unique elements smaller than it in the sorted array plus one." ] }, { "question_id": 1332, "task_id": "remove-palindromic-subsequences", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 172, "kept": 171, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= s.length <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use the fact that string contains only 2 characters.", "Are subsequences composed of only one type of letter always palindrome strings ?" ] }, { "question_id": 1333, "task_id": "filter-restaurants-by-vegan-friendly-price-and-distance", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "restaurants", "veganFriendly", "maxPrice", "maxDistance" ], "tests": { "total": 90, "kept": 87, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= idi, ratingi, pricei, distancei <= 10**5" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= idi, ratingi, pricei, distancei <= 10**5" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= idi, ratingi, pricei, distancei <= 10**5" ] } ], "unchecked_constraints": [ "veganFriendlyi and veganFriendly are 0 or 1.", "All idi are distinct." ], "public_tests": 3, "hints": [ "Do the filtering and sort as said. Note that the id may not be the index in the array." ] }, { "question_id": 1334, "task_id": "find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance", "drop": [], "similar": [ "second-minimum-time-to-reach-destination" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "distanceThreshold" ], "tests": { "total": 61, "kept": 45, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 11, "end_line": 11, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 12, "end_line": 12, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= fromi < toi < n" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= fromi < toi < n" ] } ], "unchecked_constraints": [ "All pairs (fromi, toi) are distinct." ], "public_tests": 2, "hints": [ "Use Floyd-Warshall's algorithm to compute any-point to any-point distances. (Or can also do Dijkstra from every node due to the weights are non-negative).", "For each city calculate the number of reachable cities within the threshold, then search for the optimal city." ] }, { "question_id": 1335, "task_id": "minimum-difficulty-of-a-job-schedule", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "jobDifficulty", "d" ], "tests": { "total": 111, "kept": 93, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= d <= 10", "1 <= d <= 10" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= d <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= d <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= d <= 10" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= d <= 10" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= d <= 10" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= jobDifficulty[i] <= 1000" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= d <= 10" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= d <= 10" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= jobDifficulty[i] <= 1000" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= d <= 10", "1 <= d <= 10" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= d <= 10", "1 <= d <= 10" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= d <= 10" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= d <= 10", "1 <= d <= 10" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= d <= 10" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= d <= 10" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= d <= 10" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= d <= 10" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use DP. Try to cut the array into d non-empty sub-arrays. Try all possible cuts for the array.", "Use dp[i][j] where DP states are i the index of the last cut and j the number of remaining cuts. Complexity is O(n * n * d)." ] }, { "question_id": 1337, "task_id": "the-k-weakest-rows-in-a-matrix", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "mat", "k" ], "tests": { "total": 80, "kept": 80, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "matrix[i][j] is either 0 or 1." ], "public_tests": 2, "hints": [ "Sort the matrix row indexes by the number of soldiers and then row indexes." ] }, { "question_id": 1338, "task_id": "reduce-array-size-to-the-half", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 85, "kept": 61, "dropped": { "constraint_violation": 24 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "arr.length is even." ] }, { "line": 22, "end_line": 22, "violates": [ "arr.length is even." ] }, { "line": 29, "end_line": 29, "violates": [ "arr.length is even." ] }, { "line": 35, "end_line": 35, "violates": [ "arr.length is even." ] }, { "line": 37, "end_line": 37, "violates": [ "arr.length is even." ] }, { "line": 40, "end_line": 40, "violates": [ "arr.length is even." ] }, { "line": 41, "end_line": 41, "violates": [ "arr.length is even." ] }, { "line": 45, "end_line": 45, "violates": [ "arr.length is even." ] }, { "line": 53, "end_line": 53, "violates": [ "arr.length is even." ] }, { "line": 54, "end_line": 54, "violates": [ "arr.length is even." ] }, { "line": 55, "end_line": 55, "violates": [ "arr.length is even." ] }, { "line": 60, "end_line": 60, "violates": [ "arr.length is even." ] }, { "line": 61, "end_line": 61, "violates": [ "arr.length is even." ] }, { "line": 63, "end_line": 63, "violates": [ "arr.length is even." ] }, { "line": 64, "end_line": 64, "violates": [ "arr.length is even." ] }, { "line": 66, "end_line": 66, "violates": [ "arr.length is even." ] }, { "line": 67, "end_line": 67, "violates": [ "arr.length is even." ] }, { "line": 68, "end_line": 68, "violates": [ "arr.length is even." ] }, { "line": 69, "end_line": 69, "violates": [ "arr.length is even." ] }, { "line": 70, "end_line": 70, "violates": [ "arr.length is even." ] }, { "line": 78, "end_line": 78, "violates": [ "arr.length is even." ] }, { "line": 81, "end_line": 81, "violates": [ "arr.length is even." ] }, { "line": 82, "end_line": 82, "violates": [ "arr.length is even." ] }, { "line": 83, "end_line": 83, "violates": [ "arr.length is even." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Count the frequency of each integer in the array.", "Start with an empty set, add to the set the integer with the maximum frequency.", "Keep Adding the integer with the max frequency until you remove at least half of the integers." ] }, { "question_id": 1339, "task_id": "maximum-product-of-splitted-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "count-nodes-with-the-highest-score" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 63, "kept": 0, "dropped": { "unreadable": 63 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [2, 5 * 10**(4)].", "1 <= Node.val <= 10**(4)" ] }, { "question_id": 1340, "task_id": "jump-game-v", "drop": [], "similar": [ "jump-game-vii", "jump-game-viii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "arr", "d" ], "tests": { "total": 122, "kept": 118, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= arr[i] <= 10**(5)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= arr[i] <= 10**(5)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= arr[i] <= 10**(5)" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= arr[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming. dp[i] is max jumps you can do starting from index i. Answer is max(dp[i]).", "dp[i] = 1 + max (dp[j]) where j is all indices you can reach from i." ] }, { "question_id": 1342, "task_id": "number-of-steps-to-reduce-a-number-to-zero", "drop": [], "similar": [ "minimum-moves-to-reach-target-score", "count-operations-to-obtain-zero" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 59, "kept": 45, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= num <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Simulate the process to get the final answer." ] }, { "question_id": 1343, "task_id": "number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold", "drop": [], "similar": [ "k-radius-subarray-averages", "count-subarrays-with-median-k", "apply-operations-to-make-all-array-elements-equal-to-zero" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "k", "threshold" ], "tests": { "total": 108, "kept": 100, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= arr[i] <= 10**(4)" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= arr[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Start with a window of size K and test its average against the threshold.", "Keep moving the window by one element maintaining its size k until you cover the whole array. Count the number of windows that have an average greater than or equal to the threshold." ] }, { "question_id": 1344, "task_id": "angle-between-hands-of-a-clock", "drop": [], "similar": [], "flags": [ "decimal_answer", "has_images" ], "comparison": "float", "parameter_names": [ "hour", "minutes" ], "tests": { "total": 72, "kept": 72, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The tricky part is determining how the minute hand affects the position of the hour hand.", "Calculate the angles separately then find the difference." ] }, { "question_id": 1345, "task_id": "jump-game-iv", "drop": [], "similar": [ "jump-game-vii", "jump-game-viii", "maximum-number-of-jumps-to-reach-the-last-index" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 60, "kept": 60, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Build a graph of n nodes where nodes are the indices of the array and edges for node i are nodes i+1, i-1, j where arr[i] == arr[j].", "Start bfs from node 0 and keep distance. The answer is the distance when you reach node n-1." ] }, { "question_id": 1346, "task_id": "check-if-n-and-its-double-exist", "drop": [], "similar": [ "keep-multiplying-found-values-by-two" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 147, "kept": 131, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "-10**(3) <= arr[i] <= 10**(3)", "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 26, "end_line": 26, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 41, "end_line": 41, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 42, "end_line": 42, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 56, "end_line": 56, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 65, "end_line": 65, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 78, "end_line": 78, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 79, "end_line": 79, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 80, "end_line": 80, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 89, "end_line": 89, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 94, "end_line": 94, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 104, "end_line": 104, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 129, "end_line": 129, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 134, "end_line": 134, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 145, "end_line": 145, "violates": [ "-10**(3) <= arr[i] <= 10**(3)", "-10**(3) <= arr[i] <= 10**(3)" ] }, { "line": 147, "end_line": 147, "violates": [ "-10**(3) <= arr[i] <= 10**(3)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Loop from i = 0 to arr.length, maintaining in a hashTable the array elements from [0, i - 1].", "On each step of the loop check if we have seen the element 2 * arr[i] so far.", "Also check if we have seen arr[i] / 2 in case arr[i] % 2 == 0." ] }, { "question_id": 1347, "task_id": "minimum-number-of-steps-to-make-two-strings-anagram", "drop": [], "similar": [ "determine-if-two-strings-are-close", "minimum-number-of-steps-to-make-two-strings-anagram-ii", "minimum-operations-to-make-character-frequencies-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 113, "kept": 69, "dropped": { "constraint_violation": 44 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "s.length == t.length" ] }, { "line": 13, "end_line": 13, "violates": [ "s.length == t.length" ] }, { "line": 19, "end_line": 19, "violates": [ "s.length == t.length" ] }, { "line": 20, "end_line": 20, "violates": [ "s.length == t.length" ] }, { "line": 22, "end_line": 22, "violates": [ "s.length == t.length" ] }, { "line": 23, "end_line": 23, "violates": [ "s.length == t.length" ] }, { "line": 25, "end_line": 25, "violates": [ "s.length == t.length" ] }, { "line": 26, "end_line": 26, "violates": [ "s.length == t.length" ] }, { "line": 28, "end_line": 28, "violates": [ "s.length == t.length" ] }, { "line": 30, "end_line": 30, "violates": [ "s.length == t.length" ] }, { "line": 34, "end_line": 34, "violates": [ "s.length == t.length" ] }, { "line": 35, "end_line": 35, "violates": [ "s.length == t.length" ] }, { "line": 40, "end_line": 40, "violates": [ "s.length == t.length" ] }, { "line": 41, "end_line": 41, "violates": [ "s.length == t.length" ] }, { "line": 42, "end_line": 42, "violates": [ "s.length == t.length" ] }, { "line": 44, "end_line": 44, "violates": [ "s.length == t.length" ] }, { "line": 46, "end_line": 46, "violates": [ "s.length == t.length" ] }, { "line": 47, "end_line": 47, "violates": [ "s.length == t.length" ] }, { "line": 48, "end_line": 48, "violates": [ "s.length == t.length" ] }, { "line": 56, "end_line": 56, "violates": [ "s.length == t.length" ] }, { "line": 58, "end_line": 58, "violates": [ "s.length == t.length" ] }, { "line": 63, "end_line": 63, "violates": [ "s.length == t.length" ] }, { "line": 67, "end_line": 67, "violates": [ "s.length == t.length" ] }, { "line": 68, "end_line": 68, "violates": [ "s.length == t.length" ] }, { "line": 69, "end_line": 69, "violates": [ "s.length == t.length" ] }, { "line": 71, "end_line": 71, "violates": [ "s.length == t.length" ] }, { "line": 72, "end_line": 72, "violates": [ "s.length == t.length" ] }, { "line": 74, "end_line": 74, "violates": [ "s.length == t.length" ] }, { "line": 75, "end_line": 75, "violates": [ "s.length == t.length" ] }, { "line": 79, "end_line": 79, "violates": [ "s.length == t.length" ] }, { "line": 80, "end_line": 80, "violates": [ "s and t consist of lowercase English letters only." ] }, { "line": 81, "end_line": 81, "violates": [ "s.length == t.length" ] }, { "line": 82, "end_line": 82, "violates": [ "s.length == t.length" ] }, { "line": 83, "end_line": 83, "violates": [ "s.length == t.length" ] }, { "line": 84, "end_line": 84, "violates": [ "s.length == t.length" ] }, { "line": 85, "end_line": 85, "violates": [ "s.length == t.length" ] }, { "line": 86, "end_line": 86, "violates": [ "s.length == t.length" ] }, { "line": 88, "end_line": 88, "violates": [ "s.length == t.length" ] }, { "line": 92, "end_line": 92, "violates": [ "s.length == t.length" ] }, { "line": 93, "end_line": 93, "violates": [ "s.length == t.length" ] }, { "line": 96, "end_line": 96, "violates": [ "s.length == t.length" ] }, { "line": 97, "end_line": 97, "violates": [ "s.length == t.length" ] }, { "line": 109, "end_line": 109, "violates": [ "s.length == t.length" ] }, { "line": 111, "end_line": 111, "violates": [ "s.length == t.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Count the frequency of characters of each string.", "Loop over all characters if the frequency of a character in t is less than the frequency of the same character in s then add the difference between the frequencies to the answer." ], "similar_to_test": [ "3389 minimum-operations-to-make-character-frequencies-equal" ] }, { "question_id": 1349, "task_id": "maximum-students-taking-exam", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "seats" ], "tests": { "total": 66, "kept": 66, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Students in row i only can see exams in row i+1.", "Use Dynamic programming to compute the result given a (current row, bitmask people seated in previous row)." ] }, { "question_id": 1351, "task_id": "count-negative-numbers-in-a-sorted-matrix", "drop": [], "similar": [ "maximum-count-of-positive-integer-and-negative-integer" ], "flags": [], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 96, "kept": 92, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "-100 <= grid[i][j] <= 100" ] }, { "line": 61, "end_line": 61, "violates": [ "-100 <= grid[i][j] <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "-100 <= grid[i][j] <= 100" ] }, { "line": 97, "end_line": 97, "violates": [ "-100 <= grid[i][j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use binary search for optimization or simply brute force." ] }, { "question_id": 1353, "task_id": "maximum-number-of-events-that-can-be-attended", "drop": [], "similar": [ "maximum-number-of-events-that-can-be-attended-ii", "maximum-earnings-from-taxi", "meeting-rooms-iii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "events" ], "tests": { "total": 98, "kept": 93, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= startDayi <= endDayi <= 10**(5)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= startDayi <= endDayi <= 10**(5)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= startDayi <= endDayi <= 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= startDayi <= endDayi <= 10**(5)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= startDayi <= endDayi <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the events by the start time and in case of tie by the end time in ascending order.", "Loop over the sorted events. Attend as much as you can and keep the last day occupied. When you try to attend new event keep in mind the first day you can attend a new event in." ] }, { "question_id": 1354, "task_id": "construct-target-array-with-multiple-sums", "drop": [], "similar": [ "minimum-amount-of-time-to-fill-cups" ], "flags": [], "comparison": "exact", "parameter_names": [ "target" ], "tests": { "total": 99, "kept": 98, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 52, "end_line": 52, "violates": [ "1 <= target[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Given that the sum is strictly increasing, the largest element in the target must be formed in the last step by adding the total sum in the previous step. Thus, we can simulate the process in a reversed way.", "Subtract the largest with the rest of the array, and put the new element into the array. Repeat until all elements become one" ] }, { "question_id": 1356, "task_id": "sort-integers-by-the-number-of-1-bits", "drop": [], "similar": [ "find-subsequence-of-length-k-with-the-largest-sum", "find-if-array-can-be-sorted" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 96, "kept": 81, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= arr[i] <= 10**(4)" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= arr[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simulate the problem. Count the number of 1's in the binary representation of each integer.", "Sort by the number of 1's ascending and by the value in case of tie." ] }, { "question_id": 1358, "task_id": "number-of-substrings-containing-all-three-characters", "drop": [], "similar": [ "vowels-of-all-substrings", "count-complete-substrings" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 130, "kept": 130, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "3 <= s.length <= 5 x 10**(4)" ], "public_tests": 3, "hints": [ "For each position we simply need to find the first occurrence of a/b/c on or after this position.", "So we can pre-compute three link-list of indices of each a, b, and c." ] }, { "question_id": 1359, "task_id": "count-all-valid-pickup-and-delivery-options", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 32, "kept": 32, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use the permutation and combination theory to add one (P, D) pair each time until n pairs." ] }, { "question_id": 1360, "task_id": "number-of-days-between-two-dates", "drop": [], "similar": [ "count-days-spent-together" ], "flags": [ "figure_reference" ], "comparison": "exact", "parameter_names": [ "date1", "date2" ], "tests": { "total": 138, "kept": 138, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The given dates are valid dates between the years 1971 and 2100." ], "public_tests": 2, "hints": [ "Create a function f(date) that counts the number of days from 1900-01-01 to date. How can we calculate the answer ?", "The answer is just |f(date1) - f(date2)|.", "How to construct f(date) ?", "For each year from 1900 to year - 1 sum up 365 or 366 in case of leap years. Then sum up for each month the number of days, consider the case when the current year is leap, finally sum up the days." ] }, { "question_id": 1361, "task_id": "validate-binary-tree-nodes", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "leftChild", "rightChild" ], "tests": { "total": 137, "kept": 137, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the parent of each node.", "A valid tree must have nodes with only one parent and exactly one node with no parent." ] }, { "question_id": 1362, "task_id": "closest-divisors", "drop": [], "similar": [ "distinct-prime-factors-of-product-of-array" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "num" ], "tests": { "total": 53, "kept": 49, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= num <= 10**9" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= num <= 10**9" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= num <= 10**9" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= num <= 10**9" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the divisors of n+1 and n+2.", "To find the divisors of a number, you only need to iterate to the square root of that number." ] }, { "question_id": 1363, "task_id": "largest-multiple-of-three", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "digits" ], "tests": { "total": 72, "kept": 72, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "A number is a multiple of three if and only if its sum of digits is a multiple of three.", "Use dynamic programming.", "To find the maximum number, try to maximize the number of digits of the number.", "Sort the digits in descending order to find the maximum number." ] }, { "question_id": 1365, "task_id": "how-many-numbers-are-smaller-than-the-current-number", "drop": [], "similar": [ "count-of-smaller-numbers-after-self", "longest-subsequence-with-limited-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 110, "kept": 108, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 44, "end_line": 44, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Brute force for each array element.", "In order to improve the time complexity, we can sort the array and get the answer for each array element." ] }, { "question_id": 1366, "task_id": "rank-teams-by-votes", "drop": [], "similar": [ "online-election" ], "flags": [], "comparison": "exact", "parameter_names": [ "votes" ], "tests": { "total": 73, "kept": 73, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "votes[i].length == votes[j].length for 0 <= i, j < votes.length.", "votes[i][j] is an English uppercase letter.", "All characters of votes[i] are unique.", "All the characters that occur in votes[0] also occur in votes[j] where 1 <= j < votes.length." ], "public_tests": 3, "hints": [ "Build array rank where rank[i][j] is the number of votes for team i to be the j-th rank.", "Sort the teams by rank array. if rank array is the same for two or more teams, sort them by the ID in ascending order." ] }, { "question_id": 1367, "task_id": "linked-list-in-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head", "root" ], "tests": { "total": 85, "kept": 0, "dropped": { "unreadable": 85 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree will be in the range [1, 2500].", "The number of nodes in the list will be in the range [1, 100].", "1 <= Node.val <= 100 for each node in the linked list and binary tree." ] }, { "question_id": 1368, "task_id": "minimum-cost-to-make-at-least-one-valid-path-in-a-grid", "drop": [], "similar": [ "minimum-weighted-subgraph-with-the-required-paths", "disconnect-path-in-a-binary-matrix-by-at-most-one-flip" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 87, "kept": 87, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Build a graph where grid[i][j] is connected to all the four side-adjacent cells with weighted edge. the weight is 0 if the sign is pointing to the adjacent cell or 1 otherwise.", "Do BFS from (0, 0) visit all edges with weight = 0 first. the answer is the distance to (m -1, n - 1)." ] }, { "question_id": 1370, "task_id": "increasing-decreasing-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 69, "kept": 69, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Count the frequency of each character.", "Loop over all character from 'a' to 'z' and append the character if it exists and decrease frequency by 1. Do the same from 'z' to 'a'.", "Keep repeating until the frequency of all characters is zero." ] }, { "question_id": 1371, "task_id": "find-the-longest-substring-containing-vowels-in-even-counts", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 77, "kept": 77, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= s.length <= 5 x 10**5" ], "public_tests": 3, "hints": [ "Represent the counts (odd or even) of vowels with a bitmask.", "Precompute the prefix xor for the bitmask of vowels and then get the longest valid substring." ] }, { "question_id": 1372, "task_id": "longest-zigzag-path-in-a-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "zigzag-grid-traversal-with-skip" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 95, "kept": 0, "dropped": { "unreadable": 95 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 5 * 10**(4)].", "1 <= Node.val <= 100" ], "similar_to_test": [ "3417 zigzag-grid-traversal-with-skip" ] }, { "question_id": 1373, "task_id": "maximum-sum-bst-in-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 96, "kept": 0, "dropped": { "unreadable": 96 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 4 * 10**(4)].", "-4 * 10**(4) <= Node.val <= 4 * 10**(4)" ] }, { "question_id": 1374, "task_id": "generate-a-string-with-characters-that-have-odd-counts", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 58, "kept": 58, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If n is odd, return a string of size n formed only by 'a', else return string formed with n-1 'a' and 1 'b''." ] }, { "question_id": 1375, "task_id": "number-of-times-binary-string-is-prefix-aligned", "drop": [], "similar": [ "bulb-switcher", "bulb-switcher-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "flips" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "flips is a permutation of the integers in the range [1, n]." ], "public_tests": 2, "hints": [ "If in the step x all bulb shines then bulbs 1,2,3,..,x should shines too." ] }, { "question_id": 1376, "task_id": "time-needed-to-inform-all-employees", "drop": [], "similar": [ "maximum-depth-of-binary-tree", "binary-tree-maximum-path-sum" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "headID", "manager", "informTime" ], "tests": { "total": 43, "kept": 34, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "manager.length == n", "manager[headID] == -1", "informTime.length == n" ] }, { "line": 12, "end_line": 12, "violates": [ "manager.length == n", "manager[headID] == -1", "informTime.length == n" ] }, { "line": 13, "end_line": 13, "violates": [ "manager[headID] == -1" ] }, { "line": 21, "end_line": 21, "violates": [ "manager.length == n", "informTime.length == n" ] }, { "line": 26, "end_line": 26, "violates": [ "manager.length == n", "manager[headID] == -1", "informTime.length == n" ] }, { "line": 27, "end_line": 27, "violates": [ "manager.length == n", "manager[headID] == -1", "informTime.length == n" ] }, { "line": 35, "end_line": 35, "violates": [ "manager.length == n", "manager[headID] == -1", "informTime.length == n" ] }, { "line": 41, "end_line": 41, "violates": [ "manager[headID] == -1" ] }, { "line": 43, "end_line": 43, "violates": [ "manager[headID] == -1" ] } ], "unchecked_constraints": [ "informTime[i] == 0 if employee i has no subordinates.", "It is guaranteed that all the employees can be informed.", "0 <= manager[i] < n" ], "public_tests": 2, "hints": [ "The company can be represented as a tree, headID is always the root.", "Store for each node the time needed to be informed of the news.", "Answer is the max time a leaf node needs to be informed." ] }, { "question_id": 1377, "task_id": "frog-position-after-t-seconds", "drop": [], "similar": [ "longest-special-path" ], "flags": [ "figure_reference", "decimal_answer", "has_images" ], "comparison": "float", "parameter_names": [ "n", "edges", "t", "target" ], "tests": { "total": 64, "kept": 64, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a variation of DFS with parameters 'curent_vertex' and 'current_time'.", "Update the probability considering to jump to one of the children vertices." ], "similar_to_test": [ "3425 longest-special-path" ] }, { "question_id": 1379, "task_id": "find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree", "drop": [ "tree_or_linked_list", "interface", "too_few_tests" ], "similar": [], "interface_problems": [ "rust: no code snippet", "go: no code snippet", "php: no code snippet", "ruby: no code snippet" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "original", "cloned", "target" ], "tests": { "total": 59, "kept": 0, "dropped": { "unreadable": 59 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "The values of the nodes of the tree are unique.", "target node is a node from the original tree and is not null." ] }, { "question_id": 1380, "task_id": "lucky-numbers-in-a-matrix", "drop": [], "similar": [], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "matrix" ], "tests": { "total": 87, "kept": 82, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 46, "end_line": 46, "violates": [ "1 <= matrix[i][j] <= 10**(5)." ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= matrix[i][j] <= 10**(5)." ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= matrix[i][j] <= 10**(5)." ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= matrix[i][j] <= 10**(5)." ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= matrix[i][j] <= 10**(5)." ] } ], "unchecked_constraints": [ "m == mat.length", "n == mat[i].length", "1 <= n, m <= 50", "All elements in the matrix are distinct." ], "public_tests": 3, "hints": [ "Find out and save the minimum of each row and maximum of each column in two lists.", "Then scan through the whole matrix to identify the elements that satisfy the criteria." ] }, { "question_id": 1382, "task_id": "balance-a-binary-search-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "multiple_answers", "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(4)].", "1 <= Node.val <= 10**(5)" ] }, { "question_id": 1383, "task_id": "maximum-performance-of-a-team", "drop": [], "similar": [ "maximum-fruits-harvested-after-at-most-k-steps" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "speed", "efficiency", "k" ], "tests": { "total": 41, "kept": 37, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "speed.length == n", "efficiency.length == n" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= speed[i] <= 10**(5)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= speed[i] <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "speed.length == n", "efficiency.length == n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Keep track of the engineers by their efficiency in decreasing order.", "Starting from one engineer, to build a team, it suffices to bring K-1 more engineers who have higher efficiencies as well as high speeds." ] }, { "question_id": 1385, "task_id": "find-the-distance-value-between-two-arrays", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr1", "arr2", "d" ], "tests": { "total": 115, "kept": 107, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "0 <= d <= 100" ] }, { "line": 8, "end_line": 8, "violates": [ "0 <= d <= 100" ] }, { "line": 20, "end_line": 20, "violates": [ "-1000 <= arr1[i], arr2[j] <= 1000" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= d <= 100" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= d <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "-1000 <= arr1[i], arr2[j] <= 1000", "0 <= d <= 100" ] }, { "line": 53, "end_line": 53, "violates": [ "-1000 <= arr1[i], arr2[j] <= 1000" ] }, { "line": 81, "end_line": 81, "violates": [ "0 <= d <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort 'arr2' and use binary search to get the closest element for each 'arr1[i]', it gives a time complexity of O(nlogn)." ] }, { "question_id": 1386, "task_id": "cinema-seat-allocation", "drop": [], "similar": [ "booking-concert-tickets-in-groups" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "reservedSeats" ], "tests": { "total": 76, "kept": 74, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= reservedSeats.length <= min(10 * n, 10**(4))" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= reservedSeats.length <= min(10 * n, 10**(4))" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Note you can allocate at most two four-person groups in one row.", "Greedily check if you can allocate seats for two groups, one group or none.", "Process only rows that appear in the input, for other rows you can always allocate seats for two groups." ] }, { "question_id": 1387, "task_id": "sort-integers-by-the-power-value", "drop": [], "similar": [ "find-score-of-an-array-after-marking-all-elements" ], "flags": [], "comparison": "exact", "parameter_names": [ "lo", "hi", "k" ], "tests": { "total": 93, "kept": 93, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use dynamic programming to get the power of each integer of the intervals.", "Sort all the integers of the interval by the power value and return the k-th in the sorted list." ] }, { "question_id": 1388, "task_id": "pizza-with-3n-slices", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "slices" ], "tests": { "total": 111, "kept": 106, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= slices[i] <= 1000", "1 <= slices[i] <= 1000" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= slices[i] <= 1000" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= slices[i] <= 1000", "1 <= slices[i] <= 1000" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= slices[i] <= 1000" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= slices[i] <= 1000" ] } ], "unchecked_constraints": [ "3 * n == slices.length" ], "public_tests": 2, "hints": [ "By studying the pattern of the operations, we can find out that the problem is equivalent to: Given an integer array with size 3N, select N integers with maximum sum and any selected integers are not next to each other in the array.", "The first one in the array is considered next to the last one in the array. Use Dynamic Programming to solve it." ] }, { "question_id": 1389, "task_id": "create-target-array-in-the-given-order", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "index" ], "tests": { "total": 115, "kept": 69, "dropped": { "constraint_violation": 46 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "0 <= index[i] <= i" ] }, { "line": 15, "end_line": 15, "violates": [ "0 <= index[i] <= i" ] }, { "line": 20, "end_line": 20, "violates": [ "0 <= index[i] <= i" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= index[i] <= i" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= index[i] <= i" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= index[i] <= i" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= index[i] <= i" ] }, { "line": 35, "end_line": 35, "violates": [ "0 <= index[i] <= i" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= index[i] <= i" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= index[i] <= i" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= index[i] <= i" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= index[i] <= i" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= index[i] <= i" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= index[i] <= i" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= index[i] <= i" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= index[i] <= i" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= index[i] <= i" ] }, { "line": 55, "end_line": 55, "violates": [ "0 <= index[i] <= i" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= index[i] <= i" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= index[i] <= i", "0 <= index[i] <= i" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= index[i] <= i" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= index[i] <= i" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= index[i] <= i" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= index[i] <= i" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= index[i] <= i" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= index[i] <= i" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= index[i] <= i" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= index[i] <= i" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= index[i] <= i" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= index[i] <= i" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= index[i] <= i" ] }, { "line": 81, "end_line": 81, "violates": [ "0 <= index[i] <= i" ] }, { "line": 83, "end_line": 83, "violates": [ "0 <= index[i] <= i" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= index[i] <= i" ] }, { "line": 85, "end_line": 85, "violates": [ "0 <= index[i] <= i" ] }, { "line": 87, "end_line": 87, "violates": [ "0 <= index[i] <= i" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= index[i] <= i" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= index[i] <= i", "0 <= index[i] <= i" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= index[i] <= i" ] }, { "line": 98, "end_line": 98, "violates": [ "0 <= index[i] <= i" ] }, { "line": 103, "end_line": 103, "violates": [ "0 <= index[i] <= i" ] }, { "line": 105, "end_line": 105, "violates": [ "0 <= index[i] <= i" ] }, { "line": 106, "end_line": 106, "violates": [ "0 <= index[i] <= i" ] }, { "line": 110, "end_line": 110, "violates": [ "0 <= index[i] <= i" ] }, { "line": 114, "end_line": 114, "violates": [ "0 <= index[i] <= i" ] }, { "line": 116, "end_line": 116, "violates": [ "0 <= index[i] <= i" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Simulate the process and fill corresponding numbers in the designated spots." ] }, { "question_id": 1390, "task_id": "four-divisors", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 136, "kept": 135, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the divisors of each element in the array.", "You only need to loop to the square root of a number to find its divisors." ] }, { "question_id": 1391, "task_id": "check-if-there-is-a-valid-path-in-a-grid", "drop": [], "similar": [ "check-if-there-is-a-valid-parentheses-string-path" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 77, "kept": 77, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Start DFS from the node (0, 0) and follow the path till you stop.", "When you reach a cell and cannot move anymore check that this cell is (m - 1, n - 1) or not." ] }, { "question_id": 1392, "task_id": "longest-happy-prefix", "drop": [], "similar": [ "sum-of-scores-of-built-strings", "maximum-deletions-on-a-string", "minimum-time-to-revert-word-to-initial-state-ii", "minimum-time-to-revert-word-to-initial-state-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 162, "kept": 162, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use Longest Prefix Suffix (KMP-table) or String Hashing." ] }, { "question_id": 1394, "task_id": "find-lucky-integer-in-an-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 61, "kept": 61, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Count the frequency of each integer in the array.", "Get all lucky numbers and return the largest of them." ] }, { "question_id": 1395, "task_id": "count-number-of-teams", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "rating" ], "tests": { "total": 114, "kept": 110, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "All the integers in rating are unique." ] }, { "line": 71, "end_line": 71, "violates": [ "All the integers in rating are unique." ] }, { "line": 102, "end_line": 102, "violates": [ "All the integers in rating are unique." ] }, { "line": 108, "end_line": 108, "violates": [ "All the integers in rating are unique." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "BruteForce, check all possibilities." ] }, { "question_id": 1397, "task_id": "find-all-good-strings", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "s1", "s2", "evil" ], "tests": { "total": 29, "kept": 20, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "s1 <= s2" ] }, { "line": 16, "end_line": 16, "violates": [ "s1.length == n", "s2.length == n" ] }, { "line": 17, "end_line": 17, "violates": [ "s1.length == n", "s2.length == n" ] }, { "line": 19, "end_line": 19, "violates": [ "s1.length == n" ] }, { "line": 20, "end_line": 20, "violates": [ "s1.length == n", "s2.length == n" ] }, { "line": 24, "end_line": 24, "violates": [ "s1.length == n", "s2.length == n" ] }, { "line": 25, "end_line": 25, "violates": [ "s1.length == n", "s2.length == n" ] }, { "line": 26, "end_line": 26, "violates": [ "s1.length == n", "s2.length == n" ] }, { "line": 27, "end_line": 27, "violates": [ "s1.length == n", "s2.length == n" ] } ], "unchecked_constraints": [ "All strings consist of lowercase English letters." ], "public_tests": 3, "hints": [ "Use DP with 4 states (pos: Int, posEvil: Int, equalToS1: Bool, equalToS2: Bool) which compute the number of valid strings of size \"pos\" where the maximum common suffix with string \"evil\" has size \"posEvil\". When \"equalToS1\" is \"true\", the current valid string is equal to \"S1\" otherwise it is greater. In a similar way when equalToS2 is \"true\" the current valid string is equal to \"S2\" otherwise it is smaller.", "To update the maximum common suffix with string \"evil\" use KMP preprocessing." ] }, { "question_id": 1399, "task_id": "count-largest-group", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 45, "kept": 45, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Count the digit sum for each integer in the range and find out the largest groups." ] }, { "question_id": 1400, "task_id": "construct-k-palindrome-strings", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 100, "kept": 99, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= s.length <= 10**(5)", "1 <= k <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If the s.length < k we cannot construct k strings from s and answer is false.", "If the number of characters that have odd counts is > k then the minimum number of palindrome strings we can construct is > k and answer is false.", "Otherwise you can construct exactly k palindrome strings and answer is true (why ?)." ] }, { "question_id": 1401, "task_id": "circle-and-rectangle-overlapping", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "radius", "xCenter", "yCenter", "x1", "y1", "x2", "y2" ], "tests": { "total": 114, "kept": 106, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "-10**(4) <= x1 < x2 <= 10**(4)", "-10**(4) <= y1 < y2 <= 10**(4)" ] }, { "line": 32, "end_line": 32, "violates": [ "-10**(4) <= x1 < x2 <= 10**(4)", "-10**(4) <= y1 < y2 <= 10**(4)" ] }, { "line": 40, "end_line": 40, "violates": [ "-10**(4) <= x1 < x2 <= 10**(4)", "-10**(4) <= y1 < y2 <= 10**(4)" ] }, { "line": 46, "end_line": 46, "violates": [ "-10**(4) <= x1 < x2 <= 10**(4)", "-10**(4) <= y1 < y2 <= 10**(4)" ] }, { "line": 54, "end_line": 54, "violates": [ "-10**(4) <= x1 < x2 <= 10**(4)", "-10**(4) <= y1 < y2 <= 10**(4)" ] }, { "line": 58, "end_line": 58, "violates": [ "-10**(4) <= x1 < x2 <= 10**(4)", "-10**(4) <= y1 < y2 <= 10**(4)" ] }, { "line": 79, "end_line": 79, "violates": [ "-10**(4) <= x1 < x2 <= 10**(4)", "-10**(4) <= y1 < y2 <= 10**(4)" ] }, { "line": 104, "end_line": 104, "violates": [ "-10**(4) <= x1 < x2 <= 10**(4)", "-10**(4) <= y1 < y2 <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Locate the closest point of the square to the circle, you can then find the distance from this point to the center of the circle and check if this is less than or equal to the radius." ] }, { "question_id": 1402, "task_id": "reducing-dishes", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "satisfaction" ], "tests": { "total": 114, "kept": 113, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 106, "end_line": 106, "violates": [ "-1000 <= satisfaction[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming to find the optimal solution by saving the previous best like-time coefficient and its corresponding element sum.", "If adding the current element to the previous best like-time coefficient and its corresponding element sum would increase the best like-time coefficient, then go ahead and add it. Otherwise, keep the previous best like-time coefficient." ] }, { "question_id": 1403, "task_id": "minimum-subsequence-in-non-increasing-order", "drop": [], "similar": [ "count-hills-and-valleys-in-an-array" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 60, "kept": 54, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort elements and take each element from the largest until accomplish the conditions." ] }, { "question_id": 1404, "task_id": "number-of-steps-to-reduce-a-number-in-binary-representation-to-one", "drop": [], "similar": [ "minimum-moves-to-reach-target-score" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 101, "kept": 101, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Read the string from right to left, if the string ends in '0' then the number is even otherwise it is odd.", "Simulate the steps described in the binary string." ] }, { "question_id": 1405, "task_id": "longest-happy-string", "drop": [], "similar": [ "reorganize-string" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "a", "b", "c" ], "tests": { "total": 92, "kept": 91, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "a + b + c > 0" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a greedy approach.", "Use the letter with the maximum current limit that can be added without breaking the condition." ] }, { "question_id": 1406, "task_id": "stone-game-iii", "drop": [], "similar": [ "stone-game-v", "stone-game-vi", "stone-game-vii", "stone-game-viii", "stone-game-ix" ], "flags": [], "comparison": "exact", "parameter_names": [ "stoneValue" ], "tests": { "total": 102, "kept": 100, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "-1000 <= stoneValue[i] <= 1000" ] }, { "line": 98, "end_line": 98, "violates": [ "-1000 <= stoneValue[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The game can be mapped to minmax game. Alice tries to maximize the total score and Bob tries to minimize it.", "Use dynamic programming to simulate the game. If the total score was 0 the game is \"Tie\", and if it has positive value then \"Alice\" wins, otherwise \"Bob\" wins." ] }, { "question_id": 1408, "task_id": "string-matching-in-an-array", "drop": [], "similar": [ "substring-xor-queries" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "words" ], "tests": { "total": 97, "kept": 83, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "All the strings of words are unique." ] }, { "line": 9, "end_line": 9, "violates": [ "words[i] contains only lowercase English letters." ] }, { "line": 16, "end_line": 16, "violates": [ "words[i] contains only lowercase English letters." ] }, { "line": 17, "end_line": 17, "violates": [ "All the strings of words are unique." ] }, { "line": 27, "end_line": 27, "violates": [ "words[i] contains only lowercase English letters.", "All the strings of words are unique." ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= words[i].length <= 30" ] }, { "line": 49, "end_line": 49, "violates": [ "All the strings of words are unique." ] }, { "line": 53, "end_line": 53, "violates": [ "All the strings of words are unique." ] }, { "line": 57, "end_line": 57, "violates": [ "All the strings of words are unique." ] }, { "line": 63, "end_line": 63, "violates": [ "All the strings of words are unique." ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= words[i].length <= 30" ] }, { "line": 71, "end_line": 71, "violates": [ "words[i] contains only lowercase English letters." ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= words[i].length <= 30" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= words[i].length <= 30" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Bruteforce to find if one string is substring of another or use KMP algorithm." ] }, { "question_id": 1409, "task_id": "queries-on-a-permutation-with-key", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "queries", "m" ], "tests": { "total": 97, "kept": 46, "dropped": { "constraint_violation": 51 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= queries.length <= m" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= queries.length <= m" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= queries.length <= m" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= queries.length <= m" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= queries.length <= m" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= queries.length <= m" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= queries.length <= m" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= queries.length <= m" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= queries.length <= m", "1 <= queries.length <= m" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= queries.length <= m" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= queries.length <= m" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= queries.length <= m" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= queries.length <= m" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= queries.length <= m", "1 <= queries.length <= m" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= queries.length <= m" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= queries.length <= m" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= queries.length <= m" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= queries.length <= m" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= queries.length <= m" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= queries.length <= m" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= queries.length <= m" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= queries.length <= m", "1 <= queries.length <= m" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= queries.length <= m" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= queries.length <= m", "1 <= queries.length <= m" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= queries.length <= m" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= queries.length <= m" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= queries.length <= m" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= queries.length <= m" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= queries.length <= m" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= queries.length <= m" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= queries.length <= m" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= queries.length <= m" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= queries.length <= m" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= queries.length <= m" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= queries.length <= m" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= queries.length <= m" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= queries.length <= m" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= queries.length <= m", "1 <= queries.length <= m" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= queries.length <= m", "1 <= queries.length <= m" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= queries.length <= m" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= queries.length <= m", "1 <= queries.length <= m" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= queries.length <= m" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= queries.length <= m", "1 <= queries.length <= m" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= queries.length <= m" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= queries.length <= m" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= queries.length <= m" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= queries.length <= m" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= queries.length <= m" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= queries.length <= m" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= queries.length <= m" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= queries.length <= m" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Create the permutation P=[1,2,...,m], it could be a list for example.", "For each i, find the position of queries[i] with a simple scan over P and then move this to the beginning." ] }, { "question_id": 1410, "task_id": "html-entity-parser", "drop": [ "too_few_tests" ], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "text" ], "tests": { "total": 5, "kept": 5, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The string may contain any possible characters out of all the 256 ASCII characters." ] }, { "question_id": 1411, "task_id": "number-of-ways-to-paint-n-3-grid", "drop": [], "similar": [ "painting-a-grid-with-three-different-colors" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 37, "kept": 36, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= n <= 5000" ] } ], "unchecked_constraints": [ "n == grid.length" ], "public_tests": 2, "hints": [ "We will use Dynamic programming approach. we will try all possible configuration.", "Let dp[idx][prev1col][prev2col][prev3col] be the number of ways to color the rows of the grid from idx to n-1 keeping in mind that the previous row (idx - 1) has colors prev1col, prev2col and prev3col. Build the dp array to get the answer." ] }, { "question_id": 1413, "task_id": "minimum-value-to-get-positive-step-by-step-sum", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 95, "kept": 90, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 32, "end_line": 32, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 48, "end_line": 48, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 67, "end_line": 67, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 90, "end_line": 90, "violates": [ "-100 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the minimum prefix sum." ] }, { "question_id": 1414, "task_id": "find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "k" ], "tests": { "total": 70, "kept": 65, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 59, "end_line": 59, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Generate all Fibonacci numbers up to the limit (they are few).", "Use greedy solution, taking at every time the greatest Fibonacci number which is smaller than or equal to the current number. Subtract this Fibonacci number from the current number and repeat again the process." ] }, { "question_id": 1415, "task_id": "the-k-th-lexicographical-string-of-all-happy-strings-of-length-n", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 78, "kept": 47, "dropped": { "constraint_violation": 31 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= k <= 100" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= k <= 100" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= k <= 100" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= k <= 100" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= k <= 100" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= k <= 100" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= k <= 100" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= k <= 100" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= k <= 100" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= k <= 100" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= k <= 100" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= k <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= k <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= k <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= k <= 100" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= k <= 100" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= k <= 100" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= k <= 100" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= k <= 100" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= k <= 100" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= k <= 100" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= k <= 100" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= k <= 100" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= k <= 100" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= k <= 100" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= k <= 100" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= k <= 100" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= k <= 100" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= k <= 100" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= k <= 100" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= k <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Generate recursively all the happy strings of length n.", "Sort them in lexicographical order and return the kth string if it exists." ] }, { "question_id": 1416, "task_id": "restore-the-array", "drop": [], "similar": [ "number-of-ways-to-separate-numbers", "number-of-beautiful-partitions" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 104, "kept": 100, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming. Build an array dp where dp[i] is the number of ways you can divide the string starting from index i to the end.", "Keep in mind that the answer is modulo 10^9 + 7 and take the mod for each operation." ] }, { "question_id": 1417, "task_id": "reformat-the-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 136, "kept": 136, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Count the number of letters and digits in the string. if cntLetters - cntDigits has any of the values [-1, 0, 1] we have an answer, otherwise we don't have any answer.", "Build the string anyway as you wish. Keep in mind that you need to start with the type that has more characters if cntLetters \u2260 cntDigits." ] }, { "question_id": 1418, "task_id": "display-table-of-food-orders-in-a-restaurant", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "orders" ], "tests": { "total": 53, "kept": 53, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "tableNumberi is a valid integer between 1 and 500." ], "public_tests": 3, "hints": [ "Keep the frequency of all pairs (tableNumber, foodItem) using a hashmap.", "Sort rows by tableNumber and columns by foodItem, then process the resulted table." ] }, { "question_id": 1419, "task_id": "minimum-number-of-frogs-croaking", "drop": [], "similar": [ "divide-intervals-into-minimum-number-of-groups" ], "flags": [], "comparison": "exact", "parameter_names": [ "croakOfFrogs" ], "tests": { "total": 197, "kept": 196, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= croakOfFrogs.length <= 10**(5)" ] } ], "unchecked_constraints": [ "croakOfFrogs is either 'c', 'r', 'o', 'a', or 'k'." ], "public_tests": 3, "hints": [ "keep the frequency of all characters from \"croak\" using a hashmap.", "For each character in the given string, greedily match it to a possible \"croak\"." ] }, { "question_id": 1420, "task_id": "build-array-where-you-can-find-the-maximum-exactly-k-comparisons", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "m", "k" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming approach. Build dp table where dp[a][b][c] is the number of ways you can start building the array starting from index a where the search_cost = c and the maximum used integer was b.", "Recursively, solve the small sub-problems first. Optimize your answer by stopping the search if you exceeded k changes." ] }, { "question_id": 1422, "task_id": "maximum-score-after-splitting-a-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 143, "kept": 143, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The string s consists of characters '0' and '1' only." ], "public_tests": 3, "hints": [ "Precompute a prefix sum of ones ('1').", "Iterate from left to right counting the number of zeros ('0'), then use the precomputed prefix sum for counting ones ('1'). Update the answer." ] }, { "question_id": 1423, "task_id": "maximum-points-you-can-obtain-from-cards", "drop": [], "similar": [ "maximum-score-from-performing-multiplication-operations", "removing-minimum-and-maximum-from-array", "minimum-recolors-to-get-k-consecutive-black-blocks", "maximum-spending-after-buying-items" ], "flags": [], "comparison": "exact", "parameter_names": [ "cardPoints", "k" ], "tests": { "total": 78, "kept": 76, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= cardPoints[i] <= 10**(4)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= cardPoints[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let the sum of all points be total_pts. You need to remove a sub-array from cardPoints with length n - k.", "Keep a window of size n - k over the array. The answer is max(answer, total_pts - sumOfCurrentWindow)" ] }, { "question_id": 1424, "task_id": "diagonal-traverse-ii", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 70, "kept": 70, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= sum(nums[i].length) <= 10**(5)" ], "public_tests": 2, "hints": [ "Notice that numbers with equal sums of row and column indexes belong to the same diagonal.", "Store them in tuples (sum, row, val), sort them, and then regroup the answer." ] }, { "question_id": 1425, "task_id": "constrained-subsequence-sum", "drop": [], "similar": [ "maximum-element-sum-of-a-complete-subset-of-indices" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 115, "kept": 114, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 84, "end_line": 84, "violates": [ "-10**(4) <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming.", "Let dp[i] be the solution for the prefix of the array that ends at index i, if the element at index i is in the subsequence.", "dp[i] = nums[i] + max(0, dp[i-k], dp[i-k+1], ..., dp[i-1])", "Use a heap with the sliding window technique to optimize the dp." ] }, { "question_id": 1426, "task_id": "counting-elements", "drop": [ "premium" ] }, { "question_id": 1427, "task_id": "perform-string-shifts", "drop": [ "premium" ] }, { "question_id": 1430, "task_id": "check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree", "drop": [ "premium" ] }, { "question_id": 1431, "task_id": "kids-with-the-greatest-number-of-candies", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "candies", "extraCandies" ], "tests": { "total": 81, "kept": 71, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= extraCandies <= 50" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= candies[i] <= 100" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= candies[i] <= 100" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= candies[i] <= 100" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= extraCandies <= 50" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= candies[i] <= 100", "1 <= extraCandies <= 50" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= candies[i] <= 100", "1 <= extraCandies <= 50" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= extraCandies <= 50" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= extraCandies <= 50" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= extraCandies <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each kid check if candies[i] + extraCandies \u2265 maximum in Candies[i]." ] }, { "question_id": 1432, "task_id": "max-difference-you-can-get-from-changing-an-integer", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 81, "kept": 44, "dropped": { "constraint_violation": 37 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= num <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We need to get the max and min value after changing num and the answer is max - min.", "Use brute force, try all possible changes and keep the minimum and maximum values." ] }, { "question_id": 1433, "task_id": "check-if-a-string-can-break-another-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "s2" ], "tests": { "total": 120, "kept": 94, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "s2.length == n" ] }, { "line": 27, "end_line": 27, "violates": [ "s2.length == n" ] }, { "line": 31, "end_line": 31, "violates": [ "s2.length == n" ] }, { "line": 33, "end_line": 33, "violates": [ "s2.length == n" ] }, { "line": 37, "end_line": 37, "violates": [ "s2.length == n" ] }, { "line": 38, "end_line": 38, "violates": [ "s2.length == n" ] }, { "line": 41, "end_line": 41, "violates": [ "s2.length == n" ] }, { "line": 43, "end_line": 43, "violates": [ "s2.length == n" ] }, { "line": 46, "end_line": 46, "violates": [ "s2.length == n" ] }, { "line": 51, "end_line": 51, "violates": [ "s2.length == n" ] }, { "line": 54, "end_line": 54, "violates": [ "s2.length == n" ] }, { "line": 61, "end_line": 61, "violates": [ "s2.length == n" ] }, { "line": 63, "end_line": 63, "violates": [ "s2.length == n" ] }, { "line": 64, "end_line": 64, "violates": [ "s2.length == n" ] }, { "line": 67, "end_line": 67, "violates": [ "s2.length == n" ] }, { "line": 71, "end_line": 71, "violates": [ "s2.length == n" ] }, { "line": 73, "end_line": 73, "violates": [ "s2.length == n" ] }, { "line": 75, "end_line": 75, "violates": [ "s2.length == n" ] }, { "line": 78, "end_line": 78, "violates": [ "s2.length == n" ] }, { "line": 81, "end_line": 81, "violates": [ "s2.length == n" ] }, { "line": 88, "end_line": 88, "violates": [ "s2.length == n" ] }, { "line": 92, "end_line": 92, "violates": [ "s2.length == n" ] }, { "line": 93, "end_line": 93, "violates": [ "s2.length == n" ] }, { "line": 98, "end_line": 98, "violates": [ "s2.length == n" ] }, { "line": 111, "end_line": 111, "violates": [ "s2.length == n" ] }, { "line": 121, "end_line": 121, "violates": [ "s2.length == n" ] } ], "unchecked_constraints": [ "All strings consist of lowercase English letters." ], "public_tests": 3, "hints": [ "Sort both strings and then check if one of them can break the other." ] }, { "question_id": 1434, "task_id": "number-of-ways-to-wear-different-hats-to-each-other", "drop": [], "similar": [ "the-number-of-good-subsets" ], "flags": [], "comparison": "exact", "parameter_names": [ "hats" ], "tests": { "total": 83, "kept": 76, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= hats[i][j] <= 40" ] }, { "line": 6, "end_line": 6, "violates": [ "1 <= hats[i][j] <= 40" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= n <= 10" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= n <= 10" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= n <= 10" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= hats[i][j] <= 40" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= n <= 10" ] } ], "unchecked_constraints": [ "hats[i] contains a list of unique integers." ], "public_tests": 3, "hints": [ "Dynamic programming + bitmask.", "dp(peopleMask, idHat) number of ways to wear different hats given a bitmask (people visited) and used hats from 1 to idHat-1." ] }, { "question_id": 1436, "task_id": "destination-city", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "paths" ], "tests": { "total": 74, "kept": 42, "dropped": { "constraint_violation": 32 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 4, "end_line": 4, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 33, "end_line": 33, "violates": [ "cityAi != cityBi" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= cityAi.length, cityBi.length <= 10" ] } ], "unchecked_constraints": [ "All strings consist of lowercase and uppercase English letters and the space character." ], "public_tests": 3, "hints": [ "Start in any city and use the path to move to the next city.", "Eventually, you will reach a city with no path outgoing, this is the destination city." ] }, { "question_id": 1437, "task_id": "check-if-all-1s-are-at-least-length-k-places-away", "drop": [], "similar": [ "task-scheduler-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 104, "kept": 104, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums[i] is 0 or 1" ], "public_tests": 2, "hints": [ "Each time you find a number 1, check whether or not it is K or more places away from the next one. If it's not, return false." ] }, { "question_id": 1438, "task_id": "longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit", "drop": [], "similar": [ "partition-array-such-that-maximum-difference-is-k", "count-subarrays-with-fixed-bounds" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "limit" ], "tests": { "total": 184, "kept": 178, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 158, "end_line": 158, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a sliding window approach keeping the maximum and minimum value using a data structure like a multiset from STL in C++.", "More specifically, use the two pointer technique, moving the right pointer as far as possible to the right until the subarray is not valid (maxValue - minValue > limit), then moving the left pointer until the subarray is valid again (maxValue - minValue <= limit). Keep repeating this process." ] }, { "question_id": 1439, "task_id": "find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "mat", "k" ], "tests": { "total": 85, "kept": 82, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 47, "end_line": 47, "violates": [ "1 <= mat[i][j] <= 5000" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= mat[i][j] <= 5000" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= mat[i][j] <= 5000" ] } ], "unchecked_constraints": [ "n == mat.length[i]", "mat[i] is a non-decreasing array.", "1 <= m, n <= 40", "1 <= k <= min(200, n**(m))" ], "public_tests": 3, "hints": [ "Save all visited sums and corresponding indexes in a priority queue. Then, once you pop the smallest sum so far, you can quickly identify the next m candidates for smallest sum by incrementing each row index by 1." ] }, { "question_id": 1441, "task_id": "build-an-array-with-stack-operations", "drop": [], "similar": [ "minimum-operations-to-collect-elements" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "target", "n" ], "tests": { "total": 113, "kept": 112, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= n <= 100" ] } ], "unchecked_constraints": [ "target is strictly increasing." ], "public_tests": 3, "hints": [ "Use \u201cPush\u201d for numbers to be kept in target array and [\u201cPush\u201d, \u201cPop\u201d] for numbers to be discarded." ] }, { "question_id": 1442, "task_id": "count-triplets-that-can-form-two-arrays-of-equal-xor", "drop": [], "similar": [ "find-the-original-array-of-prefix-xor" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 93, "kept": 77, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= arr[i] <= 10**(8)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= arr[i] <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We are searching for sub-array of length \u2265 2 and we need to split it to 2 non-empty arrays so that the xor of the first array is equal to the xor of the second array. This is equivalent to searching for sub-array with xor = 0.", "Keep the prefix xor of arr in another array, check the xor of all sub-arrays in O(n^2), if the xor of sub-array of length x is 0 add x-1 to the answer." ] }, { "question_id": 1444, "task_id": "number-of-ways-of-cutting-a-pizza", "drop": [], "similar": [ "selling-pieces-of-wood" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "pizza", "k" ], "tests": { "total": 72, "kept": 70, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 56, "end_line": 56, "violates": [ "cols == pizza[i].length" ] }, { "line": 73, "end_line": 73, "violates": [ "cols == pizza[i].length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Note that after each cut the remaining piece of pizza always has the lower right coordinate at (rows-1,cols-1).", "Use dynamic programming approach with states (row1, col1, c) which computes the number of ways of cutting the pizza using \"c\" cuts where the current piece of pizza has upper left coordinate at (row1,col1) and lower right coordinate at (rows-1,cols-1).", "For the transitions try all vertical and horizontal cuts such that the piece of pizza you have to give a person must contain at least one apple. The base case is when c=k-1.", "Additionally use a 2D dynamic programming to respond in O(1) if a piece of pizza contains at least one apple." ] }, { "question_id": 1446, "task_id": "consecutive-characters", "drop": [], "similar": [ "max-consecutive-ones", "longest-continuous-increasing-subsequence", "check-if-an-array-is-consecutive", "count-number-of-homogenous-substrings", "longest-substring-of-one-repeating-character", "minimum-number-of-chairs-in-a-waiting-room" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 70, "kept": 70, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Keep an array power where power[i] is the maximum power of the i-th character.", "The answer is max(power[i])." ] }, { "question_id": 1447, "task_id": "simplified-fractions", "drop": [], "similar": [], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "n" ], "tests": { "total": 22, "kept": 22, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "A fraction is fully simplified if there is no integer that divides cleanly into the numerator and denominator.", "In other words the greatest common divisor of the numerator and the denominator of a simplified fraction is 1." ] }, { "question_id": 1448, "task_id": "count-good-nodes-in-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 85, "kept": 0, "dropped": { "unreadable": 85 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the binary tree is in the range [1, 10**5].", "Each node's value is between [-10**4, 10**4]." ] }, { "question_id": 1449, "task_id": "form-largest-integer-with-digits-that-add-up-to-target", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "cost", "target" ], "tests": { "total": 110, "kept": 110, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming to find the maximum digits to paint given a total cost.", "Build the largest number possible using this DP table." ] }, { "question_id": 1450, "task_id": "number-of-students-doing-homework-at-a-given-time", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "startTime", "endTime", "queryTime" ], "tests": { "total": 95, "kept": 83, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= startTime[i] <= endTime[i] <= 1000", "1 <= startTime[i] <= endTime[i] <= 1000" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= startTime[i] <= endTime[i] <= 1000" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= startTime[i] <= endTime[i] <= 1000", "1 <= startTime[i] <= endTime[i] <= 1000" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= startTime[i] <= endTime[i] <= 1000" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= startTime[i] <= endTime[i] <= 1000" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= startTime[i] <= endTime[i] <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= startTime[i] <= endTime[i] <= 1000" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= startTime[i] <= endTime[i] <= 1000" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= startTime[i] <= endTime[i] <= 1000" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= startTime[i] <= endTime[i] <= 1000" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= startTime[i] <= endTime[i] <= 1000", "1 <= queryTime <= 1000" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= startTime[i] <= endTime[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Imagine that startTime[i] and endTime[i] form an interval (i.e. [startTime[i], endTime[i]]).", "The answer is how many times the queryTime laid in those mentioned intervals." ] }, { "question_id": 1451, "task_id": "rearrange-words-in-a-sentence", "drop": [], "similar": [], "flags": [ "figure_reference" ], "comparison": "exact", "parameter_names": [ "text" ], "tests": { "total": 152, "kept": 152, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "text begins with a capital letter and then contains lowercase letters and single space between words." ], "public_tests": 3, "hints": [ "Store each word and their relative position. Then, sort them by length of words in case of tie by their original order." ] }, { "question_id": 1452, "task_id": "people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "favoriteCompanies" ], "tests": { "total": 79, "kept": 75, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "All strings in favoriteCompanies[i] are distinct." ] }, { "line": 33, "end_line": 33, "violates": [ "All strings in favoriteCompanies[i] are distinct." ] }, { "line": 42, "end_line": 42, "violates": [ "All strings in favoriteCompanies[i] are distinct." ] }, { "line": 63, "end_line": 63, "violates": [ "All strings in favoriteCompanies[i] are distinct." ] } ], "unchecked_constraints": [ "All lists of favorite companies are distinct, that is, If we sort alphabetically each list then favoriteCompanies[i] != favoriteCompanies[j].", "All strings consist of lowercase English letters only." ], "public_tests": 3, "hints": [ "Use hashing to convert company names in numbers and then for each list check if this is a subset of any other list.", "In order to check if a list is a subset of another list, use two pointers technique to get a linear solution for this task. The total complexity will be O(n^2 * m) where n is the number of lists and m is the maximum number of elements in a list." ] }, { "question_id": 1453, "task_id": "maximum-number-of-darts-inside-of-a-circular-dartboard", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "darts", "r" ], "tests": { "total": 130, "kept": 126, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= r <= 5000" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= r <= 5000" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= r <= 5000" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= r <= 5000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If there is an optimal solution, you can always move the circle so that two points lie on the boundary of the circle.", "When the radius is fixed, you can find either 0 or 1 or 2 circles that pass two given points at the same time.", "Loop for each pair of points and find the center of the circle, after that count the number of points inside the circle." ] }, { "question_id": 1455, "task_id": "check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence", "drop": [], "similar": [ "counting-words-with-a-given-prefix", "count-prefixes-of-a-given-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "sentence", "searchWord" ], "tests": { "total": 172, "kept": 169, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 50, "end_line": 50, "violates": [ "sentence consists of lowercase English letters and spaces." ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= searchWord.length <= 10" ] }, { "line": 154, "end_line": 154, "violates": [ "sentence consists of lowercase English letters and spaces." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "First extract the words of the sentence.", "Check for each word if searchWord occurs at index 0, if so return the index of this word (1-indexed)", "If searchWord doesn't exist as a prefix of any word return the default value (-1)." ] }, { "question_id": 1456, "task_id": "maximum-number-of-vowels-in-a-substring-of-given-length", "drop": [], "similar": [ "maximum-white-tiles-covered-by-a-carpet", "minimum-recolors-to-get-k-consecutive-black-blocks", "length-of-the-longest-alphabetical-continuous-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 80, "kept": 79, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= k <= s.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Keep a window of size k and maintain the number of vowels in it.", "Keep moving the window and update the number of vowels while moving. Answer is max number of vowels of any window." ] }, { "question_id": 1458, "task_id": "max-dot-product-of-two-subsequences", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming, define DP[i][j] as the maximum dot product of two subsequences starting in the position i of nums1 and position j of nums2." ] }, { "question_id": 1460, "task_id": "make-two-arrays-equal-by-reversing-subarrays", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "target", "arr" ], "tests": { "total": 122, "kept": 114, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "target.length == arr.length", "1 <= arr[i] <= 1000" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= target[i] <= 1000", "1 <= arr[i] <= 1000" ] }, { "line": 49, "end_line": 49, "violates": [ "target.length == arr.length" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= target[i] <= 1000", "1 <= arr[i] <= 1000" ] }, { "line": 77, "end_line": 77, "violates": [ "target.length == arr.length" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= target[i] <= 1000", "1 <= arr[i] <= 1000" ] }, { "line": 102, "end_line": 102, "violates": [ "target.length == arr.length" ] }, { "line": 114, "end_line": 114, "violates": [ "target.length == arr.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Each element of target should have a corresponding element in arr, and if it doesn't have a corresponding element, return false.", "To solve it easiely you can sort the two arrays and check if they are equal." ] }, { "question_id": 1461, "task_id": "check-if-a-string-contains-all-binary-codes-of-size-k", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 102, "kept": 102, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "We need only to check all sub-strings of length k.", "The number of distinct sub-strings should be exactly 2^k." ] }, { "question_id": 1462, "task_id": "course-schedule-iv", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "numCourses", "prerequisites", "queries" ], "tests": { "total": 181, "kept": 181, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All the pairs [ai, bi] are unique.", "The prerequisites graph has no cycles.", "0 <= ui, vi <= numCourses - 1", "ui != vi" ], "public_tests": 3, "hints": [ "Imagine if the courses are nodes of a graph. We need to build an array isReachable[i][j].", "Start a bfs from each course i and assign for each course j you visit isReachable[i][j] = True.", "Answer the queries from the isReachable array." ] }, { "question_id": 1463, "task_id": "cherry-pickup-ii", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 74, "kept": 73, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 45, "end_line": 45, "violates": [ "0 <= grid[i][j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use dynamic programming, define DP[i][j][k]: The maximum cherries that both robots can take starting on the ith row, and column j and k of Robot 1 and 2 respectively." ] }, { "question_id": 1464, "task_id": "maximum-product-of-two-elements-in-an-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 96, "kept": 95, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 10**3" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use brute force: two loops to select i and j, then select the maximum value of (nums[i]-1)*(nums[j]-1)." ] }, { "question_id": 1465, "task_id": "maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "h", "w", "horizontalCuts", "verticalCuts" ], "tests": { "total": 92, "kept": 85, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 51, "end_line": 51, "violates": [ "1 <= horizontalCuts[i] < h", "1 <= verticalCuts[i] < w" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= verticalCuts[i] < w" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= horizontalCuts[i] < h", "1 <= verticalCuts[i] < w" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= verticalCuts[i] < w" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= horizontalCuts[i] < h", "1 <= verticalCuts[i] < w" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= verticalCuts[i] < w" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= horizontalCuts[i] < h", "1 <= verticalCuts[i] < w" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the arrays, then compute the maximum difference between two consecutive elements for horizontal cuts and vertical cuts.", "The answer is the product of these maximum values in horizontal cuts and vertical cuts." ] }, { "question_id": 1466, "task_id": "reorder-routes-to-make-all-paths-lead-to-the-city-zero", "drop": [], "similar": [ "minimum-edge-reversals-so-every-node-is-reachable" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "connections" ], "tests": { "total": 57, "kept": 56, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "connections.length == n - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Treat the graph as undirected. Start a dfs from the root, if you come across an edge in the forward direction, you need to reverse the edge." ] }, { "question_id": 1467, "task_id": "probability-of-a-two-boxes-having-the-same-number-of-distinct-balls", "drop": [], "similar": [], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "balls" ], "tests": { "total": 102, "kept": 76, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "sum(balls) is even." ] }, { "line": 8, "end_line": 8, "violates": [ "sum(balls) is even." ] }, { "line": 11, "end_line": 11, "violates": [ "sum(balls) is even." ] }, { "line": 22, "end_line": 22, "violates": [ "sum(balls) is even." ] }, { "line": 29, "end_line": 29, "violates": [ "sum(balls) is even." ] }, { "line": 30, "end_line": 30, "violates": [ "sum(balls) is even.", "sum(balls) is even." ] }, { "line": 33, "end_line": 33, "violates": [ "sum(balls) is even.", "sum(balls) is even." ] }, { "line": 39, "end_line": 39, "violates": [ "sum(balls) is even." ] }, { "line": 40, "end_line": 40, "violates": [ "sum(balls) is even." ] }, { "line": 43, "end_line": 43, "violates": [ "sum(balls) is even." ] }, { "line": 44, "end_line": 44, "violates": [ "sum(balls) is even." ] }, { "line": 48, "end_line": 48, "violates": [ "sum(balls) is even." ] }, { "line": 50, "end_line": 50, "violates": [ "sum(balls) is even." ] }, { "line": 51, "end_line": 51, "violates": [ "sum(balls) is even." ] }, { "line": 53, "end_line": 53, "violates": [ "sum(balls) is even." ] }, { "line": 60, "end_line": 60, "violates": [ "sum(balls) is even." ] }, { "line": 62, "end_line": 62, "violates": [ "sum(balls) is even." ] }, { "line": 65, "end_line": 65, "violates": [ "sum(balls) is even." ] }, { "line": 67, "end_line": 67, "violates": [ "sum(balls) is even." ] }, { "line": 76, "end_line": 76, "violates": [ "sum(balls) is even." ] }, { "line": 78, "end_line": 78, "violates": [ "sum(balls) is even." ] }, { "line": 87, "end_line": 87, "violates": [ "sum(balls) is even.", "sum(balls) is even." ] }, { "line": 94, "end_line": 94, "violates": [ "sum(balls) is even.", "sum(balls) is even." ] }, { "line": 96, "end_line": 96, "violates": [ "sum(balls) is even." ] }, { "line": 97, "end_line": 97, "violates": [ "sum(balls) is even." ] }, { "line": 101, "end_line": 101, "violates": [ "sum(balls) is even." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Check how many ways you can distribute the balls between the boxes.", "Consider that one way you will use (x1, x2, x3, ..., xk) where xi is the number of balls from colour i. The probability of achieving this way randomly is ( (ball1 C x1) * (ball2 C x2) * (ball3 C x3) * ... * (ballk C xk)) / (2n C n).", "The probability of a draw is the sigma of probabilities of different ways to achieve draw.", "Can you use Dynamic programming to solve this problem in a better complexity ?" ] }, { "question_id": 1469, "task_id": "find-all-the-lonely-nodes", "drop": [ "premium" ] }, { "question_id": 1470, "task_id": "shuffle-the-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "n" ], "tests": { "total": 71, "kept": 60, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= nums[i] <= 10**3" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 10**3", "1 <= nums[i] <= 10**3" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 10**3" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 10**3" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 10**3" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 10**3" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 10**3" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 10**3" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 10**3", "1 <= nums[i] <= 10**3" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 10**3" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10**3" ] } ], "unchecked_constraints": [ "nums.length == 2n" ], "public_tests": 3, "hints": [ "Use two pointers to create the new array of 2n elements. The first starting at the beginning and the other starting at (n+1)th position. Alternate between them and create the new array." ] }, { "question_id": 1471, "task_id": "the-k-strongest-values-in-an-array", "drop": [], "similar": [], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "arr", "k" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Calculate the centre of the array as defined in the statement.", "Use custom sort function to sort values (Strongest first), then slice the first k." ] }, { "question_id": 1473, "task_id": "paint-house-iii", "drop": [], "similar": [ "number-of-distinct-roll-sequences", "paint-house-iv" ], "flags": [], "comparison": "exact", "parameter_names": [ "houses", "cost", "m", "n", "target" ], "tests": { "total": 67, "kept": 66, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 53, "end_line": 53, "violates": [ "1 <= cost[i][j] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use Dynamic programming.", "Define dp[i][j][k] as the minimum cost where we have k neighborhoods in the first i houses and the i-th house is painted with the color j." ], "similar_to_test": [ "3429 paint-house-iv" ] }, { "question_id": 1474, "task_id": "delete-n-nodes-after-m-nodes-of-a-linked-list", "drop": [ "premium" ] }, { "question_id": 1475, "task_id": "final-prices-with-a-special-discount-in-a-shop", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "prices" ], "tests": { "total": 117, "kept": 110, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= prices[i] <= 1000" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= prices[i] <= 1000" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= prices[i] <= 1000" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= prices[i] <= 1000" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= prices[i] <= 1000" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= prices[i] <= 1000" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= prices[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use brute force: For the ith item in the shop with a loop find the first position j satisfying the conditions and apply the discount, otherwise, the discount is 0." ] }, { "question_id": 1477, "task_id": "find-two-non-overlapping-sub-arrays-each-with-target-sum", "drop": [], "similar": [ "find-subarrays-with-equal-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "target" ], "tests": { "total": 85, "kept": 84, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 58, "end_line": 58, "violates": [ "1 <= arr[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let's create two arrays prefix and suffix where prefix[i] is the minimum length of sub-array ends before i and has sum = k, suffix[i] is the minimum length of sub-array starting at or after i and has sum = k.", "The answer we are searching for is min(prefix[i] + suffix[i]) for all values of i from 0 to n-1 where n == arr.length.", "If you are still stuck with how to build prefix and suffix, you can store for each index i the length of the sub-array starts at i and has sum = k or infinity otherwise, and you can use it to build both prefix and suffix." ] }, { "question_id": 1478, "task_id": "allocate-mailboxes", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "houses", "k" ], "tests": { "total": 108, "kept": 97, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= houses[i] <= 10**(4)", "1 <= houses[i] <= 10**(4)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= houses[i] <= 10**(4)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= houses[i] <= 10**(4)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= houses[i] <= 10**(4)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= houses[i] <= 10**(4)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= houses[i] <= 10**(4)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= houses[i] <= 10**(4)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= houses[i] <= 10**(4)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= houses[i] <= 10**(4)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= houses[i] <= 10**(4)", "1 <= houses[i] <= 10**(4)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= houses[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If k =1, the minimum distance is obtained allocating the mailbox in the median of the array houses.", "Generalize this idea, using dynamic programming allocating k mailboxes." ] }, { "question_id": 1480, "task_id": "running-sum-of-1d-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 95, "kept": 88, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "-10**6 <= nums[i] <= 10**6" ] }, { "line": 52, "end_line": 52, "violates": [ "-10**6 <= nums[i] <= 10**6" ] }, { "line": 62, "end_line": 62, "violates": [ "-10**6 <= nums[i] <= 10**6" ] }, { "line": 67, "end_line": 67, "violates": [ "-10**6 <= nums[i] <= 10**6" ] }, { "line": 76, "end_line": 76, "violates": [ "-10**6 <= nums[i] <= 10**6" ] }, { "line": 77, "end_line": 77, "violates": [ "-10**6 <= nums[i] <= 10**6" ] }, { "line": 93, "end_line": 93, "violates": [ "-10**6 <= nums[i] <= 10**6" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think about how we can calculate the i-th number in the running sum from the (i-1)-th number." ] }, { "question_id": 1481, "task_id": "least-number-of-unique-integers-after-k-removals", "drop": [], "similar": [ "maximum-number-of-distinct-elements-after-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "k" ], "tests": { "total": 69, "kept": 69, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a map to count the frequencies of the numbers in the array.", "An optimal strategy is to remove the numbers with the smallest count first." ], "similar_to_test": [ "3397 maximum-number-of-distinct-elements-after-operations" ] }, { "question_id": 1482, "task_id": "minimum-number-of-days-to-make-m-bouquets", "drop": [], "similar": [ "maximize-the-confusion-of-an-exam", "earliest-possible-day-of-full-bloom" ], "flags": [], "comparison": "exact", "parameter_names": [ "bloomDay", "m", "k" ], "tests": { "total": 93, "kept": 93, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If we can make m or more bouquets at day x, then we can still make m or more bouquets at any day y > x.", "We can check easily if we can make enough bouquets at day x if we can get group adjacent flowers at day x." ] }, { "question_id": 1485, "task_id": "clone-binary-tree-with-random-pointer", "drop": [ "premium" ] }, { "question_id": 1486, "task_id": "xor-operation-in-an-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "start" ], "tests": { "total": 92, "kept": 92, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "n == nums.length" ], "public_tests": 2, "hints": [ "Simulate the process, create an array nums and return the Bitwise XOR of all elements of it." ] }, { "question_id": 1487, "task_id": "making-file-names-unique", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "names" ], "tests": { "total": 66, "kept": 66, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "names[i] consists of lowercase English letters, digits, and/or round brackets." ], "public_tests": 3, "hints": [ "Keep a map of each name and the smallest valid integer that can be appended as a suffix to it.", "If the name is not present in the map, you can use it without adding any suffixes.", "If the name is present in the map, append the smallest proper suffix, and add the new name to the map." ] }, { "question_id": 1488, "task_id": "avoid-flood-in-the-city", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "rains" ], "tests": { "total": 242, "kept": 242, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Keep An array of the last day there was rains over each city.", "Keep an array of the days you can dry a lake when you face one.", "When it rains over a lake, check the first possible day you can dry this lake and assign this day to this lake." ] }, { "question_id": 1489, "task_id": "find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 55, "kept": 36, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "0 <= ai < bi < n" ] }, { "line": 7, "end_line": 7, "violates": [ "0 <= ai < bi < n" ] }, { "line": 9, "end_line": 9, "violates": [ "0 <= ai < bi < n" ] }, { "line": 10, "end_line": 10, "violates": [ "0 <= ai < bi < n" ] }, { "line": 14, "end_line": 14, "violates": [ "0 <= ai < bi < n" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= ai < bi < n" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= ai < bi < n" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= ai < bi < n" ] }, { "line": 35, "end_line": 35, "violates": [ "0 <= ai < bi < n" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= ai < bi < n" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= ai < bi < n" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= ai < bi < n" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= edges.length <= min(200, n * (n - 1) / 2)", "0 <= ai < bi < n" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= ai < bi < n" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= ai < bi < n" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= ai < bi < n" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= ai < bi < n" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= ai < bi < n" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= ai < bi < n" ] } ], "unchecked_constraints": [ "All pairs (ai, bi) are distinct." ], "public_tests": 2, "hints": [ "Use the Kruskal algorithm to find the minimum spanning tree by sorting the edges and picking edges from ones with smaller weights.", "Use a disjoint set to avoid adding redundant edges that result in a cycle.", "To find if one edge is critical, delete that edge and re-run the MST algorithm and see if the weight of the new MST increases.", "To find if one edge is non-critical (in any MST), include that edge to the accepted edge list and continue the MST algorithm, then see if the resulting MST has the same weight of the initial MST of the entire graph." ] }, { "question_id": 1491, "task_id": "average-salary-excluding-the-minimum-and-maximum-salary", "drop": [], "similar": [], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "salary" ], "tests": { "total": 99, "kept": 79, "dropped": { "constraint_violation": 20 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 38, "end_line": 38, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 42, "end_line": 42, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 45, "end_line": 45, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 54, "end_line": 54, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 60, "end_line": 60, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 66, "end_line": 66, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 68, "end_line": 68, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 69, "end_line": 69, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 72, "end_line": 72, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 78, "end_line": 78, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 80, "end_line": 80, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 81, "end_line": 81, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 82, "end_line": 82, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 85, "end_line": 85, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 88, "end_line": 88, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 90, "end_line": 90, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 91, "end_line": 91, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 94, "end_line": 94, "violates": [ "1000 <= salary[i] <= 10**(6)" ] }, { "line": 97, "end_line": 97, "violates": [ "1000 <= salary[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Get the total sum and subtract the minimum and maximum value in the array. Finally divide the result by n - 2." ] }, { "question_id": 1492, "task_id": "the-kth-factor-of-n", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 81, "kept": 79, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 49, "end_line": 49, "violates": [ "1 <= k <= n <= 1000" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= k <= n <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The factors of n will be always in the range [1, n].", "Keep a list of all factors sorted. Loop i from 1 to n and add i if n % i == 0. Return the kth factor if it exist in this list." ] }, { "question_id": 1493, "task_id": "longest-subarray-of-1s-after-deleting-one-element", "drop": [], "similar": [ "max-consecutive-ones-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 92, "kept": 92, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Maintain a sliding window where there is at most one zero in it." ] }, { "question_id": 1494, "task_id": "parallel-courses-ii", "drop": [], "similar": [ "parallel-courses" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "relations", "k" ], "tests": { "total": 92, "kept": 92, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All the pairs [prevCoursei, nextCoursei] are unique.", "The given graph is a directed acyclic graph." ], "public_tests": 2, "hints": [ "Use backtracking with states (bitmask, degrees) where bitmask represents the set of courses, if the ith bit is 1 then the ith course was taken, otherwise, you can take the ith course. Degrees represent the degree for each course (nodes in the graph).", "Note that you can only take nodes (courses) with degree = 0 and it is optimal at every step in the backtracking take the maximum number of courses limited by k." ] }, { "question_id": 1496, "task_id": "path-crossing", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "path" ], "tests": { "total": 186, "kept": 184, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "1 <= path.length <= 10**(4)" ] }, { "line": 75, "end_line": 75, "violates": [ "path[i] is either 'N', 'S', 'E', or 'W'." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simulate the process while keeping track of visited points.", "Use a set to store previously visited points." ] }, { "question_id": 1497, "task_id": "check-if-array-pairs-are-divisible-by-k", "drop": [], "similar": [ "count-array-pairs-divisible-by-k", "minimum-deletions-to-make-array-divisible", "count-pairs-that-form-a-complete-day-ii", "count-pairs-that-form-a-complete-day-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "k" ], "tests": { "total": 93, "kept": 87, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "n is even." ] }, { "line": 32, "end_line": 32, "violates": [ "n is even." ] }, { "line": 55, "end_line": 55, "violates": [ "-10**(9) <= arr[i] <= 10**(9)", "1 <= k <= 10**(5)" ] }, { "line": 64, "end_line": 64, "violates": [ "n is even." ] }, { "line": 75, "end_line": 75, "violates": [ "n is even." ] }, { "line": 77, "end_line": 77, "violates": [ "n is even." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Keep an array of the frequencies of ((x % k) + k) % k for each x in arr.", "for each i in [0, k - 1] we need to check if freq[i] == freq[k - i]", "Take care of the case when i == k - i and when i == 0" ] }, { "question_id": 1498, "task_id": "number-of-subsequences-that-satisfy-the-given-sum-condition", "drop": [], "similar": [ "minimum-operations-to-form-subsequence-with-target-sum", "find-the-sum-of-subsequence-powers", "find-the-sum-of-the-power-of-all-subsequences" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 81, "kept": 68, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= target <= 10**(6)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= target <= 10**(6)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= target <= 10**(6)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= target <= 10**(6)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= target <= 10**(6)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= target <= 10**(6)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= target <= 10**(6)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= target <= 10**(6)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= target <= 10**(6)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= target <= 10**(6)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= target <= 10**(6)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= target <= 10**(6)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= target <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the array nums.", "Use two pointers approach: Given an index i (choose it as the minimum in a subsequence) find the maximum j where j \u2265 i and nums[i] +nums[j] \u2264 target.", "Count the number of subsequences." ] }, { "question_id": 1499, "task_id": "max-value-of-equation", "drop": [], "similar": [ "count-pairs-in-two-arrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "points", "k" ], "tests": { "total": 108, "kept": 102, "dropped": { "constraint_violation": 5, "non_finite": 1 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "-10**(8) <= xi, yi <= 10**(8)" ] }, { "line": 21, "end_line": 21, "violates": [ "-10**(8) <= xi, yi <= 10**(8)" ] }, { "line": 23, "end_line": 23, "violates": [ "-10**(8) <= xi, yi <= 10**(8)" ] }, { "line": 44, "end_line": 44, "violates": [ "-10**(8) <= xi, yi <= 10**(8)", "0 <= k <= 2 * 10**(8)" ] }, { "line": 57, "end_line": 57, "violates": [ "-10**(8) <= xi, yi <= 10**(8)" ] }, { "line": 78, "end_line": 78, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] } ], "unchecked_constraints": [ "xi < xj for all 1 <= i < j <= points.length", "xi form a strictly increasing sequence." ], "public_tests": 2, "hints": [ "Use a priority queue to store for each point i, the tuple [yi-xi, xi]", "Loop through the array and pop elements from the heap if the condition xj - xi > k, where j is the current index and i is the point on top the queue.", "After popping elements from the queue. If the queue is not empty, calculate the equation with the current point and the point on top of the queue and maximize the answer." ] }, { "question_id": 1502, "task_id": "can-make-arithmetic-progression-from-sequence", "drop": [], "similar": [ "arithmetic-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 161, "kept": 156, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 47, "end_line": 47, "violates": [ "-10**(6) <= arr[i] <= 10**(6)" ] }, { "line": 48, "end_line": 48, "violates": [ "-10**(6) <= arr[i] <= 10**(6)" ] }, { "line": 70, "end_line": 70, "violates": [ "-10**(6) <= arr[i] <= 10**(6)" ] }, { "line": 112, "end_line": 112, "violates": [ "-10**(6) <= arr[i] <= 10**(6)" ] }, { "line": 124, "end_line": 124, "violates": [ "-10**(6) <= arr[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider that any valid arithmetic progression will be in sorted order.", "Sort the array, then check if the differences of all consecutive elements are equal." ] }, { "question_id": 1503, "task_id": "last-moment-before-all-ants-fall-out-of-a-plank", "drop": [], "similar": [ "count-collisions-on-a-road", "movement-of-robots" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "left", "right" ], "tests": { "total": 126, "kept": 120, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 49, "end_line": 49, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= n <= 10**(4)" ] } ], "unchecked_constraints": [ "All values of left and right are unique, and each value can appear only in one of the two arrays." ], "public_tests": 3, "hints": [ "The ants change their way when they meet is equivalent to continue moving without changing their direction.", "Answer is the max distance for one ant to reach the end of the plank in the facing direction." ] }, { "question_id": 1504, "task_id": "count-submatrices-with-all-ones", "drop": [], "similar": [ "count-submatrices-with-equal-frequency-of-x-and-y" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat" ], "tests": { "total": 90, "kept": 90, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= m, n <= 150" ], "public_tests": 2, "hints": [ "For each row i, create an array nums where: if mat[i][j] == 0 then nums[j] = 0 else nums[j] = nums[j-1] +1.", "In the row i, number of rectangles between column j and k(inclusive) and ends in row i, is equal to SUM(min(nums[j, .. idx])) where idx go from j to k. Expected solution is O(n^3)." ] }, { "question_id": 1505, "task_id": "minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "num", "k" ], "tests": { "total": 106, "kept": 104, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "We want to make the smaller digits the most significant digits in the number.", "For each index i, check the smallest digit in a window of size k and append it to the answer. Update the indices of all digits in this range accordingly." ] }, { "question_id": 1507, "task_id": "reformat-date", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "date" ], "tests": { "total": 111, "kept": 111, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The given dates are guaranteed to be valid, so no error handling is necessary." ], "public_tests": 3, "hints": [ "Handle the conversions of day, month and year separately.", "Notice that days always have a two-word ending, so if you erase the last two characters of this days you'll get the number." ] }, { "question_id": 1508, "task_id": "range-sum-of-sorted-subarray-sums", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "n", "left", "right" ], "tests": { "total": 105, "kept": 72, "dropped": { "constraint_violation": 33 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 100", "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= left <= right <= n * (n + 1) / 2", "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 100", "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 100", "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 100", "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= left <= right <= n * (n + 1) / 2", "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= left <= right <= n * (n + 1) / 2" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Compute all sums and save it in array.", "Then just go from LEFT to RIGHT index and calculate answer modulo 1e9 + 7." ] }, { "question_id": 1509, "task_id": "minimum-difference-between-largest-and-smallest-value-in-three-moves", "drop": [], "similar": [ "minimize-the-maximum-difference-of-pairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The minimum difference possible is obtained by removing three elements between the three smallest and three largest values in the array." ] }, { "question_id": 1510, "task_id": "stone-game-iv", "drop": [], "similar": [ "stone-game-v", "stone-game-vi", "stone-game-vii", "stone-game-viii", "stone-game-ix", "stone-removal-game" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 24, "kept": 24, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming to keep track of winning and losing states. Given some number of stones, Alice can win if she can force Bob onto a losing state." ], "similar_to_test": [ "3360 stone-removal-game" ] }, { "question_id": 1512, "task_id": "number-of-good-pairs", "drop": [], "similar": [ "number-of-pairs-of-interchangeable-rectangles", "substrings-that-begin-and-end-with-the-same-letter" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 102, "kept": 101, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 77, "end_line": 77, "violates": [ "1 <= nums.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Count how many times each number appears. If a number appears n times, then n * (n \u2013 1) // 2 good pairs can be made with this number." ] }, { "question_id": 1513, "task_id": "number-of-substrings-with-only-1s", "drop": [], "similar": [ "count-number-of-homogenous-substrings", "count-vowel-substrings-of-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 28, "kept": 28, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Count number of 1s in each consecutive-1 group. For a group with n consecutive 1s, the total contribution of it to the final answer is (n + 1) * n // 2." ] }, { "question_id": 1514, "task_id": "path-with-maximum-probability", "drop": [], "similar": [ "number-of-ways-to-arrive-at-destination" ], "flags": [ "decimal_answer", "has_images" ], "comparison": "float", "parameter_names": [ "n", "edges", "succProb", "start_node", "end_node" ], "tests": { "total": 69, "kept": 61, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "0 <= succProb.length == edges.length <= 2*10**4" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= succProb.length == edges.length <= 2*10**4" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= succProb.length == edges.length <= 2*10**4" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= succProb.length == edges.length <= 2*10**4" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= succProb.length == edges.length <= 2*10**4" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= succProb.length == edges.length <= 2*10**4" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= succProb.length == edges.length <= 2*10**4" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= succProb.length == edges.length <= 2*10**4" ] } ], "unchecked_constraints": [ "0 <= start, end < n", "start != end", "There is at most one edge between every two nodes." ], "public_tests": 3, "hints": [ "Multiplying probabilities will result in precision errors.", "Take log probabilities to sum up numbers instead of multiplying them.", "Use Dijkstra's algorithm to find the minimum path between the two nodes after negating all costs." ] }, { "question_id": 1515, "task_id": "best-position-for-a-service-centre", "drop": [], "similar": [], "flags": [ "decimal_answer", "has_images" ], "comparison": "float", "parameter_names": [ "positions" ], "tests": { "total": 104, "kept": 103, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 49, "end_line": 49, "violates": [ "0 <= xi, yi <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The problem can be reworded as, giving a set of points on a 2d-plane, return the geometric median.", "Loop over each triplet of points (positions[i], positions[j], positions[k]) where i < j < k, get the centre of the circle which goes throw the 3 points, check if all other points lie in this circle." ] }, { "question_id": 1518, "task_id": "water-bottles", "drop": [], "similar": [ "water-bottles-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "numBottles", "numExchange" ], "tests": { "total": 73, "kept": 73, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simulate the process until there are not enough empty bottles for even one full bottle of water." ] }, { "question_id": 1519, "task_id": "number-of-nodes-in-the-sub-tree-with-the-same-label", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "labels" ], "tests": { "total": 44, "kept": 29, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "labels.length == n" ] }, { "line": 15, "end_line": 15, "violates": [ "labels.length == n" ] }, { "line": 16, "end_line": 16, "violates": [ "labels.length == n" ] }, { "line": 18, "end_line": 18, "violates": [ "labels.length == n" ] }, { "line": 19, "end_line": 19, "violates": [ "labels.length == n" ] }, { "line": 21, "end_line": 21, "violates": [ "labels.length == n" ] }, { "line": 23, "end_line": 23, "violates": [ "labels.length == n" ] }, { "line": 25, "end_line": 25, "violates": [ "labels.length == n" ] }, { "line": 28, "end_line": 28, "violates": [ "labels.length == n" ] }, { "line": 29, "end_line": 29, "violates": [ "labels.length == n" ] }, { "line": 30, "end_line": 30, "violates": [ "labels.length == n" ] }, { "line": 33, "end_line": 33, "violates": [ "labels.length == n" ] }, { "line": 36, "end_line": 36, "violates": [ "labels.length == n" ] }, { "line": 37, "end_line": 37, "violates": [ "labels.length == n" ] }, { "line": 45, "end_line": 45, "violates": [ "labels.length == n" ] } ], "unchecked_constraints": [ "labels is consisting of only of lowercase English letters." ], "public_tests": 3, "hints": [ "Start traversing the tree and each node should return a vector to its parent node.", "The vector should be of length 26 and have the count of all the labels in the sub-tree of this node." ] }, { "question_id": 1520, "task_id": "maximum-number-of-non-overlapping-substrings", "drop": [], "similar": [ "maximum-number-of-non-overlapping-palindrome-substrings" ], "flags": [ "any_order", "multiple_answers" ], "comparison": "unordered", "parameter_names": [ "s" ], "tests": { "total": 59, "kept": 59, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Notice that it's impossible for any two valid substrings to overlap unless one is inside another.", "We can start by finding the starting and ending index for each character.", "From these indices, we can form the substrings by expanding each character's range if necessary (if another character exists in the range with smaller/larger starting/ending index).", "Sort the valid substrings by length and greedily take those with the smallest length, discarding the ones that overlap those we took." ] }, { "question_id": 1521, "task_id": "find-a-value-of-a-mysterious-function-closest-to-target", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "arr", "target" ], "tests": { "total": 119, "kept": 105, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "1 <= arr[i] <= 10**(6)", "0 <= target <= 10**(7)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= arr[i] <= 10**(6)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= arr[i] <= 10**(6)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= arr[i] <= 10**(6)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= arr[i] <= 10**(6)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= arr[i] <= 10**(6)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= arr[i] <= 10**(6)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= arr[i] <= 10**(6)", "0 <= target <= 10**(7)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= arr[i] <= 10**(6)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= arr[i] <= 10**(6)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= arr[i] <= 10**(6)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= arr[i] <= 10**(6)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= arr[i] <= 10**(6)", "0 <= target <= 10**(7)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= arr[i] <= 10**(6)", "0 <= target <= 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If the and value of sub-array arr[i...j] is \u2265 the and value of the sub-array arr[i...j+1].", "For each index i using binary search or ternary search find the index j where |target - AND(arr[i...j])| is minimum, minimize this value with the global answer." ] }, { "question_id": 1523, "task_id": "count-odd-numbers-in-an-interval-range", "drop": [], "similar": [ "check-if-bitwise-or-has-trailing-zeros" ], "flags": [], "comparison": "exact", "parameter_names": [ "low", "high" ], "tests": { "total": 93, "kept": 78, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 55, "end_line": 55, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 81, "end_line": 81, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= low <= high <= 10**9" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= low <= high <= 10**9" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If the range (high - low + 1) is even, the number of even and odd numbers in this range will be the same.", "If the range (high - low + 1) is odd, the solution will depend on the parity of high and low." ] }, { "question_id": 1524, "task_id": "number-of-sub-arrays-with-odd-sum", "drop": [], "similar": [ "subsequence-of-size-k-with-the-largest-even-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 87, "kept": 70, "dropped": { "constraint_violation": 17 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= arr[i] <= 100" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= arr[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we use the accumulative sum to keep track of all the odd-sum sub-arrays ?", "if the current accu sum is odd, we care only about previous even accu sums and vice versa." ] }, { "question_id": 1525, "task_id": "number-of-good-ways-to-split-a-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 81, "kept": 80, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 53, "end_line": 53, "violates": [ "s consists of only lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use two HashMap to store the counts of distinct letters in the left and right substring divided by the current index." ] }, { "question_id": 1526, "task_id": "minimum-number-of-increments-on-subarrays-to-form-a-target-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "target" ], "tests": { "total": 105, "kept": 100, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= target[i] <= 10**(5)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= target[i] <= 10**(5)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= target[i] <= 10**(5)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= target[i] <= 10**(5)", "1 <= target[i] <= 10**(5)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= target[i] <= 10**(5)", "1 <= target[i] <= 10**(5)" ] } ], "unchecked_constraints": [ "\u200b\u200b\u200b\u200b\u200b\u200b\u200bThe input is generated such that the answer fits inside a 32 bit integer." ], "public_tests": 3, "hints": [ "For a given range of values in target, an optimal strategy is to increment the entire range by the minimum value. The minimum in a range could be obtained with Range minimum query or Segment trees algorithm." ] }, { "question_id": 1528, "task_id": "shuffle-string", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "s", "indices" ], "tests": { "total": 61, "kept": 59, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 38, "end_line": 38, "violates": [ "s.length == indices.length == n" ] }, { "line": 45, "end_line": 45, "violates": [ "s.length == indices.length == n" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "You can create an auxiliary string t of length n.", "Assign t[indexes[i]] to s[i] for each i from 0 to n-1." ] }, { "question_id": 1529, "task_id": "minimum-suffix-flips", "drop": [], "similar": [ "minimum-operations-to-make-binary-array-elements-equal-to-one-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "target" ], "tests": { "total": 117, "kept": 117, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Consider a strategy where the choice of bulb with number i is increasing. In such a strategy, you no longer need to worry about bulbs that have been set to the left." ] }, { "question_id": 1530, "task_id": "number-of-good-leaf-nodes-pairs", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "distance" ], "tests": { "total": 66, "kept": 0, "dropped": { "unreadable": 66 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 2**(10)].", "1 <= Node.val <= 100" ] }, { "question_id": 1531, "task_id": "string-compression-ii", "drop": [], "similar": [ "string-compression-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 84, "kept": 83, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 71, "end_line": 71, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming.", "The state of the DP can be the current index and the remaining characters to delete.", "Having a prefix sum for each character can help you determine for a certain character c in some specific range, how many characters you need to delete to merge all occurrences of c in that range." ] }, { "question_id": 1534, "task_id": "count-good-triplets", "drop": [], "similar": [ "count-special-quadruplets", "number-of-unequal-triplets-in-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "a", "b", "c" ], "tests": { "total": 101, "kept": 100, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 61, "end_line": 61, "violates": [ "0 <= arr[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Notice that the constraints are small enough for a brute force solution to pass.", "Loop through all triplets, and count the ones that are good." ] }, { "question_id": 1535, "task_id": "find-the-winner-of-an-array-game", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "k" ], "tests": { "total": 105, "kept": 105, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "arr contains distinct integers." ], "public_tests": 2, "hints": [ "If k \u2265 arr.length return the max element of the array.", "If k < arr.length simulate the game until a number wins k consecutive games." ] }, { "question_id": 1536, "task_id": "minimum-swaps-to-arrange-a-binary-grid", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 71, "kept": 70, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "n == grid.length == grid[i].length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each row of the grid calculate the most right 1 in the grid in the array maxRight.", "To check if there exist answer, sort maxRight and check if maxRight[i] \u2264 i for all possible i's.", "If there exist an answer, simulate the swaps." ] }, { "question_id": 1537, "task_id": "get-the-maximum-score", "drop": [], "similar": [ "maximum-score-of-a-node-sequence" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 110, "kept": 104, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(7)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(7)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(7)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(7)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(7)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(7)" ] } ], "unchecked_constraints": [ "nums1 and nums2 are strictly increasing." ], "public_tests": 3, "hints": [ "Partition the array by common integers, and choose the path with larger sum with a DP technique." ] }, { "question_id": 1539, "task_id": "kth-missing-positive-number", "drop": [], "similar": [ "append-k-integers-with-minimal-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "k" ], "tests": { "total": 109, "kept": 108, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 66, "end_line": 66, "violates": [ "1 <= arr[i] <= 1000" ] } ], "unchecked_constraints": [ "arr[i] < arr[j] for 1 <= i < j <= arr.length" ], "public_tests": 2, "hints": [ "Keep track of how many positive numbers are missing as you scan the array." ] }, { "question_id": 1540, "task_id": "can-convert-string-in-k-moves", "drop": [], "similar": [ "minimum-cost-to-convert-string-i", "minimum-cost-to-convert-string-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t", "k" ], "tests": { "total": 119, "kept": 119, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Observe that shifting a letter x times has the same effect of shifting the letter x + 26 times.", "You need to check whether k is large enough to cover all shifts with the same remainder after modulo 26." ] }, { "question_id": 1541, "task_id": "minimum-insertions-to-balance-a-parentheses-string", "drop": [], "similar": [ "minimum-number-of-swaps-to-make-the-string-balanced" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 115, "kept": 115, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a stack to keep opening brackets. If you face single closing ')' add 1 to the answer and consider it as '))'.", "If you have '))' with empty stack, add 1 to the answer, If after finishing you have x opening remaining in the stack, add 2x to the answer." ] }, { "question_id": 1542, "task_id": "find-longest-awesome-substring", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 133, "kept": 133, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Given the character counts, under what conditions can a palindrome be formed ?", "From left to right, use bitwise xor-operation to compute for any prefix the number of times modulo 2 of each digit. (mask ^= (1<<(s[i]-'0')).", "Expected complexity is O(n*A) where A is the alphabet (10)." ] }, { "question_id": 1544, "task_id": "make-the-string-great", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 107, "kept": 97, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "1 <= s.length <= 100" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= s.length <= 100" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= s.length <= 100" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= s.length <= 100" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= s.length <= 100" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= s.length <= 100" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= s.length <= 100" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= s.length <= 100" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= s.length <= 100" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [ "s contains only lower and upper case English letters." ], "public_tests": 3, "hints": [ "The order you choose 2 characters to remove doesn't matter.", "Keep applying the mentioned step to s till the length of the string is not changed." ] }, { "question_id": 1545, "task_id": "find-kth-bit-in-nth-binary-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 85, "kept": 70, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= k <= 2**(n) - 1" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= k <= 2**(n) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Since n is small, we can simply simulate the process of constructing S1 to Sn." ] }, { "question_id": 1546, "task_id": "maximum-number-of-non-overlapping-subarrays-with-sum-equals-target", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 96, "kept": 91, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "0 <= target <= 10**(6)" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= target <= 10**(6)" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= target <= 10**(6)" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= target <= 10**(6)" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= target <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Keep track of prefix sums to quickly look up what subarray that sums \"target\" can be formed at each step of scanning the input array.", "It can be proved that greedily forming valid subarrays as soon as one is found is optimal." ] }, { "question_id": 1547, "task_id": "minimum-cost-to-cut-a-stick", "drop": [], "similar": [ "number-of-ways-to-divide-a-long-corridor", "divide-an-array-into-subarrays-with-minimum-cost-ii" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "cuts" ], "tests": { "total": 97, "kept": 90, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= cuts[i] <= n - 1" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= cuts[i] <= n - 1" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= cuts[i] <= n - 1" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= cuts[i] <= n - 1" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= cuts[i] <= n - 1" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= cuts.length <= min(n - 1, 100)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= cuts[i] <= n - 1" ] } ], "unchecked_constraints": [ "All the integers in cuts array are distinct." ], "public_tests": 2, "hints": [ "Build a dp array where dp[i][j] is the minimum cost to achieve all the cuts between i and j.", "When you try to get the minimum cost between i and j, try all possible cuts k between them, dp[i][j] = min(dp[i][k] + dp[k][j]) + (j - i) for all possible cuts k between them." ] }, { "question_id": 1548, "task_id": "the-most-similar-path-in-a-graph", "drop": [ "premium" ] }, { "question_id": 1550, "task_id": "three-consecutive-odds", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 131, "kept": 121, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 125, "end_line": 125, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 129, "end_line": 129, "violates": [ "1 <= arr[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Check every three consecutive numbers in the array for parity." ] }, { "question_id": 1551, "task_id": "minimum-operations-to-make-array-equal", "drop": [], "similar": [ "minimum-number-of-operations-to-make-arrays-similar", "minimum-operations-to-make-array-equal-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 53, "kept": 48, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= n <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Build the array arr using the given formula, define target = sum(arr) / n", "What is the number of operations needed to convert arr so that all elements equal target ?" ] }, { "question_id": 1552, "task_id": "magnetic-force-between-two-balls", "drop": [], "similar": [ "minimized-maximum-of-products-distributed-to-any-store" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "position", "m" ], "tests": { "total": 87, "kept": 84, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "1 <= position[i] <= 10**(9)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= position[i] <= 10**(9)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= position[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If you can place balls such that the answer is x then you can do it for y where y < x.", "Similarly if you cannot place balls such that the answer is x then you can do it for y where y > x.", "Binary search on the answer and greedily see if it is possible." ] }, { "question_id": 1553, "task_id": "minimum-number-of-days-to-eat-n-oranges", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 234, "kept": 232, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= n <= 2 * 10**(9)" ] }, { "line": 174, "end_line": 174, "violates": [ "1 <= n <= 2 * 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "In each step, choose between 2 options: minOranges = 1 + min( (n%2) + f(n/2), (n%3) + f(n/3) ) where f(n) is the minimum number of days to eat n oranges." ] }, { "question_id": 1554, "task_id": "strings-differ-by-one-character", "drop": [ "premium" ] }, { "question_id": 1556, "task_id": "thousand-separator", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 50, "kept": 31, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 13, "end_line": 13, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 15, "end_line": 15, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 16, "end_line": 16, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 17, "end_line": 17, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 18, "end_line": 18, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= n <= 2**(31) - 1" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= n <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Scan from the back of the integer and use dots to connect blocks with length 3 except the last block." ] }, { "question_id": 1557, "task_id": "minimum-number-of-vertices-to-reach-all-nodes", "drop": [], "similar": [], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "n", "edges" ], "tests": { "total": 77, "kept": 77, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All pairs (fromi, toi) are distinct." ], "public_tests": 2, "hints": [ "A node that does not have any incoming edge can only be reached by itself.", "Any other node with incoming edges can be reached from some other node.", "We only have to count the number of nodes with zero incoming edges." ] }, { "question_id": 1558, "task_id": "minimum-numbers-of-function-calls-to-make-target-array", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 98, "kept": 96, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "0 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Work backwards: try to go from nums to arr.", "You should try to divide by 2 as much as possible, but you can only divide by 2 if everything is even." ] }, { "question_id": 1559, "task_id": "detect-cycles-in-2d-grid", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 74, "kept": 74, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Keep track of the parent (previous position) to avoid considering an invalid path.", "Use DFS or BFS and keep track of visited cells to see if there is a cycle." ] }, { "question_id": 1560, "task_id": "most-visited-sector-in-a-circular-track", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "rounds" ], "tests": { "total": 98, "kept": 95, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= rounds[i] <= n" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= rounds[i] <= n" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= rounds[i] <= n" ] } ], "unchecked_constraints": [ "rounds[i] != rounds[i + 1] for 0 <= i < m" ], "public_tests": 3, "hints": [ "For each round increment the visits of the sectors visited during the marathon with 1.", "Determine the max number of visits, and return any sector visited the max number of visits." ] }, { "question_id": 1561, "task_id": "maximum-number-of-coins-you-can-get", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "piles" ], "tests": { "total": 99, "kept": 62, "dropped": { "constraint_violation": 37 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "piles.length % 3 == 0" ] }, { "line": 18, "end_line": 18, "violates": [ "piles.length % 3 == 0" ] }, { "line": 19, "end_line": 19, "violates": [ "piles.length % 3 == 0" ] }, { "line": 20, "end_line": 20, "violates": [ "piles.length % 3 == 0" ] }, { "line": 21, "end_line": 21, "violates": [ "piles.length % 3 == 0" ] }, { "line": 29, "end_line": 29, "violates": [ "piles.length % 3 == 0" ] }, { "line": 30, "end_line": 30, "violates": [ "piles.length % 3 == 0" ] }, { "line": 31, "end_line": 31, "violates": [ "piles.length % 3 == 0" ] }, { "line": 35, "end_line": 35, "violates": [ "piles.length % 3 == 0" ] }, { "line": 36, "end_line": 36, "violates": [ "piles.length % 3 == 0" ] }, { "line": 39, "end_line": 39, "violates": [ "piles.length % 3 == 0" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= piles[i] <= 10**(4)" ] }, { "line": 42, "end_line": 42, "violates": [ "piles.length % 3 == 0" ] }, { "line": 44, "end_line": 44, "violates": [ "piles.length % 3 == 0" ] }, { "line": 45, "end_line": 45, "violates": [ "piles.length % 3 == 0" ] }, { "line": 46, "end_line": 46, "violates": [ "piles.length % 3 == 0" ] }, { "line": 48, "end_line": 48, "violates": [ "piles.length % 3 == 0" ] }, { "line": 52, "end_line": 52, "violates": [ "piles.length % 3 == 0" ] }, { "line": 54, "end_line": 54, "violates": [ "piles.length % 3 == 0" ] }, { "line": 57, "end_line": 57, "violates": [ "piles.length % 3 == 0" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= piles[i] <= 10**(4)" ] }, { "line": 68, "end_line": 68, "violates": [ "piles.length % 3 == 0" ] }, { "line": 73, "end_line": 73, "violates": [ "piles.length % 3 == 0" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= piles[i] <= 10**(4)" ] }, { "line": 77, "end_line": 77, "violates": [ "piles.length % 3 == 0" ] }, { "line": 78, "end_line": 78, "violates": [ "piles.length % 3 == 0" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= piles[i] <= 10**(4)" ] }, { "line": 82, "end_line": 82, "violates": [ "piles.length % 3 == 0" ] }, { "line": 83, "end_line": 83, "violates": [ "piles.length % 3 == 0" ] }, { "line": 84, "end_line": 84, "violates": [ "piles.length % 3 == 0" ] }, { "line": 85, "end_line": 85, "violates": [ "piles.length % 3 == 0" ] }, { "line": 86, "end_line": 86, "violates": [ "piles.length % 3 == 0" ] }, { "line": 88, "end_line": 88, "violates": [ "piles.length % 3 == 0" ] }, { "line": 89, "end_line": 89, "violates": [ "piles.length % 3 == 0" ] }, { "line": 91, "end_line": 91, "violates": [ "piles.length % 3 == 0" ] }, { "line": 95, "end_line": 95, "violates": [ "piles.length % 3 == 0" ] }, { "line": 97, "end_line": 97, "violates": [ "piles.length % 3 == 0" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Which pile of coins will you never be able to pick up?", "Bob is forced to take the last pile of coins, no matter what it is. Which pile should you give to him?" ] }, { "question_id": 1562, "task_id": "find-latest-group-of-size-m", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "m" ], "tests": { "total": 106, "kept": 106, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Since the problem asks for the latest step, can you start the searching from the end of arr?", "Use a map to store the current \u201c1\u201d groups.", "At each step (going backwards) you need to split one group and update the map." ] }, { "question_id": 1563, "task_id": "stone-game-v", "drop": [], "similar": [ "stone-game", "stone-game-ii", "stone-game-iii", "stone-game-iv", "stone-game-vi", "stone-game-vii", "stone-game-viii", "stone-game-ix" ], "flags": [], "comparison": "exact", "parameter_names": [ "stoneValue" ], "tests": { "total": 93, "kept": 91, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= stoneValue[i] <= 10**(6)", "1 <= stoneValue[i] <= 10**(6)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= stoneValue[i] <= 10**(6)", "1 <= stoneValue[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "We need to try all possible divisions for the current row to get the max score.", "As calculating all possible divisions will lead us to calculate some sub-problems more than once, we need to think of dynamic programming." ] }, { "question_id": 1564, "task_id": "put-boxes-into-the-warehouse-i", "drop": [ "premium" ] }, { "question_id": 1566, "task_id": "detect-pattern-of-length-m-repeated-k-or-more-times", "drop": [], "similar": [ "maximum-repeating-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "m", "k" ], "tests": { "total": 128, "kept": 125, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "2 <= k <= 100" ] }, { "line": 11, "end_line": 11, "violates": [ "2 <= k <= 100" ] }, { "line": 116, "end_line": 116, "violates": [ "2 <= k <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a three-layer loop to check all possible patterns by iterating through all possible starting positions, all indexes less than m, and if the character at the index is repeated k times." ] }, { "question_id": 1567, "task_id": "maximum-length-of-subarray-with-positive-product", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 122, "kept": 122, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Split the whole array into subarrays by zeroes since a subarray with positive product cannot contain any zero.", "If the subarray has even number of negative numbers, the whole subarray has positive product.", "Otherwise, we have two choices, either - remove the prefix till the first negative element in this subarray, or remove the suffix starting from the last negative element in this subarray." ] }, { "question_id": 1568, "task_id": "minimum-number-of-days-to-disconnect-island", "drop": [], "similar": [ "disconnect-path-in-a-binary-matrix-by-at-most-one-flip", "minimum-runes-to-add-to-cast-spell" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 73, "kept": 73, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Return 0 if the grid is already disconnected.", "Return 1 if changing a single land to water disconnect the island.", "Otherwise return 2.", "We can disconnect the grid within at most 2 days." ], "similar_to_test": [ "3383 minimum-runes-to-add-to-cast-spell" ] }, { "question_id": 1569, "task_id": "number-of-ways-to-reorder-array-to-get-same-bst", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 74, "kept": 27, "dropped": { "constraint_violation": 47 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 4, "end_line": 4, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= nums[i] <= nums.length", "All integers in nums are distinct." ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= nums.length", "All integers in nums are distinct." ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= nums.length", "All integers in nums are distinct." ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= nums.length", "All integers in nums are distinct." ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= nums.length", "All integers in nums are distinct." ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= nums.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a divide and conquer strategy.", "The first number will always be the root. Consider the numbers smaller and larger than the root separately. When merging the results together, how many ways can you order x elements in x+y positions?" ] }, { "question_id": 1572, "task_id": "matrix-diagonal-sum", "drop": [], "similar": [ "check-if-every-row-and-column-contains-all-numbers", "check-if-matrix-is-x-matrix" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat" ], "tests": { "total": 54, "kept": 38, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= mat[i][j] <= 100", "1 <= mat[i][j] <= 100" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= mat[i][j] <= 100", "1 <= mat[i][j] <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= mat[i][j] <= 100" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= mat[i][j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "There will be overlap of elements in the primary and secondary diagonals if and only if the length of the matrix is odd, which is at the center." ] }, { "question_id": 1573, "task_id": "number-of-ways-to-split-a-string", "drop": [], "similar": [ "split-array-with-equal-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 84, "kept": 84, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "There is no way if the sum (number of '1's) is not divisible by the number of splits. So sum%3 should be 0.", "Preffix s1 , and suffix s3 should have sum/3 characters '1'.", "Follow up: Can you generalize the problem with numbers between [-10^9, 10^9] such the sum between subarrays s1, s2, s3 are the same?" ] }, { "question_id": 1574, "task_id": "shortest-subarray-to-be-removed-to-make-array-sorted", "drop": [], "similar": [ "count-the-number-of-incremovable-subarrays-ii", "count-the-number-of-incremovable-subarrays-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 189, "kept": 189, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The key is to find the longest non-decreasing subarray starting with the first element or ending with the last element, respectively.", "After removing some subarray, the result is the concatenation of a sorted prefix and a sorted suffix, where the last element of the prefix is smaller than the first element of the suffix." ] }, { "question_id": 1575, "task_id": "count-all-possible-routes", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "locations", "start", "finish", "fuel" ], "tests": { "total": 96, "kept": 60, "dropped": { "constraint_violation": 36 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= fuel <= 200" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= fuel <= 200" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= fuel <= 200" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= fuel <= 200" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= fuel <= 200" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= fuel <= 200" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= fuel <= 200" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= fuel <= 200" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= fuel <= 200" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= fuel <= 200" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= fuel <= 200" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= fuel <= 200" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= fuel <= 200" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= fuel <= 200" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= fuel <= 200" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= fuel <= 200" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= fuel <= 200" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= fuel <= 200" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= fuel <= 200" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= fuel <= 200" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= fuel <= 200" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= fuel <= 200" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= fuel <= 200" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= fuel <= 200" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= fuel <= 200" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= fuel <= 200" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= fuel <= 200" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= fuel <= 200" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= fuel <= 200" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= fuel <= 200" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= fuel <= 200" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= fuel <= 200" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= fuel <= 200" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= fuel <= 200" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= fuel <= 200" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= fuel <= 200" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming to solve this problem with each state defined by the city index and fuel left.", "Since the array contains distinct integers fuel will always be spent in each move and so there can be no cycles." ] }, { "question_id": 1576, "task_id": "replace-all-s-to-avoid-consecutive-repeating-characters", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 122, "kept": 119, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= s.length <= 100" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= s.length <= 100" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Processing string from left to right, whenever you get a \u2018?\u2019, check left character and right character, and select a character not equal to either of them", "Do take care to compare with replaced occurrence of \u2018?\u2019 when checking the left character." ] }, { "question_id": 1577, "task_id": "number-of-ways-where-square-of-number-is-equal-to-product-of-two-numbers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 121, "kept": 109, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)", "1 <= nums1[i], nums2[i] <= 10**(5)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)", "1 <= nums1[i], nums2[i] <= 10**(5)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Precalculate the frequencies of all nums1[i]^2 and nums2[i]^2" ] }, { "question_id": 1578, "task_id": "minimum-time-to-make-rope-colorful", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "colors", "neededTime" ], "tests": { "total": 91, "kept": 78, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "n == colors.length == neededTime.length" ] }, { "line": 31, "end_line": 31, "violates": [ "n == colors.length == neededTime.length" ] }, { "line": 42, "end_line": 42, "violates": [ "n == colors.length == neededTime.length" ] }, { "line": 43, "end_line": 43, "violates": [ "n == colors.length == neededTime.length" ] }, { "line": 53, "end_line": 53, "violates": [ "n == colors.length == neededTime.length" ] }, { "line": 55, "end_line": 55, "violates": [ "n == colors.length == neededTime.length" ] }, { "line": 61, "end_line": 61, "violates": [ "n == colors.length == neededTime.length" ] }, { "line": 63, "end_line": 63, "violates": [ "n == colors.length == neededTime.length" ] }, { "line": 65, "end_line": 65, "violates": [ "n == colors.length == neededTime.length" ] }, { "line": 66, "end_line": 66, "violates": [ "n == colors.length == neededTime.length" ] }, { "line": 74, "end_line": 74, "violates": [ "n == colors.length == neededTime.length" ] }, { "line": 80, "end_line": 80, "violates": [ "n == colors.length == neededTime.length" ] }, { "line": 81, "end_line": 81, "violates": [ "n == colors.length == neededTime.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Maintain the running sum and max value for repeated letters." ] }, { "question_id": 1579, "task_id": "remove-max-number-of-edges-to-keep-graph-fully-traversable", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 65, "kept": 57, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= ui < vi <= n" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= ui < vi <= n" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= ui < vi <= n" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= ui < vi <= n" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= ui < vi <= n" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= ui < vi <= n" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= ui < vi <= n" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= ui < vi <= n" ] } ], "unchecked_constraints": [ "All tuples (typei, ui, vi) are distinct." ], "public_tests": 3, "hints": [ "Build the network instead of removing extra edges.", "Suppose you have the final graph (after removing extra edges). Consider the subgraph with only the edges that Alice can traverse. What structure does this subgraph have? How many edges are there?", "Use disjoint set union data structure for both Alice and Bob.", "Always use Type 3 edges first, and connect the still isolated ones using other edges." ] }, { "question_id": 1580, "task_id": "put-boxes-into-the-warehouse-ii", "drop": [ "premium" ] }, { "question_id": 1582, "task_id": "special-positions-in-a-binary-matrix", "drop": [], "similar": [ "difference-between-ones-and-zeros-in-row-and-column" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat" ], "tests": { "total": 70, "kept": 70, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Keep track of 1s in each row and in each column. Then while iterating over matrix, if the current position is 1 and current row as well as current column contains exactly one occurrence of 1." ] }, { "question_id": 1583, "task_id": "count-unhappy-friends", "drop": [ "too_few_tests" ], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "preferences", "pairs" ], "tests": { "total": 37, "kept": 6, "dropped": { "constraint_violation": 31 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "preferences[i].length == n - 1", "All values in preferences[i] are unique." ] }, { "line": 4, "end_line": 4, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 5, "end_line": 5, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 8, "end_line": 8, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 9, "end_line": 9, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 10, "end_line": 10, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 11, "end_line": 11, "violates": [ "preferences[i].length == n - 1", "All values in preferences[i] are unique." ] }, { "line": 12, "end_line": 12, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 13, "end_line": 13, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 14, "end_line": 14, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 15, "end_line": 15, "violates": [ "preferences[i].length == n - 1", "All values in preferences[i] are unique." ] }, { "line": 16, "end_line": 16, "violates": [ "preferences[i].length == n - 1", "All values in preferences[i] are unique." ] }, { "line": 17, "end_line": 17, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 18, "end_line": 18, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 19, "end_line": 19, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 20, "end_line": 20, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 21, "end_line": 21, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 22, "end_line": 22, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 23, "end_line": 23, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 24, "end_line": 24, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 25, "end_line": 25, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 27, "end_line": 27, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 28, "end_line": 28, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 29, "end_line": 29, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 30, "end_line": 30, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 31, "end_line": 31, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 33, "end_line": 33, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 34, "end_line": 34, "violates": [ "preferences.length == n", "preferences[i].length == n - 1", "All values in preferences[i] are unique." ] }, { "line": 36, "end_line": 36, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 37, "end_line": 37, "violates": [ "preferences[i].length == n - 1" ] }, { "line": 38, "end_line": 38, "violates": [ "preferences[i].length == n - 1" ] } ], "unchecked_constraints": [ "preferences[i] does not contain i.", "Each person is contained in exactly one pair." ] }, { "question_id": 1584, "task_id": "min-cost-to-connect-all-points", "drop": [], "similar": [ "minimum-number-of-lines-to-cover-points" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "points" ], "tests": { "total": 104, "kept": 101, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "-10**(6) <= xi, yi <= 10**(6)" ] }, { "line": 68, "end_line": 68, "violates": [ "-10**(6) <= xi, yi <= 10**(6)" ] }, { "line": 93, "end_line": 93, "violates": [ "-10**(6) <= xi, yi <= 10**(6)" ] } ], "unchecked_constraints": [ "All pairs (xi, yi) are distinct." ], "public_tests": 2, "hints": [ "Connect each pair of points with a weighted edge, the weight being the manhattan distance between those points.", "The problem is now the cost of minimum spanning tree in graph with above edges." ] }, { "question_id": 1585, "task_id": "check-if-string-is-transformable-with-substring-sort-operations", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 147, "kept": 121, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "s.length == t.length" ] }, { "line": 28, "end_line": 28, "violates": [ "s.length == t.length" ] }, { "line": 31, "end_line": 31, "violates": [ "s.length == t.length" ] }, { "line": 32, "end_line": 32, "violates": [ "s.length == t.length" ] }, { "line": 36, "end_line": 36, "violates": [ "s.length == t.length" ] }, { "line": 43, "end_line": 43, "violates": [ "s.length == t.length" ] }, { "line": 47, "end_line": 47, "violates": [ "s.length == t.length" ] }, { "line": 53, "end_line": 53, "violates": [ "s.length == t.length" ] }, { "line": 59, "end_line": 59, "violates": [ "s.length == t.length" ] }, { "line": 73, "end_line": 73, "violates": [ "s.length == t.length" ] }, { "line": 74, "end_line": 74, "violates": [ "s.length == t.length" ] }, { "line": 77, "end_line": 77, "violates": [ "s.length == t.length" ] }, { "line": 78, "end_line": 78, "violates": [ "s.length == t.length" ] }, { "line": 87, "end_line": 87, "violates": [ "s.length == t.length" ] }, { "line": 98, "end_line": 98, "violates": [ "s.length == t.length" ] }, { "line": 99, "end_line": 99, "violates": [ "s.length == t.length" ] }, { "line": 106, "end_line": 106, "violates": [ "s.length == t.length" ] }, { "line": 113, "end_line": 113, "violates": [ "s.length == t.length" ] }, { "line": 114, "end_line": 114, "violates": [ "s.length == t.length" ] }, { "line": 122, "end_line": 122, "violates": [ "s.length == t.length" ] }, { "line": 125, "end_line": 125, "violates": [ "s.length == t.length" ] }, { "line": 132, "end_line": 132, "violates": [ "s.length == t.length" ] }, { "line": 133, "end_line": 133, "violates": [ "s.length == t.length" ] }, { "line": 139, "end_line": 139, "violates": [ "s.length == t.length" ] }, { "line": 144, "end_line": 144, "violates": [ "s.length == t.length" ] }, { "line": 147, "end_line": 147, "violates": [ "s.length == t.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Suppose the first digit you need is 'd'. How can you determine if it's possible to get that digit there?", "Consider swapping adjacent characters to maintain relative ordering." ] }, { "question_id": 1588, "task_id": "sum-of-all-odd-length-subarrays", "drop": [], "similar": [ "sum-of-squares-of-special-elements" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 104, "kept": 96, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= arr[i] <= 1000", "1 <= arr[i] <= 1000" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= arr[i] <= 1000", "1 <= arr[i] <= 1000" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= arr[i] <= 1000" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= arr[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "You can brute force \u2013 try every (i,j) pair, and if the length is odd, go through and add the sum to the answer." ] }, { "question_id": 1589, "task_id": "maximum-sum-obtained-of-any-permutation", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "requests" ], "tests": { "total": 96, "kept": 89, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "0 <= starti <= endi < n" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= starti <= endi < n" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= starti <= endi < n" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= starti <= endi < n" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= starti <= endi < n" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= starti <= endi < n" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= starti <= endi < n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Indexes with higher frequencies should be bound with larger values" ] }, { "question_id": 1590, "task_id": "make-sum-divisible-by-p", "drop": [], "similar": [ "subarray-sums-divisible-by-k", "find-the-divisibility-array-of-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "p" ], "tests": { "total": 76, "kept": 65, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= p <= 10**(9)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= p <= 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= p <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= p <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= p <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= p <= 10**(9)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= p <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use prefix sums to calculate the subarray sums.", "Suppose you know the remainder for the sum of the entire array. How does removing a subarray affect that remainder? What remainder does the subarray need to have in order to make the rest of the array sum up to be divisible by k?", "Use a map to keep track of the rightmost index for every prefix sum % p." ] }, { "question_id": 1591, "task_id": "strange-printer-ii", "drop": [], "similar": [ "strange-printer", "longest-cycle-in-a-graph", "sort-array-by-moving-items-to-empty-space" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "targetGrid" ], "tests": { "total": 65, "kept": 65, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try thinking in reverse. Given the grid, how can you tell if a colour was painted last?" ] }, { "question_id": 1592, "task_id": "rearrange-spaces-between-words", "drop": [], "similar": [ "text-justification" ], "flags": [], "comparison": "exact", "parameter_names": [ "text" ], "tests": { "total": 135, "kept": 132, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 87, "end_line": 87, "violates": [ "1 <= text.length <= 100" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= text.length <= 100" ] }, { "line": 134, "end_line": 134, "violates": [ "text consists of lowercase English letters and ' '." ] } ], "unchecked_constraints": [ "text contains at least one word." ], "public_tests": 2, "hints": [ "Count the total number of spaces and words. Then use the integer division to determine the numbers of spaces to add between each word and at the end." ] }, { "question_id": 1593, "task_id": "split-a-string-into-the-max-number-of-unique-substrings", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 102, "kept": 72, "dropped": { "constraint_violation": 30 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= s.length <= 16" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= s.length <= 16" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= s.length <= 16" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= s.length <= 16" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= s.length <= 16" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= s.length <= 16" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= s.length <= 16" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= s.length <= 16" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= s.length <= 16" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= s.length <= 16" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= s.length <= 16" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= s.length <= 16" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= s.length <= 16" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= s.length <= 16" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= s.length <= 16" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= s.length <= 16" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= s.length <= 16" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= s.length <= 16" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= s.length <= 16" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= s.length <= 16" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= s.length <= 16" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= s.length <= 16" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= s.length <= 16" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= s.length <= 16" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= s.length <= 16" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= s.length <= 16" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= s.length <= 16" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= s.length <= 16" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= s.length <= 16" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= s.length <= 16" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a set to keep track of which substrings have been used already", "Try each possible substring at every position and backtrack if a complete split is not possible" ] }, { "question_id": 1594, "task_id": "maximum-non-negative-product-in-a-matrix", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 111, "kept": 62, "dropped": { "constraint_violation": 49 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 8, "end_line": 8, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 9, "end_line": 9, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 12, "end_line": 12, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 21, "end_line": 21, "violates": [ "-4 <= grid[i][j] <= 4", "-4 <= grid[i][j] <= 4" ] }, { "line": 22, "end_line": 22, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 23, "end_line": 23, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 24, "end_line": 24, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 25, "end_line": 25, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 28, "end_line": 28, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 32, "end_line": 32, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 37, "end_line": 37, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 39, "end_line": 39, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 45, "end_line": 45, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 46, "end_line": 46, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 47, "end_line": 47, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 50, "end_line": 50, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 55, "end_line": 55, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 57, "end_line": 57, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 58, "end_line": 58, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 62, "end_line": 62, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 64, "end_line": 64, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 66, "end_line": 66, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 67, "end_line": 67, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 69, "end_line": 69, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 72, "end_line": 72, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 73, "end_line": 73, "violates": [ "-4 <= grid[i][j] <= 4", "-4 <= grid[i][j] <= 4" ] }, { "line": 74, "end_line": 74, "violates": [ "-4 <= grid[i][j] <= 4", "-4 <= grid[i][j] <= 4" ] }, { "line": 75, "end_line": 75, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 76, "end_line": 76, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 77, "end_line": 77, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 78, "end_line": 78, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 79, "end_line": 79, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 80, "end_line": 80, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 83, "end_line": 83, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 84, "end_line": 84, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 86, "end_line": 86, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 87, "end_line": 87, "violates": [ "-4 <= grid[i][j] <= 4", "-4 <= grid[i][j] <= 4" ] }, { "line": 88, "end_line": 88, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 92, "end_line": 92, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 93, "end_line": 93, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 97, "end_line": 97, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 99, "end_line": 99, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 101, "end_line": 101, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 103, "end_line": 103, "violates": [ "-4 <= grid[i][j] <= 4", "-4 <= grid[i][j] <= 4" ] }, { "line": 105, "end_line": 105, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 108, "end_line": 108, "violates": [ "-4 <= grid[i][j] <= 4", "-4 <= grid[i][j] <= 4" ] }, { "line": 109, "end_line": 109, "violates": [ "-4 <= grid[i][j] <= 4" ] }, { "line": 111, "end_line": 111, "violates": [ "-4 <= grid[i][j] <= 4" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use Dynamic programming. Keep the highest value and lowest value you can achieve up to a point." ] }, { "question_id": 1595, "task_id": "minimum-cost-to-connect-two-groups-of-points", "drop": [ "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "cost" ], "tests": { "total": 8, "kept": 6, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "size1 >= size2" ] }, { "line": 9, "end_line": 9, "violates": [ "size1 >= size2" ] } ], "unchecked_constraints": [] }, { "question_id": 1598, "task_id": "crawler-log-folder", "drop": [], "similar": [ "baseball-game", "backspace-string-compare" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "logs" ], "tests": { "total": 87, "kept": 82, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "2 <= logs[i].length <= 10" ] }, { "line": 32, "end_line": 32, "violates": [ "logs[i] contains lowercase English letters, digits, '.', and '/'." ] }, { "line": 68, "end_line": 68, "violates": [ "2 <= logs[i].length <= 10" ] }, { "line": 73, "end_line": 73, "violates": [ "2 <= logs[i].length <= 10" ] }, { "line": 78, "end_line": 78, "violates": [ "2 <= logs[i].length <= 10" ] } ], "unchecked_constraints": [ "logs[i] follows the format described in the statement.", "Folder names consist of lowercase English letters and digits." ], "public_tests": 3, "hints": [ "Simulate the process but don\u2019t move the pointer beyond the main folder." ] }, { "question_id": 1599, "task_id": "maximum-profit-of-operating-a-centennial-wheel", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "customers", "boardingCost", "runningCost" ], "tests": { "total": 55, "kept": 47, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "0 <= customers[i] <= 50" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= customers[i] <= 50" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= customers[i] <= 50" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= customers[i] <= 50" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= customers[i] <= 50" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= customers[i] <= 50" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= customers[i] <= 50" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= customers[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think simulation", "Note that the number of turns will never be more than 50 / 4 * n" ] }, { "question_id": 1601, "task_id": "maximum-number-of-achievable-transfer-requests", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "requests" ], "tests": { "total": 71, "kept": 53, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= requests.length <= 16" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= requests.length <= 16" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think brute force", "When is a subset of requests okay?" ] }, { "question_id": 1602, "task_id": "find-nearest-right-node-in-binary-tree", "drop": [ "premium" ] }, { "question_id": 1604, "task_id": "alert-using-same-key-card-three-or-more-times-in-a-one-hour-period", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "keyName", "keyTime" ], "tests": { "total": 109, "kept": 107, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 97, "end_line": 97, "violates": [ "keyName.length == keyTime.length" ] }, { "line": 100, "end_line": 100, "violates": [ "keyName.length == keyTime.length" ] } ], "unchecked_constraints": [ "keyTime[i] is in the format \"HH:MM\".", "[keyName[i], keyTime[i]] is unique." ], "public_tests": 2, "hints": [ "Group the times by the name of the card user, then sort each group" ] }, { "question_id": 1605, "task_id": "find-valid-matrix-given-row-and-column-sums", "drop": [], "similar": [ "reconstruct-a-2-row-binary-matrix" ], "flags": [], "comparison": "exact", "parameter_names": [ "rowSum", "colSum" ], "tests": { "total": 113, "kept": 40, "dropped": { "constraint_violation": 73 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 16, "end_line": 16, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 17, "end_line": 17, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 18, "end_line": 18, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 19, "end_line": 19, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 20, "end_line": 20, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 21, "end_line": 21, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 22, "end_line": 22, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 24, "end_line": 24, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 25, "end_line": 25, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 26, "end_line": 26, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 28, "end_line": 28, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 29, "end_line": 29, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 30, "end_line": 30, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 31, "end_line": 31, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 32, "end_line": 32, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 33, "end_line": 33, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 34, "end_line": 34, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 36, "end_line": 36, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 37, "end_line": 37, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 38, "end_line": 38, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 39, "end_line": 39, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 40, "end_line": 40, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 41, "end_line": 41, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 42, "end_line": 42, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 45, "end_line": 45, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 47, "end_line": 47, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 48, "end_line": 48, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 49, "end_line": 49, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 50, "end_line": 50, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 51, "end_line": 51, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 54, "end_line": 54, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 56, "end_line": 56, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 57, "end_line": 57, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 58, "end_line": 58, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 60, "end_line": 60, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 61, "end_line": 61, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 64, "end_line": 64, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 67, "end_line": 67, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 69, "end_line": 69, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 70, "end_line": 70, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 71, "end_line": 71, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 72, "end_line": 72, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 74, "end_line": 74, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 75, "end_line": 75, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 76, "end_line": 76, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 80, "end_line": 80, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 81, "end_line": 81, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 84, "end_line": 84, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 86, "end_line": 86, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 87, "end_line": 87, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 88, "end_line": 88, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 89, "end_line": 89, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 90, "end_line": 90, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 91, "end_line": 91, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 92, "end_line": 92, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 94, "end_line": 94, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 95, "end_line": 95, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 96, "end_line": 96, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 97, "end_line": 97, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 98, "end_line": 98, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 99, "end_line": 99, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 100, "end_line": 100, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 101, "end_line": 101, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 103, "end_line": 103, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 104, "end_line": 104, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 105, "end_line": 105, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 106, "end_line": 106, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 107, "end_line": 107, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 108, "end_line": 108, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 109, "end_line": 109, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 111, "end_line": 111, "violates": [ "sum(rowSum) == sum(colSum)" ] }, { "line": 113, "end_line": 113, "violates": [ "sum(rowSum) == sum(colSum)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Find the smallest rowSum or colSum, and let it be x. Place that number in the grid, and subtract x from rowSum and colSum. Continue until all the sums are satisfied." ] }, { "question_id": 1606, "task_id": "find-servers-that-handled-most-number-of-requests", "drop": [], "similar": [ "meeting-rooms-iii" ], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "k", "arrival", "load" ], "tests": { "total": 177, "kept": 170, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 40, "end_line": 40, "violates": [ "arrival.length == load.length" ] }, { "line": 47, "end_line": 47, "violates": [ "arrival.length == load.length" ] }, { "line": 50, "end_line": 50, "violates": [ "arrival.length == load.length" ] }, { "line": 66, "end_line": 66, "violates": [ "arrival.length == load.length" ] }, { "line": 69, "end_line": 69, "violates": [ "arrival.length == load.length" ] }, { "line": 71, "end_line": 71, "violates": [ "arrival.length == load.length" ] }, { "line": 86, "end_line": 86, "violates": [ "arrival.length == load.length" ] } ], "unchecked_constraints": [ "arrival is strictly increasing." ], "public_tests": 3, "hints": [ "To speed up the next available server search, keep track of the available servers in a sorted structure such as an ordered set.", "To determine if a server is available, keep track of the end times for each task in a heap and add the server to the available set once the soonest task ending time is less than or equal to the next task to add." ] }, { "question_id": 1608, "task_id": "special-array-with-x-elements-greater-than-or-equal-x", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 75, "kept": 72, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Count the number of elements greater than or equal to x for each x in the range [0, nums.length].", "If for any x, the condition satisfies, return that x. Otherwise, there is no answer." ] }, { "question_id": 1609, "task_id": "even-odd-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 135, "kept": 0, "dropped": { "unreadable": 135 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 105, "end_line": 105, "unreadable": true }, { "line": 106, "end_line": 106, "unreadable": true }, { "line": 107, "end_line": 107, "unreadable": true }, { "line": 108, "end_line": 108, "unreadable": true }, { "line": 109, "end_line": 109, "unreadable": true }, { "line": 110, "end_line": 110, "unreadable": true }, { "line": 111, "end_line": 111, "unreadable": true }, { "line": 112, "end_line": 112, "unreadable": true }, { "line": 113, "end_line": 113, "unreadable": true }, { "line": 114, "end_line": 114, "unreadable": true }, { "line": 115, "end_line": 115, "unreadable": true }, { "line": 116, "end_line": 116, "unreadable": true }, { "line": 117, "end_line": 117, "unreadable": true }, { "line": 118, "end_line": 118, "unreadable": true }, { "line": 119, "end_line": 119, "unreadable": true }, { "line": 120, "end_line": 120, "unreadable": true }, { "line": 121, "end_line": 121, "unreadable": true }, { "line": 122, "end_line": 122, "unreadable": true }, { "line": 123, "end_line": 123, "unreadable": true }, { "line": 124, "end_line": 124, "unreadable": true }, { "line": 125, "end_line": 125, "unreadable": true }, { "line": 126, "end_line": 126, "unreadable": true }, { "line": 127, "end_line": 127, "unreadable": true }, { "line": 128, "end_line": 128, "unreadable": true }, { "line": 129, "end_line": 129, "unreadable": true }, { "line": 130, "end_line": 130, "unreadable": true }, { "line": 131, "end_line": 131, "unreadable": true }, { "line": 132, "end_line": 132, "unreadable": true }, { "line": 133, "end_line": 133, "unreadable": true }, { "line": 134, "end_line": 134, "unreadable": true }, { "line": 135, "end_line": 135, "unreadable": true }, { "line": 136, "end_line": 136, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(5)].", "1 <= Node.val <= 10**(6)" ] }, { "question_id": 1610, "task_id": "maximum-number-of-visible-points", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "points", "angle", "location" ], "tests": { "total": 142, "kept": 136, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "0 <= angle < 360" ] }, { "line": 17, "end_line": 17, "violates": [ "0 <= angle < 360" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= angle < 360" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= angle < 360" ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= angle < 360" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= angle < 360" ] } ], "unchecked_constraints": [ "0 <= posx, posy, xi, yi <= 100" ], "public_tests": 3, "hints": [ "Sort the points by polar angle with the original position. Now only a consecutive collection of points would be visible from any coordinate.", "We can use two pointers to keep track of visible points for each start point", "For handling the cyclic condition, it\u2019d be helpful to append the point list to itself after sorting." ] }, { "question_id": 1611, "task_id": "minimum-one-bit-operations-to-make-integers-zero", "drop": [], "similar": [ "minimum-number-of-operations-to-make-array-continuous", "apply-bitwise-operations-to-make-strings-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 71, "kept": 68, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= n <= 10**(9)" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The fastest way to convert n to zero is to remove all set bits starting from the leftmost one. Try some simple examples to learn the rule of how many steps are needed to remove one set bit.", "consider n=2^k case first, then solve for all n." ] }, { "question_id": 1614, "task_id": "maximum-nesting-depth-of-the-parentheses", "drop": [], "similar": [ "maximum-nesting-depth-of-two-valid-parentheses-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 101, "kept": 42, "dropped": { "constraint_violation": 59 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 5, "end_line": 5, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= s.length <= 100" ] }, { "line": 17, "end_line": 17, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 18, "end_line": 18, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 20, "end_line": 20, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= s.length <= 100", "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 24, "end_line": 24, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 25, "end_line": 25, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 26, "end_line": 26, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 27, "end_line": 27, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 29, "end_line": 29, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 30, "end_line": 30, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 31, "end_line": 31, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 32, "end_line": 32, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 33, "end_line": 33, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 35, "end_line": 35, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 37, "end_line": 37, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 39, "end_line": 39, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 40, "end_line": 40, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 42, "end_line": 42, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 43, "end_line": 43, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 44, "end_line": 44, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 45, "end_line": 45, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 46, "end_line": 46, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 47, "end_line": 47, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 49, "end_line": 49, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 51, "end_line": 51, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= s.length <= 100", "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 53, "end_line": 53, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 54, "end_line": 54, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 57, "end_line": 57, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 59, "end_line": 59, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 63, "end_line": 63, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 64, "end_line": 64, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 66, "end_line": 66, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= s.length <= 100", "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 69, "end_line": 69, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 71, "end_line": 71, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 73, "end_line": 73, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= s.length <= 100" ] }, { "line": 78, "end_line": 78, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 79, "end_line": 79, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= s.length <= 100", "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= s.length <= 100", "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 84, "end_line": 84, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 85, "end_line": 85, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 86, "end_line": 86, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 89, "end_line": 89, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= s.length <= 100", "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 92, "end_line": 92, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 93, "end_line": 93, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= s.length <= 100", "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 95, "end_line": 95, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 96, "end_line": 96, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 97, "end_line": 97, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 100, "end_line": 100, "violates": [ "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= s.length <= 100", "s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'." ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [ "It is guaranteed that parentheses expression s is a VPS." ], "public_tests": 3, "hints": [ "The depth of any character in the VPS is the ( number of left brackets before it ) - ( number of right brackets before it )" ] }, { "question_id": 1615, "task_id": "maximal-network-rank", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "roads" ], "tests": { "total": 40, "kept": 39, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "0 <= ai, bi <= n-1" ] } ], "unchecked_constraints": [ "Each pair of cities has at most one road connecting them." ], "public_tests": 3, "hints": [ "Try every pair of different cities and calculate its network rank.", "The network rank of two vertices is almost the sum of their degrees.", "How can you efficiently check if there is a road connecting two different cities?" ] }, { "question_id": 1616, "task_id": "split-two-strings-to-make-palindrome", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "a", "b" ], "tests": { "total": 126, "kept": 86, "dropped": { "constraint_violation": 40 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "a.length == b.length" ] }, { "line": 20, "end_line": 20, "violates": [ "a.length == b.length" ] }, { "line": 21, "end_line": 21, "violates": [ "a.length == b.length" ] }, { "line": 27, "end_line": 27, "violates": [ "a.length == b.length" ] }, { "line": 29, "end_line": 29, "violates": [ "a.length == b.length" ] }, { "line": 30, "end_line": 30, "violates": [ "a.length == b.length" ] }, { "line": 34, "end_line": 34, "violates": [ "a.length == b.length" ] }, { "line": 40, "end_line": 40, "violates": [ "a.length == b.length" ] }, { "line": 41, "end_line": 41, "violates": [ "a.length == b.length" ] }, { "line": 42, "end_line": 42, "violates": [ "a.length == b.length" ] }, { "line": 46, "end_line": 46, "violates": [ "a.length == b.length" ] }, { "line": 47, "end_line": 47, "violates": [ "a.length == b.length" ] }, { "line": 52, "end_line": 52, "violates": [ "a.length == b.length" ] }, { "line": 53, "end_line": 53, "violates": [ "a.length == b.length" ] }, { "line": 54, "end_line": 54, "violates": [ "a.length == b.length" ] }, { "line": 55, "end_line": 55, "violates": [ "a.length == b.length" ] }, { "line": 60, "end_line": 60, "violates": [ "a.length == b.length" ] }, { "line": 62, "end_line": 62, "violates": [ "a.length == b.length" ] }, { "line": 65, "end_line": 65, "violates": [ "a.length == b.length" ] }, { "line": 66, "end_line": 66, "violates": [ "a.length == b.length" ] }, { "line": 75, "end_line": 75, "violates": [ "a.length == b.length" ] }, { "line": 78, "end_line": 78, "violates": [ "a.length == b.length" ] }, { "line": 81, "end_line": 81, "violates": [ "a.length == b.length" ] }, { "line": 84, "end_line": 84, "violates": [ "a.length == b.length" ] }, { "line": 85, "end_line": 85, "violates": [ "a.length == b.length" ] }, { "line": 88, "end_line": 88, "violates": [ "a.length == b.length" ] }, { "line": 91, "end_line": 91, "violates": [ "a.length == b.length" ] }, { "line": 96, "end_line": 96, "violates": [ "a.length == b.length" ] }, { "line": 97, "end_line": 97, "violates": [ "a.length == b.length" ] }, { "line": 101, "end_line": 101, "violates": [ "a.length == b.length" ] }, { "line": 102, "end_line": 102, "violates": [ "a.length == b.length" ] }, { "line": 103, "end_line": 103, "violates": [ "a.length == b.length" ] }, { "line": 111, "end_line": 111, "violates": [ "a.length == b.length" ] }, { "line": 112, "end_line": 112, "violates": [ "a.length == b.length" ] }, { "line": 115, "end_line": 115, "violates": [ "a.length == b.length" ] }, { "line": 118, "end_line": 118, "violates": [ "a.length == b.length" ] }, { "line": 121, "end_line": 121, "violates": [ "a.length == b.length" ] }, { "line": 123, "end_line": 123, "violates": [ "a.length == b.length" ] }, { "line": 124, "end_line": 124, "violates": [ "a.length == b.length" ] }, { "line": 125, "end_line": 125, "violates": [ "a.length == b.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try finding the largest prefix from a that matches a suffix in b", "Try string matching" ] }, { "question_id": 1617, "task_id": "count-subtrees-with-max-distance-between-cities", "drop": [], "similar": [ "tree-diameter" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 45, "kept": 45, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All pairs (ui, vi) are distinct." ], "public_tests": 3, "hints": [ "Iterate through every possible subtree by doing a bitmask on which vertices to include. How can you determine if a subtree is valid (all vertices are connected)?", "To determine connectivity, count the number of reachable vertices starting from any included vertex and only traveling on edges connecting 2 vertices in the subtree. The count should be the same as the number of 1s in the bitmask.", "The diameter is basically the maximum distance between any two nodes. Root the tree at a vertex. The answer is the max of the heights of the two largest subtrees or the longest diameter in any of the subtrees." ] }, { "question_id": 1619, "task_id": "mean-of-array-after-removing-some-elements", "drop": [], "similar": [], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "arr" ], "tests": { "total": 50, "kept": 19, "dropped": { "constraint_violation": 31 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 7, "end_line": 7, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 9, "end_line": 9, "violates": [ "arr.length is a multiple of 20.", "arr.length is a multiple of 20." ] }, { "line": 10, "end_line": 10, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 12, "end_line": 12, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 13, "end_line": 13, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 16, "end_line": 16, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 17, "end_line": 17, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 18, "end_line": 18, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 19, "end_line": 19, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 21, "end_line": 21, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 23, "end_line": 23, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 24, "end_line": 24, "violates": [ "arr.length is a multiple of 20.", "arr.length is a multiple of 20." ] }, { "line": 25, "end_line": 25, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 28, "end_line": 28, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 31, "end_line": 31, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 33, "end_line": 33, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 35, "end_line": 35, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 36, "end_line": 36, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 37, "end_line": 37, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 38, "end_line": 38, "violates": [ "arr.length is a multiple of 20.", "0 <= arr[i] <= 10**(5)" ] }, { "line": 39, "end_line": 39, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 41, "end_line": 41, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 42, "end_line": 42, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 43, "end_line": 43, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 45, "end_line": 45, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 46, "end_line": 46, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 47, "end_line": 47, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 48, "end_line": 48, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 49, "end_line": 49, "violates": [ "arr.length is a multiple of 20." ] }, { "line": 51, "end_line": 51, "violates": [ "arr.length is a multiple of 20." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the given array.", "Remove the first and last 5% of the sorted array." ] }, { "question_id": 1620, "task_id": "coordinate-with-maximum-network-quality", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "towers", "radius" ], "tests": { "total": 108, "kept": 87, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 20, "end_line": 20, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= radius <= 50" ] }, { "line": 103, "end_line": 103, "violates": [ "0 <= xi, yi, qi <= 50" ] }, { "line": 106, "end_line": 106, "violates": [ "0 <= xi, yi, qi <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The constraints are small enough to consider every possible coordinate and calculate its quality." ] }, { "question_id": 1621, "task_id": "number-of-sets-of-k-non-overlapping-line-segments", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 58, "kept": 58, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try to use dynamic programming where the current index and remaining number of line segments to form can describe any intermediate state.", "To make the computation of each state in constant time, we could add another flag to the state that indicates whether or not we are in the middle of placing a line (placed start point but no endpoint)." ] }, { "question_id": 1624, "task_id": "largest-substring-between-two-equal-characters", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 74, "kept": 73, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "1 <= s.length <= 300" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try saving the first and last position of each character", "Try finding every pair of indexes with equal characters" ] }, { "question_id": 1625, "task_id": "lexicographically-smallest-string-after-applying-operations", "drop": [], "similar": [ "lexicographically-smallest-string-after-substring-operation", "lexicographically-smallest-string-after-a-swap" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "a", "b" ], "tests": { "total": 109, "kept": 94, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= b <= s.length - 1" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= b <= s.length - 1" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= b <= s.length - 1" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= b <= s.length - 1" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= b <= s.length - 1" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= b <= s.length - 1" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= b <= s.length - 1" ] }, { "line": 56, "end_line": 56, "violates": [ "s.length is even." ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= b <= s.length - 1" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= b <= s.length - 1" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= b <= s.length - 1" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= b <= s.length - 1" ] }, { "line": 81, "end_line": 81, "violates": [ "s.length is even." ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= b <= s.length - 1" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= b <= s.length - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Since the length of s is even, the total number of possible sequences is at most 10 * 10 * s.length.", "You can generate all possible sequences and take their minimum.", "Keep track of already generated sequences so they are not processed again." ] }, { "question_id": 1626, "task_id": "best-team-with-no-conflicts", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "scores", "ages" ], "tests": { "total": 137, "kept": 135, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 47, "end_line": 47, "violates": [ "1 <= scores[i] <= 10**(6)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= scores[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "First, sort players by age and break ties by their score. You can now consider the players from left to right.", "If you choose to include a player, you must only choose players with at least that score later on." ] }, { "question_id": 1627, "task_id": "graph-connectivity-with-threshold", "drop": [], "similar": [ "greatest-common-divisor-traversal" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "threshold", "queries" ], "tests": { "total": 63, "kept": 63, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= ai, bi <= cities" ], "public_tests": 3, "hints": [ "How to build the graph of the cities?", "Connect city i with all its multiples 2*i, 3*i, ...", "Answer the queries using union-find data structure." ] }, { "question_id": 1629, "task_id": "slowest-key", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "releaseTimes", "keysPressed" ], "tests": { "total": 38, "kept": 27, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "keysPressed.length == n" ] }, { "line": 19, "end_line": 19, "violates": [ "keysPressed.length == n" ] }, { "line": 21, "end_line": 21, "violates": [ "keysPressed.length == n" ] }, { "line": 23, "end_line": 23, "violates": [ "keysPressed.length == n" ] }, { "line": 24, "end_line": 24, "violates": [ "keysPressed.length == n" ] }, { "line": 27, "end_line": 27, "violates": [ "keysPressed.length == n" ] }, { "line": 31, "end_line": 31, "violates": [ "keysPressed.length == n" ] }, { "line": 32, "end_line": 32, "violates": [ "keysPressed.length == n" ] }, { "line": 34, "end_line": 34, "violates": [ "keysPressed.length == n" ] }, { "line": 37, "end_line": 37, "violates": [ "keysPressed.length == n" ] }, { "line": 38, "end_line": 38, "violates": [ "keysPressed.length == n" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Get for each press its key and amount of time taken.", "Iterate on the presses, maintaining the answer so far.", "The current press will change the answer if and only if its amount of time taken is longer than that of the previous answer, or they are equal but the key is larger than that of the previous answer." ] }, { "question_id": 1630, "task_id": "arithmetic-subarrays", "drop": [], "similar": [ "arithmetic-slices", "can-make-arithmetic-progression-from-sequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "l", "r" ], "tests": { "total": 129, "kept": 126, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 78, "end_line": 78, "violates": [ "0 <= l[i] < r[i] < n" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= l[i] < r[i] < n" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= l[i] < r[i] < n" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "To check if a given sequence is arithmetic, just check that the difference between every two consecutive elements is the same.", "If and only if a set of numbers can make an arithmetic sequence, then its sorted version makes an arithmetic sequence. So to check a set of numbers, sort it, and check if that sequence is arithmetic.", "For each query, get the corresponding set of numbers which will be the sub-array represented by the query, sort it, and check if the result sequence is arithmetic." ] }, { "question_id": 1631, "task_id": "path-with-minimum-effort", "drop": [], "similar": [ "swim-in-rising-water", "path-with-maximum-minimum-value", "find-the-safest-path-in-a-grid" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "heights" ], "tests": { "total": 69, "kept": 68, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 47, "end_line": 47, "violates": [ "1 <= heights[i][j] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Consider the grid as a graph, where adjacent cells have an edge with cost of the difference between the cells.", "If you are given threshold k, check if it is possible to go from (0, 0) to (n-1, m-1) using only edges of \u2264 k cost.", "Binary search the k value." ] }, { "question_id": 1632, "task_id": "rank-transform-of-a-matrix", "drop": [], "similar": [ "rank-transform-of-an-array", "gcd-sort-of-an-array" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the cells by value and process them in increasing order.", "The rank of a cell is the maximum rank in its row and column plus one.", "Handle the equal cells by treating them as components using a union-find data structure." ] }, { "question_id": 1636, "task_id": "sort-array-by-increasing-frequency", "drop": [], "similar": [ "sort-characters-by-frequency", "divide-array-into-equal-pairs", "most-frequent-number-following-key-in-an-array", "maximum-number-of-pairs-in-array", "node-with-highest-edge-score", "sort-the-people" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 117, "kept": 114, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 53, "end_line": 53, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= nums.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Count the frequency of each value.", "Use a custom comparator to compare values by their frequency. If two values have the same frequency, compare their values." ] }, { "question_id": 1637, "task_id": "widest-vertical-area-between-two-points-containing-no-points", "drop": [], "similar": [ "maximum-gap", "maximum-consecutive-floors-without-special-floors" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "points" ], "tests": { "total": 104, "kept": 101, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "0 <= xi, yi <= 10**(9)" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= xi, yi <= 10**(9)" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= xi, yi <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try sorting the points", "Think whether the y-axis of a point is relevant" ] }, { "question_id": 1638, "task_id": "count-substrings-that-differ-by-one-character", "drop": [], "similar": [ "count-words-obtained-after-adding-a-letter" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 156, "kept": 155, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 123, "end_line": 123, "violates": [ "s and t consist of lowercase English letters only." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Take every substring of s, change a character, and see how many substrings of t match that substring.", "Use a Trie to store all substrings of t as a dictionary." ] }, { "question_id": 1639, "task_id": "number-of-ways-to-form-a-target-string-given-a-dictionary", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "words", "target" ], "tests": { "total": 148, "kept": 148, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All strings in words have the same length." ], "public_tests": 2, "hints": [ "For each index i, store the frequency of each character in the ith row.", "Use dynamic programing to calculate the number of ways to get the target string using the frequency array." ] }, { "question_id": 1640, "task_id": "check-array-formation-through-concatenation", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "pieces" ], "tests": { "total": 99, "kept": 88, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= arr[i], pieces[i][j] <= 100" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= arr[i], pieces[i][j] <= 100" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= arr[i], pieces[i][j] <= 100" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= arr[i], pieces[i][j] <= 100" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= arr[i], pieces[i][j] <= 100" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= arr[i], pieces[i][j] <= 100" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= arr[i], pieces[i][j] <= 100" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= arr[i], pieces[i][j] <= 100" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= arr[i], pieces[i][j] <= 100" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= arr[i], pieces[i][j] <= 100" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= arr[i], pieces[i][j] <= 100" ] } ], "unchecked_constraints": [ "The integers in arr are distinct.", "The integers in pieces are distinct (i.e., If we flatten pieces in a 1D array, all the integers in this array are distinct).", "sum(pieces[i].length) == arr.length" ], "public_tests": 3, "hints": [ "Note that the distinct part means that every position in the array belongs to only one piece", "Note that you can get the piece every position belongs to naively" ] }, { "question_id": 1641, "task_id": "count-sorted-vowel-strings", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 24, "kept": 24, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each character, its possible values will depend on the value of its previous character, because it needs to be not smaller than it.", "Think backtracking. Build a recursive function count(n, last_character) that counts the number of valid strings of length n and whose first characters are not less than last_character.", "In this recursive function, iterate on the possible characters for the first character, which will be all the vowels not less than last_character, and for each possible value c, increase the answer by count(n-1, c)." ] }, { "question_id": 1642, "task_id": "furthest-building-you-can-reach", "drop": [], "similar": [ "make-the-prefix-sum-non-negative", "find-building-where-alice-and-bob-can-meet" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "heights", "bricks", "ladders" ], "tests": { "total": 118, "kept": 116, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= heights[i] <= 10**(6)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= heights[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Assume the problem is to check whether you can reach the last building or not.", "You'll have to do a set of jumps, and choose for each one whether to do it using a ladder or bricks. It's always optimal to use ladders in the largest jumps.", "Iterate on the buildings, maintaining the largest r jumps and the sum of the remaining ones so far, and stop whenever this sum exceeds b." ] }, { "question_id": 1643, "task_id": "kth-smallest-instructions", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "destination", "k" ], "tests": { "total": 93, "kept": 93, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= row, column <= 15", "1 <= k <= nCr(row + column, row), where nCr(a, b) denotes a choose b\u200b\u200b\u200b\u200b\u200b." ], "public_tests": 3, "hints": [ "There are nCr(row + column, row) possible instructions to reach (row, column).", "Try building the instructions one step at a time. How many instructions start with \"H\", and how does this compare with k?" ] }, { "question_id": 1644, "task_id": "lowest-common-ancestor-of-a-binary-tree-ii", "drop": [ "premium" ] }, { "question_id": 1646, "task_id": "get-maximum-in-generated-array", "drop": [], "similar": [ "largest-element-in-an-array-after-merge-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 31, "kept": 31, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try generating the array.", "Make sure not to fall in the base case of 0." ] }, { "question_id": 1647, "task_id": "minimum-deletions-to-make-character-frequencies-unique", "drop": [], "similar": [ "minimum-deletions-to-make-array-beautiful", "removing-minimum-and-maximum-from-array", "remove-letter-to-equalize-frequency", "minimum-deletions-to-make-string-k-special" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 23, "kept": 23, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "As we can only delete characters, if we have multiple characters having the same frequency, we must decrease all the frequencies of them, except one.", "Sort the alphabet characters by their frequencies non-increasingly.", "Iterate on the alphabet characters, keep decreasing the frequency of the current character until it reaches a value that has not appeared before." ] }, { "question_id": 1648, "task_id": "sell-diminishing-valued-colored-balls", "drop": [], "similar": [ "maximum-running-time-of-n-computers" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "inventory", "orders" ], "tests": { "total": 88, "kept": 83, "dropped": { "int_overflow": 4, "constraint_violation": 1 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 49, "end_line": 49, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= inventory[i] <= 10**(9)" ] }, { "line": 80, "end_line": 80, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 87, "end_line": 87, "unrepresentable_in": [ "cpp", "rust", "java" ] } ], "unchecked_constraints": [ "1 <= orders <= min(sum(inventory[i]), 10**(9))" ], "public_tests": 2, "hints": [ "Greedily sell the most expensive ball.", "There is some value k where all balls of value > k are sold, and some, (maybe 0) of balls of value k are sold.", "Use binary search to find this value k, and use maths to find the total sum." ] }, { "question_id": 1649, "task_id": "create-sorted-array-through-instructions", "drop": [], "similar": [ "count-good-triplets-in-an-array", "longest-substring-of-one-repeating-character", "sort-array-by-moving-items-to-empty-space" ], "flags": [], "comparison": "exact", "parameter_names": [ "instructions" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "This problem is closely related to finding the number of inversions in an array", "if i know the position in which i will insert the i-th element in I can find the minimum cost to insert it" ] }, { "question_id": 1652, "task_id": "defuse-the-bomb", "drop": [], "similar": [ "circular-sentence", "shortest-distance-to-target-string-in-a-circular-array", "take-k-of-each-character-from-left-and-right" ], "flags": [], "comparison": "exact", "parameter_names": [ "code", "k" ], "tests": { "total": 119, "kept": 100, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "-(n - 1) <= k <= n - 1" ] }, { "line": 5, "end_line": 5, "violates": [ "-(n - 1) <= k <= n - 1" ] }, { "line": 8, "end_line": 8, "violates": [ "-(n - 1) <= k <= n - 1" ] }, { "line": 9, "end_line": 9, "violates": [ "-(n - 1) <= k <= n - 1" ] }, { "line": 31, "end_line": 31, "violates": [ "-(n - 1) <= k <= n - 1" ] }, { "line": 35, "end_line": 35, "violates": [ "-(n - 1) <= k <= n - 1" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= code[i] <= 100" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= code[i] <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= code[i] <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= code[i] <= 100" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= code[i] <= 100" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= code[i] <= 100" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= code[i] <= 100" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= code[i] <= 100" ] }, { "line": 80, "end_line": 80, "violates": [ "-(n - 1) <= k <= n - 1" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= code[i] <= 100" ] }, { "line": 96, "end_line": 96, "violates": [ "-(n - 1) <= k <= n - 1" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= code[i] <= 100" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= code[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "As the array is circular, use modulo to find the correct index.", "The constraints are low enough for a brute-force solution." ] }, { "question_id": 1653, "task_id": "minimum-deletions-to-make-string-balanced", "drop": [], "similar": [ "check-if-all-as-appears-before-all-bs" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 190, "kept": 190, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s[i] is 'a' or 'b'\u200b\u200b." ], "public_tests": 2, "hints": [ "You need to find for every index the number of Bs before it and the number of A's after it", "You can speed up the finding of A's and B's in suffix and prefix using preprocessing" ] }, { "question_id": 1654, "task_id": "minimum-jumps-to-reach-home", "drop": [], "similar": [ "reachable-nodes-with-restrictions", "maximum-number-of-jumps-to-reach-the-last-index" ], "flags": [], "comparison": "exact", "parameter_names": [ "forbidden", "a", "b", "x" ], "tests": { "total": 98, "kept": 88, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= forbidden.length <= 1000" ] }, { "line": 14, "end_line": 14, "violates": [ "0 <= x <= 2000" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= a, b, forbidden[i] <= 2000" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= x <= 2000" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= a, b, forbidden[i] <= 2000", "0 <= x <= 2000" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= x <= 2000" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= x <= 2000" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= a, b, forbidden[i] <= 2000", "0 <= x <= 2000" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= forbidden.length <= 1000" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= x <= 2000" ] } ], "unchecked_constraints": [ "Position x is not forbidden." ], "public_tests": 3, "hints": [ "Think of the line as a graph", "to handle the no double back jumps condition you can handle it by holding the state of your previous jump" ] }, { "question_id": 1655, "task_id": "distribute-repeating-integers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "quantity" ], "tests": { "total": 62, "kept": 62, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There are at most 50 unique values in nums." ], "public_tests": 3, "hints": [ "Count the frequencies of each number. For example, if nums = [4,4,5,5,5], frequencies = [2,3].", "Each customer wants all of their numbers to be the same. This means that each customer will be assigned to one number.", "Use dynamic programming. Iterate through the numbers' frequencies, and choose some subset of customers to be assigned to this number." ] }, { "question_id": 1657, "task_id": "determine-if-two-strings-are-close", "drop": [], "similar": [ "buddy-strings", "minimum-swaps-to-make-strings-equal", "minimum-number-of-steps-to-make-two-strings-anagram" ], "flags": [], "comparison": "exact", "parameter_names": [ "word1", "word2" ], "tests": { "total": 106, "kept": 106, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Operation 1 allows you to freely reorder the string.", "Operation 2 allows you to freely reassign the letters' frequencies." ] }, { "question_id": 1658, "task_id": "minimum-operations-to-reduce-x-to-zero", "drop": [], "similar": [ "minimum-size-subarray-sum", "subarray-sum-equals-k", "minimum-operations-to-convert-number", "removing-minimum-number-of-magic-beans", "minimum-operations-to-make-the-integer-zero" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "x" ], "tests": { "total": 107, "kept": 103, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= nums[i] <= 10**(4)", "1 <= x <= 10**(9)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 10**(4)", "1 <= nums[i] <= 10**(4)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 10**(4)", "1 <= nums[i] <= 10**(4)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= x <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think in reverse; instead of finding the minimum prefix + suffix, find the maximum subarray.", "Finding the maximum subarray is standard and can be done greedily." ] }, { "question_id": 1659, "task_id": "maximize-grid-happiness", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n", "introvertsCount", "extrovertsCount" ], "tests": { "total": 102, "kept": 101, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "0 <= introvertsCount, extrovertsCount <= min(m * n, 6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each cell, it has 3 options, either it is empty, or contains an introvert, or an extrovert.", "You can do DP where you maintain the state of the previous row, the number of remaining introverts and extroverts, the current row and column, and try the 3 options for each cell.", "Assume that the previous columns in the current row already belong to the previous row." ] }, { "question_id": 1662, "task_id": "check-if-two-string-arrays-are-equivalent", "drop": [], "similar": [ "check-if-an-original-string-exists-given-two-encoded-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "word1", "word2" ], "tests": { "total": 105, "kept": 101, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "word1[i] and word2[i] consist of lowercase letters." ] }, { "line": 27, "end_line": 27, "violates": [ "word1[i] and word2[i] consist of lowercase letters." ] }, { "line": 71, "end_line": 71, "violates": [ "word1[i] and word2[i] consist of lowercase letters." ] }, { "line": 73, "end_line": 73, "violates": [ "word1[i] and word2[i] consist of lowercase letters." ] } ], "unchecked_constraints": [ "1 <= sum(word1[i].length), sum(word2[i].length) <= 10**(3)" ], "public_tests": 3, "hints": [ "Concatenate all strings in the first array into a single string in the given order, the same for the second array.", "Both arrays represent the same string if and only if the generated strings are the same." ] }, { "question_id": 1663, "task_id": "smallest-string-with-a-given-numeric-value", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 65, "kept": 61, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "n <= k <= 26 * n" ] }, { "line": 25, "end_line": 25, "violates": [ "n <= k <= 26 * n" ] }, { "line": 28, "end_line": 28, "violates": [ "n <= k <= 26 * n" ] }, { "line": 37, "end_line": 37, "violates": [ "n <= k <= 26 * n" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Think greedily.", "If you build the string from the end to the beginning, it will always be optimal to put the highest possible character at the current index." ] }, { "question_id": 1664, "task_id": "ways-to-make-a-fair-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 100, "kept": 98, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The parity of the indices after the removed element changes.", "Calculate prefix sums for even and odd indices separately to calculate for each index in O(1)." ] }, { "question_id": 1665, "task_id": "minimum-initial-energy-to-finish-tasks", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "tasks" ], "tests": { "total": 104, "kept": 104, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= actual\u200bi <= minimumi <= 10**(4)" ], "public_tests": 3, "hints": [ "We can easily figure that the f(x) : does x solve this array is monotonic so binary Search is doable", "Figure a sorting pattern" ] }, { "question_id": 1668, "task_id": "maximum-repeating-substring", "drop": [], "similar": [ "detect-pattern-of-length-m-repeated-k-or-more-times", "minimum-number-of-operations-to-make-word-k-periodic" ], "flags": [], "comparison": "exact", "parameter_names": [ "sequence", "word" ], "tests": { "total": 154, "kept": 154, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The constraints are low enough for a brute force approach.", "Try every k value from 0 upwards until word is no longer k-repeating." ] }, { "question_id": 1669, "task_id": "merge-in-between-linked-lists", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "list1", "a", "b", "list2" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 1671, "task_id": "minimum-number-of-removals-to-make-mountain-array", "drop": [], "similar": [ "longest-increasing-subsequence", "longest-mountain-in-array", "peak-index-in-a-mountain-array", "valid-mountain-array", "find-in-mountain-array", "beautiful-towers-ii", "beautiful-towers-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 107, "kept": 96, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [ "It is guaranteed that you can make a mountain array out of nums." ], "public_tests": 2, "hints": [ "Think the opposite direction instead of minimum elements to remove the maximum mountain subsequence", "Think of LIS it's kind of close" ] }, { "question_id": 1672, "task_id": "richest-customer-wealth", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "accounts" ], "tests": { "total": 85, "kept": 49, "dropped": { "constraint_violation": 36 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= accounts[i][j] <= 100" ] }, { "line": 4, "end_line": 4, "violates": [ "n == accounts[i].length" ] }, { "line": 6, "end_line": 6, "violates": [ "n == accounts[i].length" ] }, { "line": 9, "end_line": 9, "violates": [ "n == accounts[i].length" ] }, { "line": 12, "end_line": 12, "violates": [ "n == accounts[i].length" ] }, { "line": 18, "end_line": 18, "violates": [ "n == accounts[i].length" ] }, { "line": 21, "end_line": 21, "violates": [ "n == accounts[i].length" ] }, { "line": 24, "end_line": 24, "violates": [ "n == accounts[i].length", "1 <= accounts[i][j] <= 100" ] }, { "line": 25, "end_line": 25, "violates": [ "n == accounts[i].length" ] }, { "line": 27, "end_line": 27, "violates": [ "n == accounts[i].length" ] }, { "line": 30, "end_line": 30, "violates": [ "n == accounts[i].length" ] }, { "line": 31, "end_line": 31, "violates": [ "n == accounts[i].length" ] }, { "line": 35, "end_line": 35, "violates": [ "n == accounts[i].length" ] }, { "line": 36, "end_line": 36, "violates": [ "n == accounts[i].length" ] }, { "line": 37, "end_line": 37, "violates": [ "n == accounts[i].length" ] }, { "line": 38, "end_line": 38, "violates": [ "n == accounts[i].length" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= accounts[i][j] <= 100" ] }, { "line": 42, "end_line": 42, "violates": [ "n == accounts[i].length" ] }, { "line": 44, "end_line": 44, "violates": [ "n == accounts[i].length" ] }, { "line": 46, "end_line": 46, "violates": [ "n == accounts[i].length", "1 <= accounts[i][j] <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "n == accounts[i].length" ] }, { "line": 50, "end_line": 50, "violates": [ "n == accounts[i].length" ] }, { "line": 52, "end_line": 52, "violates": [ "n == accounts[i].length", "1 <= accounts[i][j] <= 100" ] }, { "line": 56, "end_line": 56, "violates": [ "n == accounts[i].length", "1 <= accounts[i][j] <= 100" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= accounts[i][j] <= 100" ] }, { "line": 59, "end_line": 59, "violates": [ "n == accounts[i].length" ] }, { "line": 60, "end_line": 60, "violates": [ "n == accounts[i].length" ] }, { "line": 63, "end_line": 63, "violates": [ "n == accounts[i].length" ] }, { "line": 69, "end_line": 69, "violates": [ "n == accounts[i].length" ] }, { "line": 72, "end_line": 72, "violates": [ "n == accounts[i].length" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= accounts[i][j] <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "n == accounts[i].length" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= accounts[i][j] <= 100" ] }, { "line": 77, "end_line": 77, "violates": [ "n == accounts[i].length" ] }, { "line": 85, "end_line": 85, "violates": [ "n == accounts[i].length", "1 <= accounts[i][j] <= 100" ] }, { "line": 86, "end_line": 86, "violates": [ "n == accounts[i].length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Calculate the wealth of each customer", "Find the maximum element in array." ] }, { "question_id": 1673, "task_id": "find-the-most-competitive-subsequence", "drop": [], "similar": [ "remove-k-digits", "smallest-subsequence-of-distinct-characters" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 106, "kept": 106, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "In lexicographical order, the elements to the left have higher priority than those that come after. Can you think of a strategy that incrementally builds the answer from left to right?" ] }, { "question_id": 1674, "task_id": "minimum-moves-to-make-array-complementary", "drop": [], "similar": [ "zero-array-transformation-ii", "zero-array-transformation-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "limit" ], "tests": { "total": 112, "kept": 111, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 77, "end_line": 77, "violates": [ "n is even." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Given a target sum x, each pair of nums[i] and nums[n-1-i] would either need 0, 1, or 2 modifications.", "Can you find the optimal target sum x value such that the sum of modifications is minimized?", "Create a difference array to efficiently sum all the modifications." ], "similar_to_test": [ "3356 zero-array-transformation-ii", "3362 zero-array-transformation-iii" ] }, { "question_id": 1675, "task_id": "minimize-deviation-in-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 105, "kept": 99, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Assume you start with the minimum possible value for each number so you can only multiply a number by 2 till it reaches its maximum possible value.", "If there is a better solution than the current one, then it must have either its maximum value less than the current maximum value, or the minimum value larger than the current minimum value.", "Since that we only increase numbers (multiply them by 2), we cannot decrease the current maximum value, so we must multiply the current minimum number by 2." ] }, { "question_id": 1678, "task_id": "goal-parser-interpretation", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "command" ], "tests": { "total": 95, "kept": 95, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "You need to check at most 2 characters to determine which character comes next." ] }, { "question_id": 1679, "task_id": "max-number-of-k-sum-pairs", "drop": [], "similar": [ "two-sum", "count-good-meals", "divide-players-into-teams-of-equal-skill" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 68, "kept": 59, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The abstract problem asks to count the number of disjoint pairs with a given sum k.", "For each possible value x, it can be paired up with k - x.", "The number of such pairs equals to min(count(x), count(k-x)), unless that x = k / 2, where the number of such pairs will be floor(count(x) / 2)." ] }, { "question_id": 1680, "task_id": "concatenation-of-consecutive-binary-numbers", "drop": [], "similar": [ "maximum-possible-number-by-binary-concatenation" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 28, "kept": 28, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Express the nth number value in a recursion formula and think about how we can do a fast evaluation." ], "similar_to_test": [ "3309 maximum-possible-number-by-binary-concatenation" ] }, { "question_id": 1681, "task_id": "minimum-incompatibility", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 91, "kept": 63, "dropped": { "constraint_violation": 28 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 19, "end_line": 19, "violates": [ "nums.length is divisible by k" ] }, { "line": 20, "end_line": 20, "violates": [ "nums.length is divisible by k" ] }, { "line": 21, "end_line": 21, "violates": [ "nums.length is divisible by k" ] }, { "line": 23, "end_line": 23, "violates": [ "nums.length is divisible by k" ] }, { "line": 24, "end_line": 24, "violates": [ "nums.length is divisible by k" ] }, { "line": 27, "end_line": 27, "violates": [ "nums.length is divisible by k" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 33, "end_line": 33, "violates": [ "nums.length is divisible by k" ] }, { "line": 36, "end_line": 36, "violates": [ "nums.length is divisible by k" ] }, { "line": 39, "end_line": 39, "violates": [ "nums.length is divisible by k" ] }, { "line": 40, "end_line": 40, "violates": [ "nums.length is divisible by k" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 47, "end_line": 47, "violates": [ "nums.length is divisible by k" ] }, { "line": 53, "end_line": 53, "violates": [ "nums.length is divisible by k" ] }, { "line": 54, "end_line": 54, "violates": [ "nums.length is divisible by k" ] }, { "line": 58, "end_line": 58, "violates": [ "nums.length is divisible by k" ] }, { "line": 61, "end_line": 61, "violates": [ "nums.length is divisible by k" ] }, { "line": 64, "end_line": 64, "violates": [ "nums.length is divisible by k" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= k <= nums.length <= 16" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= k <= nums.length <= 16" ] }, { "line": 76, "end_line": 76, "violates": [ "nums.length is divisible by k" ] }, { "line": 83, "end_line": 83, "violates": [ "nums.length is divisible by k" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 85, "end_line": 85, "violates": [ "nums.length is divisible by k" ] }, { "line": 86, "end_line": 86, "violates": [ "nums.length is divisible by k" ] }, { "line": 87, "end_line": 87, "violates": [ "nums.length is divisible by k" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The constraints are small enough for a backtrack solution but not any backtrack solution", "If we use a naive n^k don't you think it can be optimized" ] }, { "question_id": 1682, "task_id": "longest-palindromic-subsequence-ii", "drop": [ "premium" ] }, { "question_id": 1684, "task_id": "count-the-number-of-consistent-strings", "drop": [], "similar": [ "count-pairs-of-similar-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "allowed", "words" ], "tests": { "total": 66, "kept": 52, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= words[i].length <= 10" ] } ], "unchecked_constraints": [ "1 <= allowed.length <=**()26", "The characters in allowed are distinct." ], "public_tests": 3, "hints": [ "A string is incorrect if it contains a character that is not allowed", "Constraints are small enough for brute force" ] }, { "question_id": 1685, "task_id": "sum-of-absolute-differences-in-a-sorted-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 69, "kept": 63, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= nums[i] <= nums[i + 1] <= 10**(4)" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= nums[i] <= nums[i + 1] <= 10**(4)" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= nums[i] <= nums[i + 1] <= 10**(4)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= nums[i + 1] <= 10**(4)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= nums[i + 1] <= 10**(4)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= nums[i + 1] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Absolute difference is the same as max(a, b) - min(a, b). How can you use this fact with the fact that the array is sorted?", "For nums[i], the answer is (nums[i] - nums[0]) + (nums[i] - nums[1]) + ... + (nums[i] - nums[i-1]) + (nums[i+1] - nums[i]) + (nums[i+2] - nums[i]) + ... + (nums[n-1] - nums[i]).", "It can be simplified to (nums[i] * i - (nums[0] + nums[1] + ... + nums[i-1])) + ((nums[i+1] + nums[i+2] + ... + nums[n-1]) - nums[i] * (n-i-1)). One can build prefix and suffix sums to compute this quickly." ] }, { "question_id": 1686, "task_id": "stone-game-vi", "drop": [], "similar": [ "stone-game", "stone-game-ii", "stone-game-iii", "stone-game-iv", "stone-game-v", "stone-game-vii", "stone-game-viii", "stone-game-ix" ], "flags": [], "comparison": "exact", "parameter_names": [ "aliceValues", "bobValues" ], "tests": { "total": 106, "kept": 103, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "1 <= aliceValues[i], bobValues[i] <= 100" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= aliceValues[i], bobValues[i] <= 100" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= aliceValues[i], bobValues[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "When one takes the stone, they not only get the points, but they take them away from the other player too.", "Greedily choose the stone with the maximum aliceValues[i] + bobValues[i]." ] }, { "question_id": 1687, "task_id": "delivering-boxes-from-storage-to-ports", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "boxes", "portsCount", "maxBoxes", "maxWeight" ], "tests": { "total": 76, "kept": 76, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= ports\u200b\u200bi <= portsCount", "1 <= weightsi <= maxWeight" ], "public_tests": 3, "hints": [ "Try to think of the most basic dp which is n^2 now optimize it", "Think of any range query data structure to optimize" ] }, { "question_id": 1688, "task_id": "count-of-matches-in-tournament", "drop": [], "similar": [ "count-distinct-numbers-on-board" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 60, "kept": 60, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simulate the tournament as given in the statement.", "Be careful when handling odd integers." ] }, { "question_id": 1689, "task_id": "partitioning-into-minimum-number-of-deci-binary-numbers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 72, "kept": 72, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "n does not contain any leading zeros and represents a positive integer." ], "public_tests": 3, "hints": [ "Think about if the input was only one digit. Then you need to add up as many ones as the value of this digit.", "If the input has multiple digits, then you can solve for each digit independently, and merge the answers to form numbers that add up to that input.", "Thus the answer is equal to the max digit." ] }, { "question_id": 1690, "task_id": "stone-game-vii", "drop": [], "similar": [ "stone-game", "stone-game-ii", "stone-game-iii", "stone-game-iv", "stone-game-v", "stone-game-vi", "maximum-score-from-performing-multiplication-operations", "stone-game-viii", "stone-game-ix" ], "flags": [], "comparison": "exact", "parameter_names": [ "stones" ], "tests": { "total": 109, "kept": 96, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 38, "end_line": 38, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= stones[i] <= 1000" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= stones[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The constraints are small enough for an N^2 solution.", "Try using dynamic programming." ] }, { "question_id": 1691, "task_id": "maximum-height-by-stacking-cuboids", "drop": [], "similar": [ "the-number-of-weak-characters-in-the-game", "maximum-number-of-groups-entering-a-competition" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "cuboids" ], "tests": { "total": 108, "kept": 107, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 90, "end_line": 90, "violates": [ "1 <= widthi, lengthi, heighti <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Does the dynamic programming sound like the right algorithm after sorting?", "Let's say box1 can be placed on top of box2. No matter what orientation box2 is in, we can rotate box1 so that it can be placed on top. Why don't we orient everything such that height is the biggest?" ] }, { "question_id": 1692, "task_id": "count-ways-to-distribute-candies", "drop": [ "premium" ] }, { "question_id": 1694, "task_id": "reformat-phone-number", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "number" ], "tests": { "total": 161, "kept": 159, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 63, "end_line": 63, "violates": [ "2 <= number.length <= 100" ] }, { "line": 71, "end_line": 71, "violates": [ "2 <= number.length <= 100" ] } ], "unchecked_constraints": [ "There are at least two digits in number." ], "public_tests": 3, "hints": [ "Discard all the spaces and dashes.", "Use a while loop. While the string still has digits, check its length and see which rule to apply." ] }, { "question_id": 1695, "task_id": "maximum-erasure-value", "drop": [], "similar": [ "longest-substring-without-repeating-characters" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 105, "kept": 104, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The main point here is for the subarray to contain unique elements for each index. Only the first subarrays starting from that index have unique elements.", "This can be solved using the two pointers technique" ] }, { "question_id": 1696, "task_id": "jump-game-vi", "drop": [], "similar": [ "sliding-window-maximum", "jump-game-vii", "jump-game-viii", "maximize-value-of-function-in-a-ball-passing-game" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 92, "kept": 92, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let dp[i] be \"the maximum score to reach the end starting at index i\". The answer for dp[i] is nums[i] + max{dp[i+j]} for 1 <= j <= k. That gives an O(n*k) solution.", "Instead of checking every j for every i, keep track of the largest dp[i] values in a heap and calculate dp[i] from right to left. When the largest value in the heap is out of bounds of the current index, remove it and keep checking." ] }, { "question_id": 1697, "task_id": "checking-existence-of-edge-length-limited-paths", "drop": [], "similar": [ "checking-existence-of-edge-length-limited-paths-ii", "number-of-good-paths", "minimum-score-of-a-path-between-two-cities" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edgeList", "queries" ], "tests": { "total": 62, "kept": 62, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= ui, vi, pj, qj <= n - 1", "pj != qj", "1 <= disi, limitj <= 10**(9)", "There may be multiple edges between two nodes." ], "public_tests": 2, "hints": [ "All the queries are given in advance. Is there a way you can reorder the queries to avoid repeated computations?" ] }, { "question_id": 1698, "task_id": "number-of-distinct-substrings-in-a-string", "drop": [ "premium" ] }, { "question_id": 1700, "task_id": "number-of-students-unable-to-eat-lunch", "drop": [], "similar": [ "time-needed-to-buy-tickets" ], "flags": [], "comparison": "exact", "parameter_names": [ "students", "sandwiches" ], "tests": { "total": 88, "kept": 86, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 52, "end_line": 52, "violates": [ "students.length == sandwiches.length" ] }, { "line": 88, "end_line": 88, "violates": [ "students.length == sandwiches.length" ] } ], "unchecked_constraints": [ "sandwiches[i] is 0 or 1.", "students[i] is 0 or 1." ], "public_tests": 2, "hints": [ "Simulate the given in the statement", "Calculate those who will eat instead of those who will not." ] }, { "question_id": 1701, "task_id": "average-waiting-time", "drop": [], "similar": [ "average-height-of-buildings-in-each-segment" ], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "customers" ], "tests": { "total": 92, "kept": 89, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= arrivali, timei <= 10**(4)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= arrivali, timei <= 10**(4)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= arrivali, timei <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate on the customers, maintaining the time the chef will finish the previous orders.", "If that time is before the current arrival time, the chef starts immediately. Else, the current customer waits till the chef finishes, and then the chef starts.", "Update the running time by the time when the chef starts preparing + preparation time." ] }, { "question_id": 1702, "task_id": "maximum-binary-string-after-change", "drop": [], "similar": [ "longest-binary-subsequence-less-than-or-equal-to-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "binary" ], "tests": { "total": 133, "kept": 133, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Note that with the operations, you can always make the string only contain at most 1 zero." ] }, { "question_id": 1703, "task_id": "minimum-adjacent-swaps-for-k-consecutive-ones", "drop": [], "similar": [ "minimum-swaps-to-group-all-1s-together", "minimum-number-of-operations-to-make-array-continuous", "minimum-adjacent-swaps-to-make-a-valid-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 99, "kept": 97, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "1 <= k <= sum(nums)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= k <= sum(nums)" ] } ], "unchecked_constraints": [ "nums[i] is 0 or 1." ], "public_tests": 3, "hints": [ "Choose k 1s and determine how many steps are required to move them into 1 group.", "Maintain a sliding window of k 1s, and maintain the steps required to group them.", "When you slide the window across, should you move the group to the right? Once you move the group to the right, it will never need to slide to the left again." ] }, { "question_id": 1704, "task_id": "determine-if-string-halves-are-alike", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 175, "kept": 102, "dropped": { "constraint_violation": 73 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "s.length is even." ] }, { "line": 5, "end_line": 5, "violates": [ "s.length is even." ] }, { "line": 6, "end_line": 6, "violates": [ "s.length is even." ] }, { "line": 7, "end_line": 7, "violates": [ "s.length is even." ] }, { "line": 11, "end_line": 11, "violates": [ "s.length is even." ] }, { "line": 14, "end_line": 14, "violates": [ "s.length is even." ] }, { "line": 15, "end_line": 15, "violates": [ "s.length is even." ] }, { "line": 16, "end_line": 16, "violates": [ "s.length is even." ] }, { "line": 17, "end_line": 17, "violates": [ "s.length is even." ] }, { "line": 21, "end_line": 21, "violates": [ "s.length is even." ] }, { "line": 22, "end_line": 22, "violates": [ "s.length is even." ] }, { "line": 24, "end_line": 24, "violates": [ "s.length is even." ] }, { "line": 30, "end_line": 30, "violates": [ "s.length is even." ] }, { "line": 32, "end_line": 32, "violates": [ "s.length is even." ] }, { "line": 33, "end_line": 33, "violates": [ "s.length is even." ] }, { "line": 35, "end_line": 35, "violates": [ "s.length is even." ] }, { "line": 38, "end_line": 38, "violates": [ "s.length is even." ] }, { "line": 41, "end_line": 41, "violates": [ "s.length is even." ] }, { "line": 43, "end_line": 43, "violates": [ "s.length is even." ] }, { "line": 44, "end_line": 44, "violates": [ "s.length is even." ] }, { "line": 46, "end_line": 46, "violates": [ "s.length is even." ] }, { "line": 48, "end_line": 48, "violates": [ "s.length is even." ] }, { "line": 49, "end_line": 49, "violates": [ "s.length is even." ] }, { "line": 50, "end_line": 50, "violates": [ "s.length is even." ] }, { "line": 56, "end_line": 56, "violates": [ "s.length is even." ] }, { "line": 57, "end_line": 57, "violates": [ "s.length is even." ] }, { "line": 58, "end_line": 58, "violates": [ "s.length is even." ] }, { "line": 62, "end_line": 62, "violates": [ "s.length is even." ] }, { "line": 63, "end_line": 63, "violates": [ "s.length is even." ] }, { "line": 66, "end_line": 66, "violates": [ "s.length is even." ] }, { "line": 71, "end_line": 71, "violates": [ "s.length is even." ] }, { "line": 74, "end_line": 74, "violates": [ "s.length is even." ] }, { "line": 75, "end_line": 75, "violates": [ "s.length is even." ] }, { "line": 80, "end_line": 80, "violates": [ "s.length is even." ] }, { "line": 82, "end_line": 82, "violates": [ "s.length is even." ] }, { "line": 85, "end_line": 85, "violates": [ "s.length is even." ] }, { "line": 87, "end_line": 87, "violates": [ "s.length is even." ] }, { "line": 88, "end_line": 88, "violates": [ "s.length is even." ] }, { "line": 90, "end_line": 90, "violates": [ "s.length is even." ] }, { "line": 93, "end_line": 93, "violates": [ "s.length is even." ] }, { "line": 96, "end_line": 96, "violates": [ "s.length is even." ] }, { "line": 97, "end_line": 97, "violates": [ "s.length is even." ] }, { "line": 98, "end_line": 98, "violates": [ "s.length is even." ] }, { "line": 99, "end_line": 99, "violates": [ "s.length is even." ] }, { "line": 102, "end_line": 102, "violates": [ "s.length is even." ] }, { "line": 115, "end_line": 115, "violates": [ "s.length is even." ] }, { "line": 117, "end_line": 117, "violates": [ "s.length is even." ] }, { "line": 120, "end_line": 120, "violates": [ "s.length is even." ] }, { "line": 121, "end_line": 121, "violates": [ "s.length is even." ] }, { "line": 123, "end_line": 123, "violates": [ "s.length is even." ] }, { "line": 125, "end_line": 125, "violates": [ "s.length is even." ] }, { "line": 126, "end_line": 126, "violates": [ "s.length is even." ] }, { "line": 127, "end_line": 127, "violates": [ "s.length is even." ] }, { "line": 131, "end_line": 131, "violates": [ "s.length is even." ] }, { "line": 133, "end_line": 133, "violates": [ "s.length is even." ] }, { "line": 135, "end_line": 135, "violates": [ "s.length is even." ] }, { "line": 136, "end_line": 136, "violates": [ "s.length is even." ] }, { "line": 137, "end_line": 137, "violates": [ "s.length is even." ] }, { "line": 139, "end_line": 139, "violates": [ "s.length is even." ] }, { "line": 144, "end_line": 144, "violates": [ "s.length is even." ] }, { "line": 146, "end_line": 146, "violates": [ "s.length is even." ] }, { "line": 151, "end_line": 151, "violates": [ "s.length is even." ] }, { "line": 157, "end_line": 157, "violates": [ "s.length is even." ] }, { "line": 164, "end_line": 164, "violates": [ "s.length is even." ] }, { "line": 165, "end_line": 165, "violates": [ "s.length is even." ] }, { "line": 166, "end_line": 166, "violates": [ "s.length is even." ] }, { "line": 167, "end_line": 167, "violates": [ "s.length is even." ] }, { "line": 168, "end_line": 168, "violates": [ "s.length is even." ] }, { "line": 169, "end_line": 169, "violates": [ "s.length is even." ] }, { "line": 170, "end_line": 170, "violates": [ "s.length is even." ] }, { "line": 171, "end_line": 171, "violates": [ "s.length is even." ] }, { "line": 174, "end_line": 174, "violates": [ "s.length is even." ] }, { "line": 175, "end_line": 175, "violates": [ "s.length is even." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Create a function that checks if a character is a vowel, either uppercase or lowercase." ] }, { "question_id": 1705, "task_id": "maximum-number-of-eaten-apples", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "apples", "days" ], "tests": { "total": 72, "kept": 72, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "days[i] = 0 if and only if apples[i] = 0." ], "public_tests": 2, "hints": [ "It's optimal to finish the apples that will rot first before those that will rot last", "You need a structure to keep the apples sorted by their finish time" ] }, { "question_id": 1706, "task_id": "where-will-the-ball-fall", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 65, "kept": 65, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "grid[i][j] is 1 or -1." ], "public_tests": 3, "hints": [ "Use DFS.", "Traverse the path of the ball downwards until you reach the bottom or get stuck." ] }, { "question_id": 1707, "task_id": "maximum-xor-with-an-element-from-array", "drop": [], "similar": [ "maximum-xor-of-two-numbers-in-an-array", "maximum-genetic-difference-query", "minimize-xor", "maximum-strong-pair-xor-i", "maximum-strong-pair-xor-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 83, "kept": 78, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "0 <= nums[j], xi, mi <= 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= nums[j], xi, mi <= 10**(9)" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= nums[j], xi, mi <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= nums[j], xi, mi <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= nums[j], xi, mi <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "In problems involving bitwise operations, we often think on the bits level. In this problem, we can think that to maximize the result of an xor operation, we need to maximize the most significant bit, then the next one, and so on.", "If there's some number in the array that is less than m and whose the most significant bit is different than that of x, then xoring with this number maximizes the most significant bit, so I know this bit in the answer is 1.", "To check the existence of such numbers and narrow your scope for further bits based on your choice, you can use trie.", "You can sort the array and the queries, and maintain the trie such that in each query the trie consists exactly of the valid elements." ] }, { "question_id": 1708, "task_id": "largest-subarray-length-k", "drop": [ "premium" ] }, { "question_id": 1710, "task_id": "maximum-units-on-a-truck", "drop": [], "similar": [ "maximum-bags-with-full-capacity-of-rocks" ], "flags": [], "comparison": "exact", "parameter_names": [ "boxTypes", "truckSize" ], "tests": { "total": 104, "kept": 102, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 72, "end_line": 72, "violates": [ "1 <= numberOfBoxesi, numberOfUnitsPerBoxi <= 1000" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= numberOfBoxesi, numberOfUnitsPerBoxi <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If we have space for at least one box, it's always optimal to put the box with the most units.", "Sort the box types with the number of units per box non-increasingly.", "Iterate on the box types and take from each type as many as you can." ] }, { "question_id": 1711, "task_id": "count-good-meals", "drop": [], "similar": [ "two-sum", "max-number-of-k-sum-pairs", "find-all-possible-recipes-from-given-supplies" ], "flags": [], "comparison": "exact", "parameter_names": [ "deliciousness" ], "tests": { "total": 101, "kept": 95, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "0 <= deliciousness[i] <= 2**(20)" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= deliciousness[i] <= 2**(20)" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= deliciousness[i] <= 2**(20)" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= deliciousness[i] <= 2**(20)" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= deliciousness[i] <= 2**(20)" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= deliciousness[i] <= 2**(20)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Note that the number of powers of 2 is at most 21 so this turns the problem to a classic find the number of pairs that sum to a certain value but for 21 values", "You need to use something fasters than the NlogN approach since there is already the log of iterating over the powers so one idea is two pointers" ] }, { "question_id": 1712, "task_id": "ways-to-split-array-into-three-subarrays", "drop": [], "similar": [ "number-of-ways-to-divide-a-long-corridor", "number-of-ways-to-split-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 93, "kept": 86, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "0 <= nums[i] <= 10**(4)" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= nums[i] <= 10**(4)" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= nums[i] <= 10**(4)" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= nums[i] <= 10**(4)" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= nums[i] <= 10**(4)" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= nums[i] <= 10**(4)" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Create a prefix array to efficiently find the sum of subarrays.", "As we are dividing the array into three subarrays, there are two \"walls\". Iterate over the right wall positions and find where the left wall could be for each right wall position.", "Use binary search to find the left-most position and right-most position the left wall could be." ] }, { "question_id": 1713, "task_id": "minimum-operations-to-make-a-subsequence", "drop": [], "similar": [ "append-characters-to-string-to-make-subsequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "target", "arr" ], "tests": { "total": 111, "kept": 109, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 62, "end_line": 62, "violates": [ "1 <= target[i], arr[i] <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= target[i], arr[i] <= 10**(9)" ] } ], "unchecked_constraints": [ "target contains no duplicates." ], "public_tests": 2, "hints": [ "The problem can be reduced to computing Longest Common Subsequence between both arrays.", "Since one of the arrays has distinct elements, we can consider that these elements describe an arrangement of numbers, and we can replace each element in the other array with the index it appeared at in the first array.", "Then the problem is converted to finding Longest Increasing Subsequence in the second array, which can be done in O(n log n)." ] }, { "question_id": 1714, "task_id": "sum-of-special-evenly-spaced-elements-in-array", "drop": [ "premium" ] }, { "question_id": 1716, "task_id": "calculate-money-in-leetcode-bank", "drop": [], "similar": [ "distribute-money-to-maximum-children" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 50, "kept": 50, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Simulate the process by keeping track of how much money Hercy is putting in and which day of the week it is, and use this information to deduce how much money Hercy will put in the next day." ] }, { "question_id": 1717, "task_id": "maximum-score-from-removing-substrings", "drop": [], "similar": [ "count-words-obtained-after-adding-a-letter" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "x", "y" ], "tests": { "total": 154, "kept": 151, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= s.length <= 10**(5)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= s.length <= 10**(5)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= s.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Note that it is always more optimal to take one type of substring before another", "You can use a stack to handle erasures" ] }, { "question_id": 1718, "task_id": "construct-the-lexicographically-largest-valid-sequence", "drop": [], "similar": [ "the-number-of-beautiful-subsets", "find-the-lexicographically-largest-string-from-the-box-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 18, "kept": 18, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Heuristic algorithm may work." ], "similar_to_test": [ "3403 find-the-lexicographically-largest-string-from-the-box-i" ] }, { "question_id": 1719, "task_id": "number-of-ways-to-reconstruct-a-tree", "drop": [], "similar": [ "create-binary-tree-from-descriptions", "maximum-star-sum-of-a-graph" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "pairs" ], "tests": { "total": 80, "kept": 80, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The elements in pairs are unique." ], "public_tests": 3, "hints": [ "Think inductively. The first step is to get the root. Obviously, the root should be in pairs with all the nodes. If there isn't exactly one such node, then there are 0 ways.", "The number of pairs involving a node must be less than or equal to that number of its parent.", "Actually, if it's equal, then there is not exactly 1 way, because they can be swapped.", "Recursively, given a set of nodes, get the node with the most pairs, then this must be a root and have no parents in the current set of nodes." ] }, { "question_id": 1720, "task_id": "decode-xored-array", "drop": [], "similar": [ "find-the-original-array-of-prefix-xor" ], "flags": [], "comparison": "exact", "parameter_names": [ "encoded", "first" ], "tests": { "total": 97, "kept": 94, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "0 <= encoded[i] <= 10**(5)", "0 <= first <= 10**(5)" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= encoded[i] <= 10**(5)", "0 <= first <= 10**(5)" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= encoded[i] <= 10**(5)", "0 <= first <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Since that encoded[i] = arr[i] XOR arr[i+1], then arr[i+1] = encoded[i] XOR arr[i].", "Iterate on i from beginning to end, and set arr[i+1] = encoded[i] XOR arr[i]." ] }, { "question_id": 1721, "task_id": "swapping-nodes-in-a-linked-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "remove-nth-node-from-end-of-list", "swap-nodes-in-pairs", "reverse-nodes-in-k-group" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head", "k" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the list is n.", "1 <= k <= n <= 10**(5)", "0 <= Node.val <= 100" ] }, { "question_id": 1722, "task_id": "minimize-hamming-distance-after-swap-operations", "drop": [], "similar": [ "smallest-string-with-swaps", "make-lexicographically-smallest-array-by-swapping-elements" ], "flags": [], "comparison": "exact", "parameter_names": [ "source", "target", "allowedSwaps" ], "tests": { "total": 83, "kept": 78, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "ai != bi" ] }, { "line": 15, "end_line": 15, "violates": [ "ai != bi" ] }, { "line": 17, "end_line": 17, "violates": [ "ai != bi" ] }, { "line": 26, "end_line": 26, "violates": [ "ai != bi" ] }, { "line": 39, "end_line": 39, "violates": [ "ai != bi" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The source array can be imagined as a graph where each index is a node and each allowedSwaps[i] is an edge.", "Nodes within the same component can be freely swapped with each other.", "For each component, find the number of common elements. The elements that are not in common will contribute to the total Hamming distance." ] }, { "question_id": 1723, "task_id": "find-minimum-time-to-finish-all-jobs", "drop": [], "similar": [ "minimum-number-of-work-sessions-to-finish-the-tasks", "find-minimum-time-to-finish-all-jobs-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "jobs", "k" ], "tests": { "total": 111, "kept": 110, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= jobs[i] <= 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We can select a subset of tasks and assign it to a worker then solve the subproblem on the remaining tasks" ] }, { "question_id": 1725, "task_id": "number-of-rectangles-that-can-form-the-largest-square", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "rectangles" ], "tests": { "total": 83, "kept": 22, "dropped": { "constraint_violation": 61 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "li != wi" ] }, { "line": 6, "end_line": 6, "violates": [ "li != wi" ] }, { "line": 7, "end_line": 7, "violates": [ "li != wi" ] }, { "line": 8, "end_line": 8, "violates": [ "li != wi" ] }, { "line": 10, "end_line": 10, "violates": [ "li != wi" ] }, { "line": 11, "end_line": 11, "violates": [ "li != wi" ] }, { "line": 12, "end_line": 12, "violates": [ "li != wi" ] }, { "line": 13, "end_line": 13, "violates": [ "li != wi" ] }, { "line": 14, "end_line": 14, "violates": [ "li != wi" ] }, { "line": 15, "end_line": 15, "violates": [ "li != wi" ] }, { "line": 16, "end_line": 16, "violates": [ "li != wi" ] }, { "line": 17, "end_line": 17, "violates": [ "li != wi" ] }, { "line": 18, "end_line": 18, "violates": [ "li != wi" ] }, { "line": 19, "end_line": 19, "violates": [ "li != wi" ] }, { "line": 20, "end_line": 20, "violates": [ "li != wi" ] }, { "line": 21, "end_line": 21, "violates": [ "li != wi" ] }, { "line": 24, "end_line": 24, "violates": [ "li != wi" ] }, { "line": 25, "end_line": 25, "violates": [ "li != wi" ] }, { "line": 26, "end_line": 26, "violates": [ "li != wi" ] }, { "line": 27, "end_line": 27, "violates": [ "li != wi" ] }, { "line": 28, "end_line": 28, "violates": [ "li != wi" ] }, { "line": 30, "end_line": 30, "violates": [ "li != wi" ] }, { "line": 33, "end_line": 33, "violates": [ "li != wi" ] }, { "line": 34, "end_line": 34, "violates": [ "li != wi" ] }, { "line": 35, "end_line": 35, "violates": [ "li != wi" ] }, { "line": 36, "end_line": 36, "violates": [ "li != wi" ] }, { "line": 37, "end_line": 37, "violates": [ "li != wi" ] }, { "line": 38, "end_line": 38, "violates": [ "li != wi" ] }, { "line": 39, "end_line": 39, "violates": [ "li != wi" ] }, { "line": 40, "end_line": 40, "violates": [ "li != wi" ] }, { "line": 41, "end_line": 41, "violates": [ "li != wi" ] }, { "line": 43, "end_line": 43, "violates": [ "li != wi" ] }, { "line": 45, "end_line": 45, "violates": [ "li != wi" ] }, { "line": 46, "end_line": 46, "violates": [ "li != wi" ] }, { "line": 47, "end_line": 47, "violates": [ "li != wi" ] }, { "line": 49, "end_line": 49, "violates": [ "li != wi" ] }, { "line": 50, "end_line": 50, "violates": [ "li != wi" ] }, { "line": 51, "end_line": 51, "violates": [ "li != wi" ] }, { "line": 52, "end_line": 52, "violates": [ "li != wi" ] }, { "line": 53, "end_line": 53, "violates": [ "li != wi" ] }, { "line": 55, "end_line": 55, "violates": [ "li != wi" ] }, { "line": 56, "end_line": 56, "violates": [ "li != wi" ] }, { "line": 57, "end_line": 57, "violates": [ "li != wi" ] }, { "line": 60, "end_line": 60, "violates": [ "li != wi" ] }, { "line": 61, "end_line": 61, "violates": [ "li != wi" ] }, { "line": 63, "end_line": 63, "violates": [ "li != wi" ] }, { "line": 64, "end_line": 64, "violates": [ "li != wi" ] }, { "line": 65, "end_line": 65, "violates": [ "li != wi" ] }, { "line": 67, "end_line": 67, "violates": [ "li != wi" ] }, { "line": 68, "end_line": 68, "violates": [ "li != wi" ] }, { "line": 70, "end_line": 70, "violates": [ "li != wi" ] }, { "line": 72, "end_line": 72, "violates": [ "li != wi" ] }, { "line": 73, "end_line": 73, "violates": [ "li != wi" ] }, { "line": 74, "end_line": 74, "violates": [ "li != wi" ] }, { "line": 75, "end_line": 75, "violates": [ "li != wi" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= li, wi <= 10**(9)", "li != wi" ] }, { "line": 79, "end_line": 79, "violates": [ "li != wi" ] }, { "line": 80, "end_line": 80, "violates": [ "li != wi" ] }, { "line": 81, "end_line": 81, "violates": [ "li != wi" ] }, { "line": 82, "end_line": 82, "violates": [ "li != wi" ] }, { "line": 84, "end_line": 84, "violates": [ "li != wi" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What is the length of the largest square the can be cut out of some rectangle? It'll be equal to min(rectangle.length, rectangle.width). Replace each rectangle with this value.", "Calculate maxSize by iterating over the given rectangles and maximizing the answer with their values denoted in the first hint.", "Then iterate again on the rectangles and calculate the number whose values = maxSize." ] }, { "question_id": 1726, "task_id": "tuple-with-same-product", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 105, "kept": 89, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 10**(4)", "1 <= nums[i] <= 10**(4)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 10**(4)", "1 <= nums[i] <= 10**(4)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 10**(4)", "1 <= nums[i] <= 10**(4)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 10**(4)", "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Note that all of the integers are distinct. This means that each time a product is formed it must be formed by two unique integers.", "Count the frequency of each product of 2 distinct numbers. Then calculate the permutations formed." ] }, { "question_id": 1727, "task_id": "largest-submatrix-with-rearrangements", "drop": [], "similar": [ "max-area-of-island" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 83, "kept": 83, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each column, find the number of consecutive ones ending at each position.", "For each row, sort the cumulative ones in non-increasing order and \"fit\" the largest submatrix." ] }, { "question_id": 1728, "task_id": "cat-and-mouse-ii", "drop": [], "similar": [ "escape-the-ghosts", "cat-and-mouse" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid", "catJump", "mouseJump" ], "tests": { "total": 57, "kept": 57, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "cols = grid[i].length", "1 <= rows, cols <= 8", "There is only one of each character 'C', 'M', and 'F' in grid." ], "public_tests": 3, "hints": [ "Try working backward: consider all trivial states you know to be winning or losing, and work backward to determine which other states can be labeled as winning or losing." ] }, { "question_id": 1730, "task_id": "shortest-path-to-get-food", "drop": [ "premium" ] }, { "question_id": 1732, "task_id": "find-the-highest-altitude", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "gain" ], "tests": { "total": 110, "kept": 106, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 68, "end_line": 68, "violates": [ "-100 <= gain[i] <= 100" ] }, { "line": 74, "end_line": 74, "violates": [ "-100 <= gain[i] <= 100" ] }, { "line": 76, "end_line": 76, "violates": [ "-100 <= gain[i] <= 100" ] }, { "line": 82, "end_line": 82, "violates": [ "-100 <= gain[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let's note that the altitude of an element is the sum of gains of all the elements behind it", "Getting the altitudes can be done by getting the prefix sum array of the given array" ] }, { "question_id": 1733, "task_id": "minimum-number-of-people-to-teach", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "languages", "friendships" ], "tests": { "total": 73, "kept": 73, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= u\u200b\u200b\u200b\u200b\u200b\u200bi < v\u200b\u200b\u200b\u200b\u200b\u200bi <= languages.length", "All tuples (u\u200b\u200b\u200b\u200b\u200bi, v\u200b\u200b\u200b\u200b\u200b\u200bi) are unique", "languages[i] contains only unique values" ], "public_tests": 2, "hints": [ "You can just use brute force and find out for each language the number of users you need to teach", "Note that a user can appear in multiple friendships but you need to teach that user only once" ] }, { "question_id": 1734, "task_id": "decode-xored-permutation", "drop": [], "similar": [ "find-xor-beauty-of-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "encoded" ], "tests": { "total": 110, "kept": 109, "dropped": { "int_overflow": 1 } }, "dropped_tests": [ { "line": 83, "end_line": 83, "unrepresentable_in": [ "cpp", "rust", "java" ] } ], "unchecked_constraints": [ "n is odd." ], "public_tests": 2, "hints": [ "Compute the XOR of the numbers between 1 and n, and think about how it can be used. Let it be x.", "Think why n is odd.", "perm[0] = x XOR encoded[1] XOR encoded[3] XOR encoded[5] ...", "perm[i] = perm[i-1] XOR encoded[i-1]" ] }, { "question_id": 1736, "task_id": "latest-time-by-replacing-hidden-digits", "drop": [], "similar": [ "number-of-valid-clock-times", "latest-time-you-can-obtain-after-replacing-characters" ], "flags": [], "comparison": "exact", "parameter_names": [ "time" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "time is in the format hh:mm.", "It is guaranteed that you can produce a valid time from the given string." ], "public_tests": 3, "hints": [ "Trying out all possible solutions from biggest to smallest would fit in the time limit.", "To check if the solution is okay, you need to find out if it's valid and matches every character" ] }, { "question_id": 1737, "task_id": "change-minimum-characters-to-satisfy-one-of-three-conditions", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "a", "b" ], "tests": { "total": 128, "kept": 128, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate on each letter in the alphabet, and check the smallest number of operations needed to make it one of the following: the largest letter in a and smaller than the smallest one in b, vice versa, or let a and b consist only of this letter.", "For the first 2 conditions, take care that you can only change characters to lowercase letters, so you can't make 'z' the smallest letter in one of the strings or 'a' the largest letter in one of them." ] }, { "question_id": 1738, "task_id": "find-kth-largest-xor-coordinate-value", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "matrix", "k" ], "tests": { "total": 87, "kept": 86, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 63, "end_line": 63, "violates": [ "1 <= k <= m * n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a 2D prefix sum to precalculate the xor-sum of the upper left submatrix." ] }, { "question_id": 1739, "task_id": "building-boxes", "drop": [], "similar": [ "block-placement-queries" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 101, "kept": 101, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Suppose We can put m boxes on the floor, within all the ways to put the boxes, what\u2019s the maximum number of boxes we can put in?", "The first box should always start in the corner" ] }, { "question_id": 1740, "task_id": "find-distance-in-a-binary-tree", "drop": [ "premium" ] }, { "question_id": 1742, "task_id": "maximum-number-of-balls-in-a-box", "drop": [], "similar": [ "find-the-number-of-distinct-colors-among-the-balls" ], "flags": [], "comparison": "exact", "parameter_names": [ "lowLimit", "highLimit" ], "tests": { "total": 86, "kept": 83, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= lowLimit <= highLimit <= 10**(5)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= lowLimit <= highLimit <= 10**(5)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= lowLimit <= highLimit <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Note that both lowLimit and highLimit are of small constraints so you can iterate on all number between them", "You can simulate the boxes by counting for each box the number of balls with digit sum equal to that box number" ] }, { "question_id": 1743, "task_id": "restore-the-array-from-adjacent-pairs", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "adjacentPairs" ], "tests": { "total": 79, "kept": 79, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums.length == n", "adjacentPairs.length == n - 1", "2 <= n <= 10**(5)", "-10**(5) <= nums[i], ui, vi <= 10**(5)", "There exists some nums that has adjacentPairs as its pairs." ], "public_tests": 3, "hints": [ "Find the first element of nums - it will only appear once in adjacentPairs.", "The adjacent pairs are like edges of a graph. Perform a depth-first search from the first element." ] }, { "question_id": 1744, "task_id": "can-you-eat-your-favorite-candy-on-your-favorite-day", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "candiesCount", "queries" ], "tests": { "total": 55, "kept": 36, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= candiesCount[i] <= 10**(5)", "0 <= favoriteDayi <= 10**(9)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= candiesCount[i] <= 10**(5)", "0 <= favoriteDayi <= 10**(9)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= candiesCount[i] <= 10**(5)", "0 <= favoriteDayi <= 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= candiesCount[i] <= 10**(5)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= candiesCount[i] <= 10**(5)", "0 <= favoriteDayi <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The query is true if and only if your favorite day is in between the earliest and latest possible days to eat your favorite candy.", "To get the earliest day, you need to eat dailyCap candies every day. To get the latest day, you need to eat 1 candy every day.", "The latest possible day is the total number of candies with a smaller type plus the number of your favorite candy minus 1.", "The earliest possible day that you can eat your favorite candy is the total number of candies with a smaller type divided by dailyCap." ] }, { "question_id": 1745, "task_id": "palindrome-partitioning-iv", "drop": [], "similar": [ "palindrome-partitioning", "palindrome-partitioning-ii", "palindrome-partitioning-iii", "maximum-number-of-non-overlapping-palindrome-substrings" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 165, "kept": 165, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s\u200b\u200b\u200b\u200b\u200b\u200b consists only of lowercase English letters." ], "public_tests": 2, "hints": [ "Preprocess checking palindromes in O(1)", "Note that one string is a prefix and another one is a suffix you can try brute forcing the rest" ] }, { "question_id": 1746, "task_id": "maximum-subarray-sum-after-one-operation", "drop": [ "premium" ] }, { "question_id": 1748, "task_id": "sum-of-unique-elements", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 99, "kept": 96, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a dictionary to count the frequency of each number." ] }, { "question_id": 1749, "task_id": "maximum-absolute-sum-of-any-subarray", "drop": [], "similar": [ "maximum-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 110, "kept": 105, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 49, "end_line": 49, "violates": [ "-10**(4) <= nums[i] <= 10**(4)" ] }, { "line": 59, "end_line": 59, "violates": [ "-10**(4) <= nums[i] <= 10**(4)" ] }, { "line": 71, "end_line": 71, "violates": [ "-10**(4) <= nums[i] <= 10**(4)" ] }, { "line": 82, "end_line": 82, "violates": [ "-10**(4) <= nums[i] <= 10**(4)" ] }, { "line": 86, "end_line": 86, "violates": [ "-10**(4) <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What if we asked for maximum sum, not absolute sum?", "It's a standard problem that can be solved by Kadane's algorithm.", "The key idea is the max absolute sum will be either the max sum or the min sum.", "So just run kadane twice, once calculating the max sum and once calculating the min sum." ] }, { "question_id": 1750, "task_id": "minimum-length-of-string-after-deleting-similar-ends", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 170, "kept": 136, "dropped": { "constraint_violation": 34 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 29, "end_line": 29, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 37, "end_line": 37, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 43, "end_line": 43, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 48, "end_line": 48, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 55, "end_line": 55, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 57, "end_line": 57, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 63, "end_line": 63, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 70, "end_line": 70, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 74, "end_line": 74, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 83, "end_line": 83, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 87, "end_line": 87, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 90, "end_line": 90, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 91, "end_line": 91, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 105, "end_line": 105, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 106, "end_line": 106, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 108, "end_line": 108, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 113, "end_line": 113, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 114, "end_line": 114, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 118, "end_line": 118, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 119, "end_line": 119, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 121, "end_line": 121, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 130, "end_line": 130, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 131, "end_line": 131, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 134, "end_line": 134, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 138, "end_line": 138, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 145, "end_line": 145, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 146, "end_line": 146, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 149, "end_line": 149, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 150, "end_line": 150, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 152, "end_line": 152, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 162, "end_line": 162, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 166, "end_line": 166, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] }, { "line": 167, "end_line": 167, "violates": [ "s only consists of characters 'a', 'b', and 'c'." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If both ends have distinct characters, no more operations can be made. Otherwise, the only operation is to remove all of the same characters from both ends. We will do this as many times as we can.", "Note that if the length is equal 1 the answer is 1" ] }, { "question_id": 1751, "task_id": "maximum-number-of-events-that-can-be-attended-ii", "drop": [], "similar": [ "maximum-number-of-events-that-can-be-attended", "maximum-earnings-from-taxi", "two-best-non-overlapping-events", "meeting-rooms-iii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "events", "k" ], "tests": { "total": 108, "kept": 102, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 47, "end_line": 47, "violates": [ "1 <= startDayi <= endDayi <= 10**(9)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= valuei <= 10**(6)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= startDayi <= endDayi <= 10**(9)", "1 <= valuei <= 10**(6)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= startDayi <= endDayi <= 10**(9)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= startDayi <= endDayi <= 10**(9)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= startDayi <= endDayi <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the events by its startTime.", "For every event, you can either choose it and consider the next event available, or you can ignore it. You can efficiently find the next event that is available using binary search." ] }, { "question_id": 1752, "task_id": "check-if-array-is-sorted-and-rotated", "drop": [], "similar": [ "check-if-all-as-appears-before-all-bs" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 141, "kept": 134, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Brute force and check if it is possible for a sorted array to start from each position." ] }, { "question_id": 1753, "task_id": "maximum-score-from-removing-stones", "drop": [], "similar": [ "minimum-amount-of-time-to-fill-cups" ], "flags": [], "comparison": "exact", "parameter_names": [ "a", "b", "c" ], "tests": { "total": 88, "kept": 86, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= a, b, c <= 10**(5)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= a, b, c <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "It's optimal to always remove one stone from the biggest 2 piles", "Note that the limits are small enough for simulation" ] }, { "question_id": 1754, "task_id": "largest-merge-of-two-strings", "drop": [], "similar": [ "maximum-matching-of-players-with-trainers", "decremental-string-concatenation" ], "flags": [], "comparison": "exact", "parameter_names": [ "word1", "word2" ], "tests": { "total": 138, "kept": 136, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 83, "end_line": 83, "violates": [ "1 <= word1.length, word2.length <= 3000" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= word1.length, word2.length <= 3000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Build the result character by character. At each step, you choose a character from one of the two strings.", "If the next character of the first string is larger than that of the second string, or vice versa, it's optimal to use the larger one.", "If both are equal, think of a criteria that lets you decide which string to consume the next character from.", "You should choose the next character from the larger string." ] }, { "question_id": 1755, "task_id": "closest-subsequence-sum", "drop": [], "similar": [ "minimize-the-difference-between-target-and-chosen-elements", "partition-array-into-two-arrays-to-minimize-sum-difference", "minimum-operations-to-form-subsequence-with-target-sum", "find-the-sum-of-subsequence-powers" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "goal" ], "tests": { "total": 98, "kept": 86, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= nums.length <= 40" ] }, { "line": 6, "end_line": 6, "violates": [ "1 <= nums.length <= 40" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= nums.length <= 40" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= nums.length <= 40" ] }, { "line": 45, "end_line": 45, "violates": [ "-10**(7) <= nums[i] <= 10**(7)" ] }, { "line": 51, "end_line": 51, "violates": [ "-10**(7) <= nums[i] <= 10**(7)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums.length <= 40" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums.length <= 40" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums.length <= 40" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums.length <= 40" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums.length <= 40" ] }, { "line": 90, "end_line": 90, "violates": [ "-10**(7) <= nums[i] <= 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The naive solution is to check all possible subsequences. This works in O(2^n).", "Divide the array into two parts of nearly is equal size.", "Consider all subsets of one part and make a list of all possible subset sums and sort this list.", "Consider all subsets of the other part, and for each one, let its sum = x, do binary search to get the nearest possible value to goal - x in the first part." ] }, { "question_id": 1758, "task_id": "minimum-changes-to-make-alternating-binary-string", "drop": [], "similar": [ "remove-adjacent-almost-equal-characters" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 117, "kept": 117, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think about how the final string will look like.", "It will either start with a '0' and be like '010101010..' or with a '1' and be like '10101010..'", "Try both ways, and check for each way, the number of changes needed to reach it from the given string. The answer is the minimum of both ways." ] }, { "question_id": 1759, "task_id": "count-number-of-homogenous-substrings", "drop": [], "similar": [ "consecutive-characters", "number-of-substrings-with-only-1s", "sum-of-subarray-ranges", "count-the-number-of-good-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 80, "kept": 80, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "A string of only 'a's of length k contains k + 1 choose 2 homogenous substrings.", "Split the string into substrings where each substring contains only one letter, and apply the formula on each substring's length." ] }, { "question_id": 1760, "task_id": "minimum-limit-of-balls-in-a-bag", "drop": [], "similar": [ "maximum-candies-allocated-to-k-children", "minimized-maximum-of-products-distributed-to-any-store" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "maxOperations" ], "tests": { "total": 99, "kept": 91, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= maxOperations, nums[i] <= 10**(9)" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= maxOperations, nums[i] <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= maxOperations, nums[i] <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= maxOperations, nums[i] <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= maxOperations, nums[i] <= 10**(9)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= maxOperations, nums[i] <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= maxOperations, nums[i] <= 10**(9)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= maxOperations, nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let's change the question if we know the maximum size of a bag what is the minimum number of bags you can make", "note that as the maximum size increases the minimum number of bags decreases so we can binary search the maximum size" ] }, { "question_id": 1761, "task_id": "minimum-degree-of-a-connected-trio-in-a-graph", "drop": [], "similar": [ "add-edges-to-make-degrees-of-all-nodes-even" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 64, "kept": 64, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There are no repeated edges." ], "public_tests": 2, "hints": [ "Consider a trio with nodes u, v, and w. The degree of the trio is just degree(u) + degree(v) + degree(w) - 6. The -6 comes from subtracting the edges u-v, u-w, and v-w, which are counted twice each in the vertex degree calculation.", "To get the trios (u,v,w), you can iterate on u, then iterate on each w,v such that w and v are neighbors of u and are neighbors of each other." ] }, { "question_id": 1762, "task_id": "buildings-with-an-ocean-view", "drop": [ "premium" ] }, { "question_id": 1763, "task_id": "longest-nice-substring", "drop": [], "similar": [ "number-of-good-paths" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 152, "kept": 122, "dropped": { "constraint_violation": 30 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= s.length <= 100" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= s.length <= 100" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= s.length <= 100" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= s.length <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= s.length <= 100" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= s.length <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= s.length <= 100" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= s.length <= 100" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= s.length <= 100" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= s.length <= 100" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= s.length <= 100" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= s.length <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= s.length <= 100" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= s.length <= 100" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= s.length <= 100" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= s.length <= 100" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= s.length <= 100" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= s.length <= 100" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= s.length <= 100" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= s.length <= 100" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= s.length <= 100" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= s.length <= 100" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= s.length <= 100" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= s.length <= 100" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= s.length <= 100" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= s.length <= 100" ] }, { "line": 132, "end_line": 132, "violates": [ "1 <= s.length <= 100" ] }, { "line": 133, "end_line": 133, "violates": [ "1 <= s.length <= 100" ] }, { "line": 145, "end_line": 145, "violates": [ "1 <= s.length <= 100" ] }, { "line": 153, "end_line": 153, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Brute force and check each substring to see if it is nice." ] }, { "question_id": 1764, "task_id": "form-array-by-concatenating-subarrays-of-another-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "groups", "nums" ], "tests": { "total": 148, "kept": 148, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= groups[i].length, sum(groups[i].length) <= 10**(3)" ], "public_tests": 3, "hints": [ "When we use a subarray, the room for the next subarrays will be the suffix after the used subarray.", "If we can match a group with multiple subarrays, we should choose the first one, as this will just leave the largest room for the next subarrays." ] }, { "question_id": 1765, "task_id": "map-of-highest-peak", "drop": [], "similar": [], "flags": [ "multiple_answers", "has_images" ], "comparison": "exact", "parameter_names": [ "isWater" ], "tests": { "total": 68, "kept": 68, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "isWater[i][j] is 0 or 1.", "There is at least one water cell." ], "public_tests": 2, "hints": [ "Set each water cell to be 0. The height of each cell is limited by its closest water cell.", "Perform a multi-source BFS with all the water cells as sources." ] }, { "question_id": 1766, "task_id": "tree-of-coprimes", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums", "edges" ], "tests": { "total": 31, "kept": 23, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 12, "end_line": 12, "violates": [ "edges.length == n - 1" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 25, "end_line": 25, "violates": [ "edges.length == n - 1" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 50" ] } ], "unchecked_constraints": [ "0 <= uj, vj < n", "uj != vj" ], "public_tests": 2, "hints": [ "Note that for a node, it's not optimal to consider two nodes with the same value.", "Note that the values are small enough for you to iterate over them instead of iterating over the parent nodes." ] }, { "question_id": 1768, "task_id": "merge-strings-alternately", "drop": [], "similar": [ "zigzag-iterator", "minimum-additions-to-make-valid-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "word1", "word2" ], "tests": { "total": 92, "kept": 76, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= word1.length, word2.length <= 100" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= word1.length, word2.length <= 100" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= word1.length, word2.length <= 100" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= word1.length, word2.length <= 100" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= word1.length, word2.length <= 100" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= word1.length, word2.length <= 100" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= word1.length, word2.length <= 100" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= word1.length, word2.length <= 100" ] }, { "line": 43, "end_line": 43, "violates": [ "word1 and word2 consist of lowercase English letters." ] }, { "line": 58, "end_line": 58, "violates": [ "word1 and word2 consist of lowercase English letters." ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= word1.length, word2.length <= 100" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= word1.length, word2.length <= 100" ] }, { "line": 72, "end_line": 72, "violates": [ "word1 and word2 consist of lowercase English letters." ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= word1.length, word2.length <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= word1.length, word2.length <= 100" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= word1.length, word2.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use two pointers, one pointer for each string. Alternately choose the character from each pointer, and move the pointer upwards." ] }, { "question_id": 1769, "task_id": "minimum-number-of-operations-to-move-all-balls-to-each-box", "drop": [], "similar": [ "minimum-cost-to-move-chips-to-the-same-position", "minimum-moves-to-spread-stones-over-grid" ], "flags": [], "comparison": "exact", "parameter_names": [ "boxes" ], "tests": { "total": 85, "kept": 85, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If you want to move a ball from box i to box j, you'll need abs(i-j) moves.", "To move all balls to some box, you can move them one by one.", "For each box i, iterate on each ball in a box j, and add abs(i-j) to answers[i]." ] }, { "question_id": 1770, "task_id": "maximum-score-from-performing-multiplication-operations", "drop": [], "similar": [ "maximum-points-you-can-obtain-from-cards", "stone-game-vii", "maximum-spending-after-buying-items" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "multipliers" ], "tests": { "total": 118, "kept": 116, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 38, "end_line": 38, "violates": [ "-1000 <= nums[i], multipliers[i] <= 1000" ] }, { "line": 92, "end_line": 92, "violates": [ "-1000 <= nums[i], multipliers[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "At first glance, the solution seems to be greedy, but if you try to greedily take the largest value from the beginning or the end, this will not be optimal.", "You should try all scenarios but this will be costly.", "Memoizing the pre-visited states while trying all the possible scenarios will reduce the complexity, and hence dp is a perfect choice here." ] }, { "question_id": 1771, "task_id": "maximize-palindrome-length-from-subsequences", "drop": [], "similar": [ "longest-palindromic-subsequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "word1", "word2" ], "tests": { "total": 120, "kept": 118, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "word1 and word2 consist of lowercase English letters." ] }, { "line": 116, "end_line": 116, "violates": [ "word1 and word2 consist of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let's ignore the non-empty subsequence constraint. We can concatenate the two strings and find the largest palindromic subsequence with dynamic programming.", "Iterate through every pair of characters word1[i] and word2[j], and see if some palindrome begins with word1[i] and ends with word2[j]. This ensures that the subsequences are non-empty." ] }, { "question_id": 1772, "task_id": "sort-features-by-popularity", "drop": [ "premium" ] }, { "question_id": 1773, "task_id": "count-items-matching-a-rule", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "items", "ruleKey", "ruleValue" ], "tests": { "total": 108, "kept": 67, "dropped": { "constraint_violation": 41 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= typei.length, colori.length, namei.length, ruleValue.length <= 10" ] } ], "unchecked_constraints": [ "ruleKey is equal to either \"type\", \"color\", or \"name\".", "All strings consist only of lowercase letters." ], "public_tests": 2, "hints": [ "Iterate on each item, and check if each one matches the rule according to the statement." ] }, { "question_id": 1774, "task_id": "closest-dessert-cost", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "baseCosts", "toppingCosts", "target" ], "tests": { "total": 99, "kept": 92, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= target <= 10**(4)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= target <= 10**(4)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= target <= 10**(4)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= target <= 10**(4)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= target <= 10**(4)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= target <= 10**(4)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= target <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "As the constraints are not large, you can brute force and enumerate all the possibilities." ] }, { "question_id": 1775, "task_id": "equal-sum-arrays-with-minimum-number-of-operations", "drop": [], "similar": [ "number-of-dice-rolls-with-target-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 138, "kept": 137, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 68, "end_line": 68, "violates": [ "1 <= nums1[i], nums2[i] <= 6" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let's note that we want to either decrease the sum of the array with a larger sum or increase the array's sum with the smaller sum.", "You can maintain the largest increase or decrease you can make in a binary search tree and each time get the maximum one." ] }, { "question_id": 1776, "task_id": "car-fleet-ii", "drop": [], "similar": [ "car-fleet", "count-collisions-on-a-road" ], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "cars" ], "tests": { "total": 95, "kept": 91, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "1 <= positioni, speedi <= 10**(6)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= positioni, speedi <= 10**(6)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= positioni, speedi <= 10**(6)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= positioni, speedi <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We can simply ignore the merging of any car fleet, simply assume they cross each other. Now the aim is to find the first car to the right, which intersects with the current car before any other.", "Assume we have already considered all cars to the right already, now the current car is to be considered. Let\u2019s ignore all cars with speeds higher than the current car since the current car cannot intersect with those ones. Now, all cars to the right having speed strictly less than current car are to be considered. Now, for two cars c1 and c2 with positions p1 and p2 (p1 < p2) and speed s1 and s2 (s1 > s2), if c1 and c2 intersect before the current car and c2, then c1 can never be the first car of intersection for any car to the left of current car including current car. So we can remove that car from our consideration.", "We can see that we can maintain candidate cars in this way using a stack, removing cars with speed greater than or equal to current car, and then removing cars which can never be first point of intersection. The first car after this process (if any) would be first point of intersection." ] }, { "question_id": 1779, "task_id": "find-nearest-point-that-has-the-same-x-or-y-coordinate", "drop": [], "similar": [ "k-closest-points-to-origin" ], "flags": [], "comparison": "exact", "parameter_names": [ "x", "y", "points" ], "tests": { "total": 121, "kept": 112, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 61, "end_line": 61, "violates": [ "1 <= x, y, ai, bi <= 10**(4)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= x, y, ai, bi <= 10**(4)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= x, y, ai, bi <= 10**(4)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= x, y, ai, bi <= 10**(4)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= x, y, ai, bi <= 10**(4)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= x, y, ai, bi <= 10**(4)" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= x, y, ai, bi <= 10**(4)" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= x, y, ai, bi <= 10**(4)" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= x, y, ai, bi <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Iterate through each point, and keep track of the current point with the smallest Manhattan distance from your current location." ] }, { "question_id": 1780, "task_id": "check-if-number-is-a-sum-of-powers-of-three", "drop": [], "similar": [ "power-of-three" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 110, "kept": 106, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "1 <= n <= 10**(7)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= n <= 10**(7)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= n <= 10**(7)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= n <= 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let's note that the maximum power of 3 you'll use in your soln is 3^16", "The number can not be represented as a sum of powers of 3 if it's ternary presentation has a 2 in it" ] }, { "question_id": 1781, "task_id": "sum-of-beauty-of-all-substrings", "drop": [], "similar": [ "substrings-that-begin-and-end-with-the-same-letter" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 103, "kept": 103, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= s.length <=**()500" ], "public_tests": 2, "hints": [ "Maintain a prefix sum for the frequencies of characters.", "You can iterate over all substring then iterate over the alphabet and find which character appears most and which appears least using the prefix sum array" ] }, { "question_id": 1782, "task_id": "count-pairs-of-nodes", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "queries" ], "tests": { "total": 50, "kept": 45, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "0 <= queries[j] < edges.length" ] }, { "line": 29, "end_line": 29, "violates": [ "ui != vi" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= queries[j] < edges.length" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= queries[j] < edges.length" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= queries[j] < edges.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We want to count pairs (x,y) such that degree[x] + degree[y] - occurrences(x,y) > k", "Think about iterating on x, and counting the number of valid y to pair with x.", "You can consider at first that the (- occurrences(x,y)) isn't there, or it is 0 at first for all y. Count the valid y this way.", "Then you can iterate on the neighbors of x, let that neighbor be y, and update occurrences(x,y).", "When you update occurrences(x,y), the left-hand side decreases. Once it reaches k, then y is not valid for x anymore, so you should decrease the answer by 1." ] }, { "question_id": 1784, "task_id": "check-if-binary-string-has-at-most-one-segment-of-ones", "drop": [], "similar": [ "longer-contiguous-segments-of-ones-than-zeros" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 113, "kept": 107, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= s.length <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= s.length <= 100" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= s.length <= 100" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= s.length <= 100" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= s.length <= 100" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [ "s[i]\u200b\u200b\u200b\u200b is either '0' or '1'.", "s[0] is '1'." ], "public_tests": 2, "hints": [ "It's guaranteed to have at least one segment", "The string size is small so you can count all segments of ones with no that have no adjacent ones." ] }, { "question_id": 1785, "task_id": "minimum-elements-to-add-to-form-a-given-sum", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "limit", "goal" ], "tests": { "total": 106, "kept": 61, "dropped": { "constraint_violation": 45 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 8, "end_line": 8, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 10, "end_line": 10, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 11, "end_line": 11, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 12, "end_line": 12, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 13, "end_line": 13, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 18, "end_line": 18, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 19, "end_line": 19, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 20, "end_line": 20, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 21, "end_line": 21, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 25, "end_line": 25, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 27, "end_line": 27, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 29, "end_line": 29, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 31, "end_line": 31, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 32, "end_line": 32, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 38, "end_line": 38, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 39, "end_line": 39, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 41, "end_line": 41, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 42, "end_line": 42, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 45, "end_line": 45, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 47, "end_line": 47, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 49, "end_line": 49, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 50, "end_line": 50, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 51, "end_line": 51, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 54, "end_line": 54, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 55, "end_line": 55, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 56, "end_line": 56, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 58, "end_line": 58, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 60, "end_line": 60, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 65, "end_line": 65, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 72, "end_line": 72, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 76, "end_line": 76, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 77, "end_line": 77, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 78, "end_line": 78, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 81, "end_line": 81, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 82, "end_line": 82, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 83, "end_line": 83, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 84, "end_line": 84, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 85, "end_line": 85, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 96, "end_line": 96, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 98, "end_line": 98, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 100, "end_line": 100, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 105, "end_line": 105, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 106, "end_line": 106, "violates": [ "-limit <= nums[i] <= limit" ] }, { "line": 107, "end_line": 107, "violates": [ "-limit <= nums[i] <= limit" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try thinking about the problem as if the array is empty. Then you only need to form goal using elements whose absolute value is <= limit.", "You can greedily set all of the elements except one to limit or -limit, so the number of elements you need is ceil(abs(goal)/ limit).", "You can \"normalize\" goal by offsetting it by the sum of the array. For example, if the goal is 5 and the sum is -3, then it's exactly the same as if the goal is 8 and the array is empty.", "The answer is ceil(abs(goal-sum)/limit) = (abs(goal-sum)+limit-1) / limit." ] }, { "question_id": 1786, "task_id": "number-of-restricted-paths-from-first-to-last-node", "drop": [], "similar": [ "all-ancestors-of-a-node-in-a-directed-acyclic-graph", "design-graph-with-shortest-path-calculator", "minimum-cost-of-a-path-with-special-roads" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 45, "kept": 44, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "ui != vi" ] } ], "unchecked_constraints": [ "There is at most one edge between any two nodes.", "There is at least one path between any two nodes." ], "public_tests": 2, "hints": [ "Run a Dijkstra from node numbered n to compute distance from the last node.", "Consider all edges [u, v] one by one and direct them such that distance of u to n > distance of v to n. If both u and v are at the same distance from n, discard this edge.", "Now this problem reduces to computing the number of paths from 1 to n in a DAG, a standard DP problem." ] }, { "question_id": 1787, "task_id": "make-the-xor-of-all-segments-equal-to-zero", "drop": [], "similar": [ "maximum-xor-score-subarray-queries" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "\u200b\u200b\u200b\u200b\u200b\u200b0 <= nums[i] < 2**(10)" ], "public_tests": 3, "hints": [ "Let's note that for the XOR of all segments with size K to be equal to zeros, nums[i] has to be equal to nums[i+k]", "Basically, we need to make the first K elements have XOR = 0 and then modify them." ], "similar_to_test": [ "3277 maximum-xor-score-subarray-queries" ] }, { "question_id": 1788, "task_id": "maximize-the-beauty-of-the-garden", "drop": [ "premium" ] }, { "question_id": 1790, "task_id": "check-if-one-string-swap-can-make-strings-equal", "drop": [], "similar": [ "buddy-strings", "make-number-of-distinct-characters-equal", "count-almost-equal-pairs-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "s2" ], "tests": { "total": 108, "kept": 103, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "s1.length == s2.length" ] }, { "line": 20, "end_line": 20, "violates": [ "s1.length == s2.length" ] }, { "line": 38, "end_line": 38, "violates": [ "s1.length == s2.length" ] }, { "line": 43, "end_line": 43, "violates": [ "s1.length == s2.length" ] }, { "line": 106, "end_line": 106, "violates": [ "s1.length == s2.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The answer is false if the number of nonequal positions in the strings is not equal to 0 or 2.", "Check that these positions have the same set of characters." ], "similar_to_test": [ "3265 count-almost-equal-pairs-i" ] }, { "question_id": 1791, "task_id": "find-center-of-star-graph", "drop": [], "similar": [ "maximum-star-sum-of-a-graph" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "edges" ], "tests": { "total": 58, "kept": 18, "dropped": { "constraint_violation": 40 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= ui, vi <= n", "ui != vi" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= ui, vi <= n", "ui != vi" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= ui, vi <= n" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= ui, vi <= n" ] } ], "unchecked_constraints": [ "The given edges represent a valid star graph." ], "public_tests": 2, "hints": [ "The center is the only node that has more than one edge.", "The center is also connected to all other nodes.", "Any two edges must have a common node, which is the center." ] }, { "question_id": 1792, "task_id": "maximum-average-pass-ratio", "drop": [], "similar": [], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "classes", "extraStudents" ], "tests": { "total": 101, "kept": 99, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 67, "end_line": 67, "violates": [ "1 <= extraStudents <= 10**(5)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= passi <= totali <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Pay attention to how much the pass ratio changes when you add a student to the class. If you keep adding students, what happens to the change in pass ratio? The more students you add to a class, the smaller the change in pass ratio becomes.", "Since the change in the pass ratio is always decreasing with the more students you add, then the very first student you add to each class is the one that makes the biggest change in the pass ratio.", "Because each class's pass ratio is weighted equally, it's always optimal to put the student in the class that makes the biggest change among all the other classes.", "Keep a max heap of the current class sizes and order them by the change in pass ratio. For each extra student, take the top of the heap, update the class size, and put it back in the heap." ] }, { "question_id": 1793, "task_id": "maximum-score-of-a-good-subarray", "drop": [], "similar": [ "largest-rectangle-in-histogram" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 98, "kept": 98, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try thinking about the prefix before index k and the suffix after index k as two separate arrays.", "Using two pointers or binary search, we can find the maximum prefix of each array where the numbers are less than or equal to a certain value" ] }, { "question_id": 1794, "task_id": "count-pairs-of-equal-substrings-with-minimum-difference", "drop": [ "premium" ] }, { "question_id": 1796, "task_id": "second-largest-digit-in-a-string", "drop": [], "similar": [ "remove-digit-from-number-to-maximize-result" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 131, "kept": 129, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "s consists of only lowercase English letters and digits." ] }, { "line": 15, "end_line": 15, "violates": [ "s consists of only lowercase English letters and digits." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "First of all, get the distinct characters since we are only interested in those", "Let's note that there might not be any digits." ] }, { "question_id": 1798, "task_id": "maximum-number-of-consecutive-values-you-can-make", "drop": [], "similar": [ "patching-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "coins" ], "tests": { "total": 98, "kept": 91, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= coins[i] <= 4 * 10**(4)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= coins[i] <= 4 * 10**(4)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= coins[i] <= 4 * 10**(4)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= coins[i] <= 4 * 10**(4)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= coins[i] <= 4 * 10**(4)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= coins[i] <= 4 * 10**(4)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= coins[i] <= 4 * 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If you can make the first x values and you have a value v, then you can make all the values \u2264 v + x", "Sort the array of coins. You can always make the value 0 so you can start with x = 0.", "Process the values starting from the smallest and stop when there is a value that cannot be achieved with the current x." ] }, { "question_id": 1800, "task_id": "maximum-ascending-subarray-sum", "drop": [], "similar": [ "find-good-days-to-rob-the-bank", "maximum-number-of-books-you-can-take", "count-strictly-increasing-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 128, "kept": 122, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "It is fast enough to check all possible subarrays", "The end of each ascending subarray will be the start of the next" ] }, { "question_id": 1801, "task_id": "number-of-orders-in-the-backlog", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "orders" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Store the backlog buy and sell orders in two heaps, the buy orders in a max heap by price and the sell orders in a min heap by price.", "Store the orders in batches and update the fields according to new incoming orders. Each batch should only take 1 \"slot\" in the heap." ] }, { "question_id": 1802, "task_id": "maximum-value-at-a-given-index-in-a-bounded-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "index", "maxSum" ], "tests": { "total": 92, "kept": 72, "dropped": { "constraint_violation": 20 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= n <= maxSum <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What if the problem was instead determining if you could generate a valid array with nums[index] == target?", "To generate the array, set nums[index] to target, nums[index-i] to target-i, and nums[index+i] to target-i. Then, this will give the minimum possible sum, so check if the sum is less than or equal to maxSum.", "n is too large to actually generate the array, so you can use the formula 1 + 2 + ... + n = n * (n+1) / 2 to quickly find the sum of nums[0...index] and nums[index...n-1].", "Binary search for the target. If it is possible, then move the lower bound up. Otherwise, move the upper bound down." ] }, { "question_id": 1803, "task_id": "count-pairs-with-xor-in-a-range", "drop": [], "similar": [ "count-paths-with-the-given-xor-value" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "low", "high" ], "tests": { "total": 100, "kept": 72, "dropped": { "constraint_violation": 28 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= nums[i] <= 2 * 10**(4)", "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= nums[i] <= 2 * 10**(4)", "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i] <= 2 * 10**(4)", "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 2 * 10**(4)", "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 2 * 10**(4)", "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 2 * 10**(4)", "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 2 * 10**(4)", "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 2 * 10**(4)", "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 2 * 10**(4)", "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 2 * 10**(4)", "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 2 * 10**(4)", "1 <= low <= high <= 2 * 10**(4)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 2 * 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let's note that we can count all pairs with XOR \u2264 K, so the answer would be to subtract the number of pairs withs XOR < low from the number of pairs with XOR \u2264 high.", "For each value, find out the number of values when you XOR it with the result is \u2264 K using a trie." ], "similar_to_test": [ "3393 count-paths-with-the-given-xor-value" ] }, { "question_id": 1805, "task_id": "number-of-different-integers-in-a-string", "drop": [], "similar": [ "longest-subarray-with-maximum-bitwise-and" ], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 124, "kept": 124, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try to split the string so that each integer is in a different string.", "Try to remove each integer's leading zeroes and compare the strings to find how many of them are unique." ] }, { "question_id": 1806, "task_id": "minimum-number-of-operations-to-reinitialize-a-permutation", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 38, "kept": 37, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "2 <= n <= 1000" ] } ], "unchecked_constraints": [ "n\u200b\u200b\u200b\u200b\u200b\u200b is even." ], "public_tests": 3, "hints": [ "It is safe to assume the number of operations isn't more than n", "The number is small enough to apply a brute force solution." ] }, { "question_id": 1807, "task_id": "evaluate-the-bracket-pairs-of-a-string", "drop": [], "similar": [ "apply-substitutions" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "knowledge" ], "tests": { "total": 113, "kept": 56, "dropped": { "constraint_violation": 57 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 6, "end_line": 6, "violates": [ "1 <= s.length <= 10**(5)" ] }, { "line": 11, "end_line": 11, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 14, "end_line": 14, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 21, "end_line": 21, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 22, "end_line": 22, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 23, "end_line": 23, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 25, "end_line": 25, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 26, "end_line": 26, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 27, "end_line": 27, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 28, "end_line": 28, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 29, "end_line": 29, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= keyi.length, valuei.length <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= keyi.length, valuei.length <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 45, "end_line": 45, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= keyi.length, valuei.length <= 10", "keyi and valuei consist of lowercase English letters." ] }, { "line": 47, "end_line": 47, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 49, "end_line": 49, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 50, "end_line": 50, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 51, "end_line": 51, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= keyi.length, valuei.length <= 10", "keyi and valuei consist of lowercase English letters." ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= keyi.length, valuei.length <= 10", "keyi and valuei consist of lowercase English letters." ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= keyi.length, valuei.length <= 10" ] }, { "line": 57, "end_line": 57, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 58, "end_line": 58, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'." ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= keyi.length, valuei.length <= 10", "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 60, "end_line": 60, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 62, "end_line": 62, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 63, "end_line": 63, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 64, "end_line": 64, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 67, "end_line": 67, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 68, "end_line": 68, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 72, "end_line": 72, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 73, "end_line": 73, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 75, "end_line": 75, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 76, "end_line": 76, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 77, "end_line": 77, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 78, "end_line": 78, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 79, "end_line": 79, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 80, "end_line": 80, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 82, "end_line": 82, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 83, "end_line": 83, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 86, "end_line": 86, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= keyi.length, valuei.length <= 10", "keyi and valuei consist of lowercase English letters." ] }, { "line": 92, "end_line": 92, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 93, "end_line": 93, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 94, "end_line": 94, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 97, "end_line": 97, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 99, "end_line": 99, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 101, "end_line": 101, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 102, "end_line": 102, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 103, "end_line": 103, "violates": [ "keyi and valuei consist of lowercase English letters." ] }, { "line": 107, "end_line": 107, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= keyi.length, valuei.length <= 10", "keyi and valuei consist of lowercase English letters." ] }, { "line": 112, "end_line": 112, "violates": [ "s consists of lowercase English letters and round brackets '(' and ')'.", "keyi and valuei consist of lowercase English letters." ] } ], "unchecked_constraints": [ "Every open bracket '(' in s will have a corresponding close bracket ')'.", "The key in each bracket pair of s will be non-empty.", "There will not be any nested bracket pairs in s.", "Each keyi in knowledge is unique." ], "public_tests": 3, "hints": [ "Process pairs from right to left to handle repeats", "Keep track of the current enclosed string using another string" ], "similar_to_test": [ "3481 apply-substitutions" ] }, { "question_id": 1808, "task_id": "maximize-number-of-nice-divisors", "drop": [ "too_few_tests" ], "similar": [ "integer-break" ], "flags": [], "comparison": "exact", "parameter_names": [ "primeFactors" ], "tests": { "total": 3, "kept": 3, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 1812, "task_id": "determine-color-of-a-chessboard-square", "drop": [], "similar": [ "check-if-two-chessboard-squares-have-the-same-color" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "coordinates" ], "tests": { "total": 74, "kept": 64, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "'a' <= coordinates[0] <= 'h'" ] }, { "line": 33, "end_line": 33, "violates": [ "'a' <= coordinates[0] <= 'h'" ] }, { "line": 38, "end_line": 38, "violates": [ "'a' <= coordinates[0] <= 'h'" ] }, { "line": 45, "end_line": 45, "violates": [ "'a' <= coordinates[0] <= 'h'" ] }, { "line": 51, "end_line": 51, "violates": [ "'a' <= coordinates[0] <= 'h'" ] }, { "line": 65, "end_line": 65, "violates": [ "'a' <= coordinates[0] <= 'h'" ] }, { "line": 66, "end_line": 66, "violates": [ "'a' <= coordinates[0] <= 'h'", "'1' <= coordinates[1] <= '8'" ] }, { "line": 68, "end_line": 68, "violates": [ "'a' <= coordinates[0] <= 'h'" ] }, { "line": 69, "end_line": 69, "violates": [ "'a' <= coordinates[0] <= 'h'" ] }, { "line": 71, "end_line": 71, "violates": [ "'a' <= coordinates[0] <= 'h'" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Convert the coordinates to (x, y) - that is, \"a1\" is (1, 1), \"d7\" is (4, 7).", "Try add the numbers together and look for a pattern." ], "similar_to_test": [ "3274 check-if-two-chessboard-squares-have-the-same-color" ] }, { "question_id": 1813, "task_id": "sentence-similarity-iii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "sentence1", "sentence2" ], "tests": { "total": 197, "kept": 195, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 139, "end_line": 139, "violates": [ "sentence1 and sentence2 consist of lowercase and uppercase English letters and spaces." ] }, { "line": 175, "end_line": 175, "violates": [ "sentence1 and sentence2 consist of lowercase and uppercase English letters and spaces." ] } ], "unchecked_constraints": [ "The words in sentence1 and sentence2 are separated by a single space." ], "public_tests": 3, "hints": [ "One way to look at it is to find one sentence as a concatenation of a prefix and suffix from the other sentence.", "Get the longest common prefix between them and the longest common suffix." ] }, { "question_id": 1814, "task_id": "count-nice-pairs-in-an-array", "drop": [], "similar": [ "number-of-pairs-of-interchangeable-rectangles", "count-number-of-bad-pairs", "number-of-pairs-satisfying-inequality" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 107, "kept": 100, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 108, "end_line": 108, "violates": [ "0 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The condition can be rearranged to (nums[i] - rev(nums[i])) == (nums[j] - rev(nums[j])).", "Transform each nums[i] into (nums[i] - rev(nums[i])). Then, count the number of (i, j) pairs that have equal values.", "Keep a map storing the frequencies of values that you have seen so far. For each i, check if nums[i] is in the map. If it is, then add that count to the overall count. Then, increment the frequency of nums[i]." ] }, { "question_id": 1815, "task_id": "maximum-number-of-groups-getting-fresh-donuts", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "batchSize", "groups" ], "tests": { "total": 125, "kept": 124, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "1 <= groups[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The maximum number of happy groups is the maximum number of partitions you can split the groups into such that the sum of group sizes in each partition is 0 mod batchSize. At most one partition is allowed to have a different remainder (the first group will get fresh donuts anyway).", "Suppose you have an array freq of length k where freq[i] = number of groups of size i mod batchSize. How can you utilize this in a dp solution?", "Make a DP state dp[freq][r] that represents \"the maximum number of partitions you can form given the current freq and current remainder r\". You can hash the freq array to store it more easily in the dp table.", "For each i from 0 to batchSize-1, the next DP state is dp[freq`][(r+i)%batchSize] where freq` is freq but with freq[i] decremented by 1. Take the largest of all of the next states and store it in ans. If r == 0, then return ans+1 (because you can form a new partition), otherwise return ans (continuing the current partition)." ] }, { "question_id": 1816, "task_id": "truncate-sentence", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 94, "kept": 90, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "s consist of only lowercase and uppercase English letters and spaces." ] }, { "line": 21, "end_line": 21, "violates": [ "s consist of only lowercase and uppercase English letters and spaces." ] }, { "line": 31, "end_line": 31, "violates": [ "s consist of only lowercase and uppercase English letters and spaces." ] }, { "line": 32, "end_line": 32, "violates": [ "s consist of only lowercase and uppercase English letters and spaces." ] } ], "unchecked_constraints": [ "k is in the range [1, the number of words in s].", "The words in s are separated by a single space.", "There are no leading or trailing spaces." ], "public_tests": 3, "hints": [ "It's easier to solve this problem on an array of strings so parse the string to an array of words", "After return the first k words as a sentence" ] }, { "question_id": 1817, "task_id": "finding-the-users-active-minutes", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "logs", "k" ], "tests": { "total": 108, "kept": 108, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "k is in the range [The maximum UAM for a user, 10**(5)]." ], "public_tests": 2, "hints": [ "Try to find the number of different minutes when action happened for each user.", "For each user increase the value of the answer array index which matches the UAM for this user." ] }, { "question_id": 1818, "task_id": "minimum-absolute-sum-difference", "drop": [], "similar": [ "minimum-sum-of-squared-difference", "minimize-the-maximum-adjacent-element-difference" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 87, "kept": 84, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 50, "end_line": 50, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Go through each element and test the optimal replacements.", "There are only 2 possible replacements for each element (higher and lower) that are optimal." ] }, { "question_id": 1819, "task_id": "number-of-different-subsequences-gcds", "drop": [], "similar": [ "find-greatest-common-divisor-of-array" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 101, "kept": 98, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= nums[i] <= 2 * 10**(5)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 2 * 10**(5)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 2 * 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Think of how to check if a number x is a gcd of a subsequence.", "If there is such subsequence, then all of it will be divisible by x. Moreover, if you divide each number in the subsequence by x , then the gcd of the resulting numbers will be 1.", "Adding a number to a subsequence cannot increase its gcd. So, if there is a valid subsequence for x , then the subsequence that contains all multiples of x is a valid one too.", "Iterate on all possiblex from 1 to 10^5, and check if there is a valid subsequence for x." ] }, { "question_id": 1820, "task_id": "maximum-number-of-accepted-invitations", "drop": [ "premium" ] }, { "question_id": 1822, "task_id": "sign-of-the-product-of-an-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 96, "kept": 87, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 29, "end_line": 29, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 41, "end_line": 41, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 42, "end_line": 42, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 45, "end_line": 45, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 83, "end_line": 83, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 97, "end_line": 97, "violates": [ "-100 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If there is a 0 in the array the answer is 0", "To avoid overflow make all the negative numbers -1 and all positive numbers 1 and calculate the prod" ] }, { "question_id": 1823, "task_id": "find-the-winner-of-the-circular-game", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 83, "kept": 83, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simulate the process.", "Maintain in a circular list the people who are still in the circle and the current person you are standing at.", "In each turn, count k people and remove the last person from the list." ] }, { "question_id": 1824, "task_id": "minimum-sideway-jumps", "drop": [], "similar": [ "frog-jump" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "obstacles" ], "tests": { "total": 132, "kept": 121, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 57, "end_line": 57, "violates": [ "obstacles[0] == obstacles[n] == 0" ] }, { "line": 62, "end_line": 62, "violates": [ "obstacles[0] == obstacles[n] == 0" ] }, { "line": 64, "end_line": 64, "violates": [ "obstacles[0] == obstacles[n] == 0" ] }, { "line": 71, "end_line": 71, "violates": [ "obstacles[0] == obstacles[n] == 0" ] }, { "line": 72, "end_line": 72, "violates": [ "obstacles[0] == obstacles[n] == 0" ] }, { "line": 74, "end_line": 74, "violates": [ "obstacles[0] == obstacles[n] == 0" ] }, { "line": 78, "end_line": 78, "violates": [ "obstacles[0] == obstacles[n] == 0" ] }, { "line": 99, "end_line": 99, "violates": [ "obstacles[0] == obstacles[n] == 0" ] }, { "line": 108, "end_line": 108, "violates": [ "obstacles[0] == obstacles[n] == 0" ] }, { "line": 113, "end_line": 113, "violates": [ "obstacles[0] == obstacles[n] == 0" ] }, { "line": 133, "end_line": 133, "violates": [ "obstacles[0] == obstacles[n] == 0" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "At a given point, there are only 3 possible states for where the frog can be.", "Check all the ways to move from one point to the next and update the minimum side jumps for each lane." ] }, { "question_id": 1826, "task_id": "faulty-sensor", "drop": [ "premium" ] }, { "question_id": 1827, "task_id": "minimum-operations-to-make-the-array-increasing", "drop": [], "similar": [ "minimum-increment-to-make-array-unique", "make-array-non-decreasing-or-non-increasing", "maximum-product-after-k-increments", "minimum-replacements-to-sort-the-array", "minimum-operations-to-make-columns-strictly-increasing" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 118, "kept": 113, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "nums[i+1] must be at least equal to nums[i] + 1.", "Think greedily. You don't have to increase nums[i+1] beyond nums[i]+1.", "Iterate on i and set nums[i] = max(nums[i-1]+1, nums[i]) ." ], "similar_to_test": [ "3402 minimum-operations-to-make-columns-strictly-increasing" ] }, { "question_id": 1828, "task_id": "queries-on-number-of-points-inside-a-circle", "drop": [], "similar": [ "count-lattice-points-inside-a-circle", "count-number-of-rectangles-containing-each-point", "check-if-the-rectangle-corner-is-reachable" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "points", "queries" ], "tests": { "total": 51, "kept": 51, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= x\u200b\u200b\u200b\u200b\u200b\u200bi, y\u200b\u200b\u200b\u200b\u200b\u200bi <= 500", "0 <= xj, yj <= 500", "1 <= rj <= 500", "All coordinates are integers." ], "public_tests": 2, "hints": [ "For a point to be inside a circle, the euclidean distance between it and the circle's center needs to be less than or equal to the radius.", "Brute force for each circle and iterate overall points and find those inside it." ] }, { "question_id": 1829, "task_id": "maximum-xor-for-each-query", "drop": [], "similar": [ "count-the-number-of-beautiful-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "maximumBit" ], "tests": { "total": 81, "kept": 78, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "0 <= nums[i] < 2**(maximumBit)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= maximumBit <= 20" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= nums[i] < 2**(maximumBit)" ] } ], "unchecked_constraints": [ "nums\u200b\u200b\u200b is sorted in ascending order." ], "public_tests": 3, "hints": [ "Note that the maximum possible XOR result is always 2^(maximumBit) - 1", "So the answer for a prefix is the XOR of that prefix XORed with 2^(maximumBit)-1" ] }, { "question_id": 1832, "task_id": "check-if-the-sentence-is-pangram", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "sentence" ], "tests": { "total": 98, "kept": 97, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "sentence consists of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate over the string and mark each character as found (using a boolean array, bitmask, or any other similar way).", "Check if the number of found characters equals the alphabet length." ] }, { "question_id": 1833, "task_id": "maximum-ice-cream-bars", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "costs", "coins" ], "tests": { "total": 75, "kept": 73, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "1 <= costs[i] <= 10**(5)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= costs[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "It is always optimal to buy the least expensive ice cream bar first.", "Sort the prices so that the cheapest ice cream bar comes first." ] }, { "question_id": 1834, "task_id": "single-threaded-cpu", "drop": [], "similar": [ "parallel-courses-iii", "minimum-time-to-complete-all-tasks" ], "flags": [], "comparison": "exact", "parameter_names": [ "tasks" ], "tests": { "total": 109, "kept": 107, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 50, "end_line": 50, "violates": [ "1 <= enqueueTimei, processingTimei <= 10**(9)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= enqueueTimei, processingTimei <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "To simulate the problem we first need to note that if at any point in time there are no enqueued tasks we need to wait to the smallest enqueue time of a non-processed element", "We need a data structure like a min-heap to support choosing the task with the smallest processing time from all the enqueued tasks" ] }, { "question_id": 1835, "task_id": "find-xor-sum-of-all-pairs-bitwise-and", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr1", "arr2" ], "tests": { "total": 103, "kept": 95, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "0 <= arr1[i], arr2[j] <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= arr1[i], arr2[j] <= 10**(9)" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= arr1[i], arr2[j] <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= arr1[i], arr2[j] <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= arr1[i], arr2[j] <= 10**(9)" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= arr1[i], arr2[j] <= 10**(9)" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= arr1[i], arr2[j] <= 10**(9)" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= arr1[i], arr2[j] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Think about (a&b) ^ (a&c). Can you simplify this expression?", "It is equal to a&(b^c). Then, (arr1[i]&arr2[0])^(arr1[i]&arr2[1]).. = arr1[i]&(arr2[0]^arr2[1]^arr[2]...).", "Let arr2XorSum = (arr2[0]^arr2[1]^arr2[2]...), arr1XorSum = (arr1[0]^arr1[1]^arr1[2]...) so the final answer is (arr2XorSum&arr1[0]) ^ (arr2XorSum&arr1[1]) ^ (arr2XorSum&arr1[2]) ^ ... = arr2XorSum & arr1XorSum." ] }, { "question_id": 1836, "task_id": "remove-duplicates-from-an-unsorted-linked-list", "drop": [ "premium" ] }, { "question_id": 1837, "task_id": "sum-of-digits-in-base-k", "drop": [], "similar": [ "count-symmetric-integers" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 87, "kept": 87, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Convert the given number into base k." ] }, { "question_id": 1838, "task_id": "frequency-of-the-most-frequent-element", "drop": [], "similar": [ "find-all-lonely-numbers-in-the-array", "longest-nice-subarray", "apply-operations-to-maximize-frequency-score", "maximum-frequency-of-an-element-after-performing-operations-i", "maximum-frequency-of-an-element-after-performing-operations-ii", "maximum-difference-between-even-and-odd-frequency-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 99, "kept": 87, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= k <= 10**(5)", "1 <= k <= 10**(5)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= k <= 10**(5)", "1 <= k <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Note that you can try all values in a brute force manner and find the maximum frequency of that value.", "To find the maximum frequency of a value consider the biggest elements smaller than or equal to this value" ], "similar_to_test": [ "3346 maximum-frequency-of-an-element-after-performing-operations-i", "3347 maximum-frequency-of-an-element-after-performing-operations-ii", "3445 maximum-difference-between-even-and-odd-frequency-ii" ] }, { "question_id": 1839, "task_id": "longest-substring-of-all-vowels-in-order", "drop": [], "similar": [ "count-vowel-substrings-of-a-string", "longest-nice-subarray", "count-of-substrings-containing-every-vowel-and-k-consonants-ii", "count-of-substrings-containing-every-vowel-and-k-consonants-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 20, "kept": 20, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Start from each 'a' and find the longest beautiful substring starting at that index.", "Based on the current character decide if you should include the next character in the beautiful substring." ], "similar_to_test": [ "3305 count-of-substrings-containing-every-vowel-and-k-consonants-i", "3306 count-of-substrings-containing-every-vowel-and-k-consonants-ii" ] }, { "question_id": 1840, "task_id": "maximum-building-height", "drop": [], "similar": [ "find-maximum-value-in-a-constrained-sequence" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "restrictions" ], "tests": { "total": 87, "kept": 87, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "idi is unique." ], "public_tests": 3, "hints": [ "Is it possible to find the max height if given the height range of a particular building?", "You can find the height range of a restricted building by doing 2 passes from the left and right." ] }, { "question_id": 1842, "task_id": "next-palindrome-using-same-digits", "drop": [ "premium" ] }, { "question_id": 1844, "task_id": "replace-all-digits-with-characters", "drop": [], "similar": [ "shifting-letters" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 115, "kept": 114, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 98, "end_line": 98, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [ "shift(s[i-1], s[i]) <= 'z' for all odd indices i." ], "public_tests": 2, "hints": [ "We just need to replace every even positioned character with the character s[i] positions ahead of the character preceding it", "Get the position of the preceeding character in alphabet then advance it s[i] positions and get the character at that position" ] }, { "question_id": 1846, "task_id": "maximum-element-after-decreasing-and-rearranging", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 135, "kept": 134, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 92, "end_line": 92, "violates": [ "1 <= arr[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the Array.", "Decrement each element to the largest integer that satisfies the conditions." ] }, { "question_id": 1847, "task_id": "closest-room", "drop": [], "similar": [ "most-beautiful-item-for-each-query", "minimum-time-to-kill-all-monsters" ], "flags": [], "comparison": "exact", "parameter_names": [ "rooms", "queries" ], "tests": { "total": 213, "kept": 213, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= roomIdi, preferredj <= 10**(7)", "1 <= sizei, minSizej <= 10**(7)" ], "public_tests": 2, "hints": [ "Is there a way to sort the queries so it's easier to search the closest room larger than the size?", "Use binary search to speed up the search time." ] }, { "question_id": 1848, "task_id": "minimum-distance-to-the-target-element", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target", "start" ], "tests": { "total": 117, "kept": 103, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [ "target is in nums." ], "public_tests": 3, "hints": [ "Loop in both directions until you find the target element.", "For each index i such that nums[i] == target calculate abs(i - start)." ] }, { "question_id": 1849, "task_id": "splitting-a-string-into-descending-consecutive-values", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 135, "kept": 54, "dropped": { "constraint_violation": 81 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= s.length <= 20" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= s.length <= 20" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= s.length <= 20" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= s.length <= 20" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= s.length <= 20" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= s.length <= 20" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= s.length <= 20" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= s.length <= 20" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= s.length <= 20" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= s.length <= 20" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= s.length <= 20" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= s.length <= 20" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= s.length <= 20" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= s.length <= 20" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= s.length <= 20" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= s.length <= 20" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= s.length <= 20" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= s.length <= 20" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= s.length <= 20" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= s.length <= 20" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= s.length <= 20" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= s.length <= 20" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= s.length <= 20" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= s.length <= 20" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= s.length <= 20" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= s.length <= 20" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= s.length <= 20" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= s.length <= 20" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= s.length <= 20" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= s.length <= 20" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= s.length <= 20" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= s.length <= 20" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= s.length <= 20" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= s.length <= 20" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= s.length <= 20" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= s.length <= 20" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= s.length <= 20" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= s.length <= 20" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= s.length <= 20" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= s.length <= 20" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= s.length <= 20" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= s.length <= 20" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= s.length <= 20" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= s.length <= 20" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= s.length <= 20" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= s.length <= 20" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= s.length <= 20" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= s.length <= 20" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= s.length <= 20" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= s.length <= 20" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= s.length <= 20" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= s.length <= 20" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= s.length <= 20" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= s.length <= 20" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= s.length <= 20" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= s.length <= 20" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= s.length <= 20" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= s.length <= 20" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= s.length <= 20" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= s.length <= 20" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= s.length <= 20" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= s.length <= 20" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= s.length <= 20" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= s.length <= 20" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= s.length <= 20" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= s.length <= 20" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= s.length <= 20" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= s.length <= 20" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= s.length <= 20" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= s.length <= 20" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= s.length <= 20" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= s.length <= 20" ] }, { "line": 124, "end_line": 124, "violates": [ "1 <= s.length <= 20" ] }, { "line": 125, "end_line": 125, "violates": [ "1 <= s.length <= 20" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= s.length <= 20" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= s.length <= 20" ] }, { "line": 130, "end_line": 130, "violates": [ "1 <= s.length <= 20" ] }, { "line": 131, "end_line": 131, "violates": [ "1 <= s.length <= 20" ] }, { "line": 133, "end_line": 133, "violates": [ "1 <= s.length <= 20" ] }, { "line": 134, "end_line": 134, "violates": [ "1 <= s.length <= 20" ] }, { "line": 135, "end_line": 135, "violates": [ "1 <= s.length <= 20" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "One solution is to try all possible splits using backtrack", "Look out for trailing zeros in string" ] }, { "question_id": 1850, "task_id": "minimum-adjacent-swaps-to-reach-the-kth-smallest-number", "drop": [], "similar": [ "next-permutation" ], "flags": [], "comparison": "exact", "parameter_names": [ "num", "k" ], "tests": { "total": 105, "kept": 105, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the next permutation of the given string k times.", "Try to move each element to its correct position and calculate the number of steps." ] }, { "question_id": 1851, "task_id": "minimum-interval-to-include-each-query", "drop": [], "similar": [ "number-of-flowers-in-full-bloom" ], "flags": [], "comparison": "exact", "parameter_names": [ "intervals", "queries" ], "tests": { "total": 104, "kept": 103, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 50, "end_line": 50, "violates": [ "1 <= queries[j] <= 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Is there a way to order the intervals and queries such that it takes less time to query?", "Is there a way to add and remove intervals by going from the smallest query to the largest query to find the minimum size?" ] }, { "question_id": 1852, "task_id": "distinct-numbers-in-each-subarray", "drop": [ "premium" ] }, { "question_id": 1854, "task_id": "maximum-population-year", "drop": [], "similar": [ "shifting-letters-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "logs" ], "tests": { "total": 91, "kept": 90, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "1950 <= birthi < deathi <= 2050" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each year find the number of people whose birth_i \u2264 year and death_i > year.", "Find the maximum value between all years." ] }, { "question_id": 1855, "task_id": "maximum-distance-between-a-pair-of-values", "drop": [], "similar": [ "two-furthest-houses-with-different-colors" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 75, "kept": 73, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= nums1[i], nums2[j] <= 10**(5)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums1[i], nums2[j] <= 10**(5)" ] } ], "unchecked_constraints": [ "Both nums1 and nums2 are non-increasing." ], "public_tests": 3, "hints": [ "Since both arrays are sorted in a non-increasing way, this means that for each value in the first array, we can find the farthest value larger than or equal to it using binary search.", "There is another solution using a two pointers approach. Since the first array is non-increasing, the farthest j such that nums2[j] \u2265 nums1[i] is at least as far as the farthest j such that nums2[j] \u2265 nums1[i-1]" ] }, { "question_id": 1856, "task_id": "maximum-subarray-min-product", "drop": [], "similar": [ "subarray-with-elements-greater-than-varying-threshold" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 101, "kept": 101, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Is there a way we can sort the elements to simplify the problem?", "Can we find the maximum min-product for every value in the array?" ] }, { "question_id": 1857, "task_id": "largest-color-value-in-a-directed-graph", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "colors", "edges" ], "tests": { "total": 84, "kept": 84, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= aj, bj < n" ], "public_tests": 2, "hints": [ "Use topological sort.", "let dp[u][c] := the maximum count of vertices with color c of any path starting from vertex u. (by JerryJin2905)" ] }, { "question_id": 1858, "task_id": "longest-word-with-all-prefixes", "drop": [ "premium" ] }, { "question_id": 1859, "task_id": "sorting-the-sentence", "drop": [], "similar": [ "check-if-numbers-are-ascending-in-a-sentence" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 70, "kept": 70, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of words in s is between 1 and 9.", "The words in s are separated by a single space.", "s contains no leading or trailing spaces." ], "public_tests": 2, "hints": [ "Divide the string into the words as an array of strings", "Sort the words by removing the last character from each word and sorting according to it" ] }, { "question_id": 1860, "task_id": "incremental-memory-leak", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "memory1", "memory2" ], "tests": { "total": 81, "kept": 78, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "0 <= memory1, memory2 <= 2**(31) - 1" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= memory1, memory2 <= 2**(31) - 1" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= memory1, memory2 <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What is the upper bound for the number of seconds?", "Simulate the process of allocating memory." ] }, { "question_id": 1861, "task_id": "rotating-the-box", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "boxGrid" ], "tests": { "total": 114, "kept": 113, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 42, "end_line": 42, "violates": [ "n == boxGrid[i].length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Rotate the box using the relation rotatedBox[i][j] = box[m - 1 - j][i].", "Start iterating from the bottom of the box and for each empty cell check if there is any stone above it with no obstacles between them." ] }, { "question_id": 1862, "task_id": "sum-of-floored-pairs", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 60, "kept": 55, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Find the frequency (number of occurrences) of all elements in the array.", "For each element, iterate through its multiples and multiply frequencies to find the answer." ] }, { "question_id": 1863, "task_id": "sum-of-all-subset-xor-totals", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 99, "kept": 38, "dropped": { "constraint_violation": 61 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums.length <= 12" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums.length <= 12" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums.length <= 12", "1 <= nums[i] <= 20" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 20" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= nums[i] <= 20", "1 <= nums[i] <= 20" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 20" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Is there a way to iterate through all the subsets of the array?", "Can we use recursion to efficiently iterate through all the subsets?" ] }, { "question_id": 1864, "task_id": "minimum-number-of-swaps-to-make-the-binary-string-alternating", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 243, "kept": 243, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think about all valid strings of length n.", "Try to count the mismatched positions with each valid string of length n." ] }, { "question_id": 1866, "task_id": "number-of-ways-to-rearrange-sticks-with-k-sticks-visible", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 57, "kept": 57, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Is there a way to build the solution from a base case?", "How many ways are there if we fix the position of one stick?" ] }, { "question_id": 1868, "task_id": "product-of-two-run-length-encoded-arrays", "drop": [ "premium" ] }, { "question_id": 1869, "task_id": "longer-contiguous-segments-of-ones-than-zeros", "drop": [], "similar": [ "max-consecutive-ones", "count-subarrays-with-more-ones-than-zeros", "check-if-binary-string-has-at-most-one-segment-of-ones" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 161, "kept": 161, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Check every possible segment of 0s and 1s.", "Is there a way to iterate through the string to keep track of the current character and its count?" ] }, { "question_id": 1870, "task_id": "minimum-speed-to-arrive-on-time", "drop": [], "similar": [ "maximum-candies-allocated-to-k-children", "minimum-skips-to-arrive-at-meeting-on-time", "minimum-time-to-complete-trips", "the-latest-time-to-catch-a-bus", "minimize-maximum-of-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "dist", "hour" ], "tests": { "total": 98, "kept": 95, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= hour <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= dist[i] <= 10**(5)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= dist[i] <= 10**(5)" ] } ], "unchecked_constraints": [ "There will be at most two digits after the decimal point in hour." ], "public_tests": 3, "hints": [ "Given the speed the trains are traveling at, can you find the total time it takes for you to arrive?", "Is there a cutoff where any speeds larger will always allow you to arrive on time?" ] }, { "question_id": 1871, "task_id": "jump-game-vii", "drop": [], "similar": [ "jump-game-ii", "jump-game", "jump-game-iii", "jump-game-iv", "jump-game-v", "jump-game-vi", "jump-game-vii", "jump-game-viii", "count-vowel-strings-in-ranges", "maximum-number-of-jumps-to-reach-the-last-index" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "minJump", "maxJump" ], "tests": { "total": 49, "kept": 41, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= minJump <= maxJump < s.length" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= minJump <= maxJump < s.length" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= minJump <= maxJump < s.length" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= minJump <= maxJump < s.length" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= minJump <= maxJump < s.length" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= minJump <= maxJump < s.length" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= minJump <= maxJump < s.length" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= minJump <= maxJump < s.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider for each reachable index i the interval [i + a, i + b].", "Use partial sums to mark the intervals as reachable." ] }, { "question_id": 1872, "task_id": "stone-game-viii", "drop": [], "similar": [ "stone-game", "stone-game-ii", "stone-game-iii", "stone-game-iv", "stone-game-v", "stone-game-vi", "stone-game-vii", "stone-game-viii", "stone-game-ix" ], "flags": [], "comparison": "exact", "parameter_names": [ "stones" ], "tests": { "total": 79, "kept": 75, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 54, "end_line": 54, "violates": [ "-10**(4) <= stones[i] <= 10**(4)" ] }, { "line": 59, "end_line": 59, "violates": [ "-10**(4) <= stones[i] <= 10**(4)" ] }, { "line": 65, "end_line": 65, "violates": [ "-10**(4) <= stones[i] <= 10**(4)" ] }, { "line": 73, "end_line": 73, "violates": [ "-10**(4) <= stones[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let's note that the only thing that matters is how many stones were removed so we can maintain dp[numberOfRemovedStones]", "dp[x] = max(sum of all elements up to y - dp[y]) for all y > x" ] }, { "question_id": 1874, "task_id": "minimize-product-sum-of-two-arrays", "drop": [ "premium" ] }, { "question_id": 1876, "task_id": "substrings-of-size-three-with-distinct-characters", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 96, "kept": 95, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 73, "end_line": 73, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [ "s\u200b\u200b\u200b\u200b\u200b\u200b consists of lowercase English letters." ], "public_tests": 2, "hints": [ "Try using a set to find out the number of distinct characters in a substring." ] }, { "question_id": 1877, "task_id": "minimize-maximum-pair-sum-in-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 97, "kept": 93, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "n is even." ] }, { "line": 40, "end_line": 40, "violates": [ "n is even." ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Would sorting help find the optimal order?", "Given a specific element, how would you minimize its specific pairwise sum?" ] }, { "question_id": 1878, "task_id": "get-biggest-three-rhombus-sums-in-a-grid", "drop": [], "similar": [ "count-fertile-pyramids-in-a-land" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 118, "kept": 112, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "You need to maintain only the biggest 3 distinct sums", "The limits are small enough for you to iterate over all rhombus sizes then iterate over all possible borders to get the sums" ] }, { "question_id": 1879, "task_id": "minimum-xor-sum-of-two-arrays", "drop": [], "similar": [ "fair-distribution-of-cookies", "choose-numbers-from-two-arrays-in-range", "maximum-and-sum-of-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 93, "kept": 79, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "0 <= nums1[i], nums2[i] <= 10**(7)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= n <= 14" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= n <= 14" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= n <= 14" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= n <= 14" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= n <= 14" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= n <= 14" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= n <= 14" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= n <= 14" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= n <= 14" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= n <= 14" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= nums1[i], nums2[i] <= 10**(7)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= n <= 14" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= n <= 14" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Since n <= 14, we can consider every subset of nums2.", "We can represent every subset of nums2 using bitmasks." ] }, { "question_id": 1880, "task_id": "check-if-word-equals-summation-of-two-words", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "firstWord", "secondWord", "targetWord" ], "tests": { "total": 73, "kept": 37, "dropped": { "constraint_violation": 36 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 24, "end_line": 24, "violates": [ "firstWord, secondWord, and targetWord consist of lowercase English letters from 'a' to 'j' inclusive." ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 44, "end_line": 44, "violates": [ "firstWord, secondWord, and targetWord consist of lowercase English letters from 'a' to 'j' inclusive." ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8", "firstWord, secondWord, and targetWord consist of lowercase English letters from 'a' to 'j' inclusive." ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= firstWord.length, secondWord.length, targetWord.length <= 8" ] }, { "line": 73, "end_line": 73, "violates": [ "firstWord, secondWord, and targetWord consist of lowercase English letters from 'a' to 'j' inclusive." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Convert each character of each word to its numerical value.", "Check if the numerical values satisfies the condition." ] }, { "question_id": 1881, "task_id": "maximum-value-after-insertion", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "x" ], "tests": { "total": 133, "kept": 124, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "1 <= x <= 9" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= x <= 9" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= x <= 9" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= x <= 9" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= x <= 9" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= x <= 9" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= x <= 9" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= x <= 9" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= x <= 9" ] } ], "unchecked_constraints": [ "The digits in n\u200b\u200b\u200b are in the range [1, 9].", "n is a valid representation of an integer.", "In the case of a negative n,\u200b\u200b\u200b\u200b\u200b\u200b it will begin with '-'." ], "public_tests": 2, "hints": [ "Note that if the number is negative it's the same as positive but you look for the minimum instead.", "In the case of maximum, if s[i] < x it's optimal that x is put before s[i].", "In the case of minimum, if s[i] > x it's optimal that x is put before s[i]." ] }, { "question_id": 1882, "task_id": "process-tasks-using-servers", "drop": [], "similar": [ "parallel-courses-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "servers", "tasks" ], "tests": { "total": 111, "kept": 110, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 112, "end_line": 112, "violates": [ "1 <= servers[i], tasks[j] <= 2 * 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "You can maintain a Heap of available Servers and a Heap of unavailable servers", "Note that the tasks will be processed in the input order so you just need to find the x-th server that will be available according to the rules" ] }, { "question_id": 1883, "task_id": "minimum-skips-to-arrive-at-meeting-on-time", "drop": [], "similar": [ "minimum-speed-to-arrive-on-time", "minimum-time-to-finish-the-race" ], "flags": [], "comparison": "exact", "parameter_names": [ "dist", "speed", "hoursBefore" ], "tests": { "total": 114, "kept": 114, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Is there something you can keep track of from one road to another?", "How would knowing the start time for each state help us solve the problem?" ] }, { "question_id": 1884, "task_id": "egg-drop-with-2-eggs-and-n-floors", "drop": [], "similar": [ "super-egg-drop" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 46, "kept": 46, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Is it really optimal to always drop the egg on the middle floor for each move?", "Can we create states based on the number of unbroken eggs and floors to build our solution?" ] }, { "question_id": 1885, "task_id": "count-pairs-in-two-arrays", "drop": [ "premium" ] }, { "question_id": 1886, "task_id": "determine-whether-matrix-can-be-obtained-by-rotation", "drop": [], "similar": [ "rotate-image" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat", "target" ], "tests": { "total": 79, "kept": 79, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "mat[i][j] and target[i][j] are either 0 or 1." ], "public_tests": 3, "hints": [ "What is the maximum number of rotations you have to check?", "Is there a formula you can use to rotate a matrix 90 degrees?" ] }, { "question_id": 1887, "task_id": "reduction-operations-to-make-the-array-elements-equal", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 99, "kept": 98, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= nums[i] <= 5 * 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the array.", "Try to reduce all elements with maximum value to the next maximum value in one operation." ] }, { "question_id": 1888, "task_id": "minimum-number-of-flips-to-make-the-binary-string-alternating", "drop": [], "similar": [ "minimum-operations-to-make-the-array-alternating" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 153, "kept": 153, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Note what actually matters is how many 0s and 1s are in odd and even positions", "For every cyclic shift we need to count how many 0s and 1s are at each parity and convert the minimum between them for each parity" ] }, { "question_id": 1889, "task_id": "minimum-space-wasted-from-packaging", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "packages", "boxes" ], "tests": { "total": 93, "kept": 84, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= boxes[j][k] <= 10**(5)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= boxes[j][k] <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= boxes[j][k] <= 10**(5)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= boxes[j][k] <= 10**(5)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= boxes[j][k] <= 10**(5)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= boxes[j][k] <= 10**(5)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= boxes[j][k] <= 10**(5)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= boxes[j][k] <= 10**(5)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= boxes[j][k] <= 10**(5)" ] } ], "unchecked_constraints": [ "The elements in boxes[j] are distinct.", "sum(boxes[j].length) <= 10**(5)" ], "public_tests": 3, "hints": [ "Given a fixed size box, is there a way to quickly query which packages (i.e., count and sizes) should end up in that box size?", "Do we have to order the boxes a certain way to allow us to answer the query quickly?" ] }, { "question_id": 1891, "task_id": "cutting-ribbons", "drop": [ "premium" ] }, { "question_id": 1893, "task_id": "check-if-all-the-integers-in-a-range-are-covered", "drop": [], "similar": [ "find-maximal-uncovered-ranges" ], "flags": [], "comparison": "exact", "parameter_names": [ "ranges", "left", "right" ], "tests": { "total": 105, "kept": 105, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate over every integer point in the range [left, right].", "For each of these points check if it is included in one of the ranges." ] }, { "question_id": 1894, "task_id": "find-the-student-that-will-replace-the-chalk", "drop": [], "similar": [ "pass-the-pillow" ], "flags": [], "comparison": "exact", "parameter_names": [ "chalk", "k" ], "tests": { "total": 92, "kept": 66, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= chalk[i] <= 10**(5)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= chalk[i] <= 10**(5)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= chalk[i] <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= chalk[i] <= 10**(5)", "1 <= k <= 10**(9)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= chalk[i] <= 10**(5)", "1 <= k <= 10**(9)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= chalk[i] <= 10**(5)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= chalk[i] <= 10**(5)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= chalk[i] <= 10**(5)", "1 <= k <= 10**(9)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= chalk[i] <= 10**(5)", "1 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Subtract the sum of chalk from k until k is less than the sum of chalk.", "Now iterate over the array. If chalk[i] is less than k, this is the answer. Otherwise, subtract chalk[i] from k and continue." ] }, { "question_id": 1895, "task_id": "largest-magic-square", "drop": [], "similar": [ "magic-squares-in-grid" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 80, "kept": 79, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 53, "end_line": 53, "violates": [ "1 <= grid[i][j] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Check all squares in the matrix and find the largest one." ] }, { "question_id": 1896, "task_id": "minimum-cost-to-change-the-final-value-of-expression", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "expression" ], "tests": { "total": 173, "kept": 173, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "expression only contains '1','0','&','|','(', and ')'", "All parentheses are properly matched.", "There will be no empty parentheses (i.e: \"()\" is not a substring of expression)." ], "public_tests": 3, "hints": [ "How many possible states are there for a given expression?", "Is there a data structure that we can use to solve the problem optimally?" ] }, { "question_id": 1897, "task_id": "redistribute-characters-to-make-all-strings-equal", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 89, "kept": 88, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 44, "end_line": 44, "violates": [ "words[i] consists of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Characters are independent\u2014only the frequency of characters matters.", "It is possible to distribute characters if all characters can be divided equally among all strings." ] }, { "question_id": 1898, "task_id": "maximum-number-of-removable-characters", "drop": [], "similar": [ "maximum-candies-allocated-to-k-children" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "p", "removable" ], "tests": { "total": 82, "kept": 65, "dropped": { "constraint_violation": 17 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 72, "end_line": 72, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= removable[i] < s.length" ] }, { "line": 83, "end_line": 83, "violates": [ "0 <= removable[i] < s.length" ] } ], "unchecked_constraints": [ "p is a subsequence of s.", "s and p both consist of lowercase English letters.", "The elements in removable are distinct.", "0 <= removable.length < s.length" ], "public_tests": 3, "hints": [ "First, we need to think about solving an easier problem, If we remove a set of indices from the string does P exist in S as a subsequence", "We can binary search the K and check by solving the above problem." ] }, { "question_id": 1899, "task_id": "merge-triplets-to-form-target-triplet", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "triplets", "target" ], "tests": { "total": 119, "kept": 119, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= ai, bi, ci, x, y, z <= 1000" ], "public_tests": 3, "hints": [ "Which triplets do you actually care about?", "What property of max can you use to solve the problem?" ] }, { "question_id": 1900, "task_id": "the-earliest-and-latest-rounds-where-players-compete", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "firstPlayer", "secondPlayer" ], "tests": { "total": 87, "kept": 87, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Brute force using bitmasks and simulate the rounds.", "Calculate each state one time and save its solution." ] }, { "question_id": 1901, "task_id": "find-a-peak-element-ii", "drop": [], "similar": [ "find-peak-element", "find-the-peaks" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat" ], "tests": { "total": 85, "kept": 85, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "No two adjacent cells are equal." ], "public_tests": 2, "hints": [ "Let's assume that the width of the array is bigger than the height, otherwise, we will split in another direction.", "Split the array into three parts: central column left side and right side.", "Go through the central column and two neighbor columns and look for maximum.", "If it's in the central column - this is our peak.", "If it's on the left side, run this algorithm on subarray left_side + central_column.", "If it's on the right side, run this algorithm on subarray right_side + central_column" ] }, { "question_id": 1902, "task_id": "depth-of-bst-given-insertion-order", "drop": [ "premium" ] }, { "question_id": 1903, "task_id": "largest-odd-number-in-string", "drop": [], "similar": [ "largest-3-same-digit-number-in-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 140, "kept": 140, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "In what order should you iterate through the digits?", "If an odd number exists, where must the number start from?" ] }, { "question_id": 1904, "task_id": "the-number-of-full-rounds-you-have-played", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "loginTime", "logoutTime" ], "tests": { "total": 168, "kept": 168, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "loginTime and logoutTime are in the format hh:mm.", "00 <= hh <= 23", "00 <= mm <= 59", "loginTime and logoutTime are not equal." ], "public_tests": 2, "hints": [ "Consider the day as 48 hours instead of 24.", "For each round check if you were playing." ] }, { "question_id": 1905, "task_id": "count-sub-islands", "drop": [], "similar": [ "number-of-islands", "number-of-distinct-islands", "find-all-groups-of-farmland" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid1", "grid2" ], "tests": { "total": 67, "kept": 67, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "grid1[i][j] and grid2[i][j] are either 0 or 1." ], "public_tests": 2, "hints": [ "Let's use floodfill to iterate over the islands of the second grid", "Let's note that if all the cells in an island in the second grid if they are represented by land in the first grid then they are connected hence making that island a sub-island" ] }, { "question_id": 1906, "task_id": "minimum-absolute-difference-queries", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 90, "kept": 74, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 7, "end_line": 7, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 10, "end_line": 10, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 72, "end_line": 72, "violates": [ "0 <= li < ri < nums.length" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= li < ri < nums.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How does the maximum value being 100 help us?", "How can we tell if a number exists in a given range?" ] }, { "question_id": 1908, "task_id": "game-of-nim", "drop": [ "premium" ] }, { "question_id": 1909, "task_id": "remove-one-element-to-make-the-array-strictly-increasing", "drop": [], "similar": [ "steps-to-make-array-non-decreasing", "find-the-maximum-factor-score-of-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 179, "kept": 178, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each index i in nums remove this index.", "If the array becomes sorted return true, otherwise revert to the original array and try different index." ], "similar_to_test": [ "3334 find-the-maximum-factor-score-of-array" ] }, { "question_id": 1910, "task_id": "remove-all-occurrences-of-a-substring", "drop": [], "similar": [ "maximum-deletions-on-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "part" ], "tests": { "total": 130, "kept": 130, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s\u200b\u200b\u200b\u200b\u200b\u200b and part consists of lowercase English letters." ], "public_tests": 2, "hints": [ "Note that a new occurrence of pattern can appear if you remove an old one, For example, s = \"ababcc\" and pattern = \"abc\".", "You can maintain a stack of characters and if the last character of the pattern size in the stack match the pattern remove them" ] }, { "question_id": 1911, "task_id": "maximum-alternating-subsequence-sum", "drop": [], "similar": [ "maximum-alternating-subarray-sum", "maximum-element-sum-of-a-complete-subset-of-indices", "maximum-product-of-subsequences-with-an-alternating-sum-equal-to-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 96, "kept": 92, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Is only tracking a single sum enough to solve the problem?", "How does tracking an odd sum and an even sum reduce the number of states?" ] }, { "question_id": 1913, "task_id": "maximum-product-difference-between-two-pairs", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 98, "kept": 95, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If you only had to find the maximum product of 2 numbers in an array, which 2 numbers should you choose?", "We only need to worry about 4 numbers in the array." ] }, { "question_id": 1914, "task_id": "cyclically-rotating-a-grid", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid", "k" ], "tests": { "total": 57, "kept": 53, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= k <= 10**(9)" ] } ], "unchecked_constraints": [ "Both m and n are even integers.", "1 <= grid[i][j] <=**()5000" ], "public_tests": 2, "hints": [ "First, you need to consider each layer separately as an array.", "Just cycle this array and then re-assign it." ] }, { "question_id": 1915, "task_id": "number-of-wonderful-substrings", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 77, "kept": 75, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "word consists of lowercase English letters from 'a' to 'j'." ] }, { "line": 63, "end_line": 63, "violates": [ "word consists of lowercase English letters from 'a' to 'j'." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each prefix of the string, check which characters are of even frequency and which are not and represent it by a bitmask.", "Find the other prefixes whose masks differs from the current prefix mask by at most one bit." ] }, { "question_id": 1916, "task_id": "count-ways-to-build-rooms-in-an-ant-colony", "drop": [], "similar": [ "count-anagrams", "count-the-number-of-good-subsequences" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "prevRoom" ], "tests": { "total": 89, "kept": 89, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= prevRoom[i] < n for all 1 <= i < n", "Every room is reachable from room 0 once all the rooms are built." ], "public_tests": 2, "hints": [ "Use dynamic programming.", "Let dp[i] be the number of ways to solve the problem for the subtree of node i.", "Imagine you are trying to fill an array with the order of traversal, dp[i] equals the multiplications of the number of ways to distribute the subtrees of the children of i on the array using combinatorics, multiplied bu their dp values." ] }, { "question_id": 1918, "task_id": "kth-smallest-subarray-sum", "drop": [ "premium" ] }, { "question_id": 1920, "task_id": "build-array-from-permutation", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 81, "kept": 81, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The elements in nums are distinct." ], "public_tests": 2, "hints": [ "Just apply what's said in the statement.", "Notice that you can't apply it on the same array directly since some elements will change after application" ] }, { "question_id": 1921, "task_id": "eliminate-maximum-number-of-monsters", "drop": [], "similar": [ "minimum-health-to-beat-game", "minimum-time-to-kill-all-monsters" ], "flags": [], "comparison": "exact", "parameter_names": [ "dist", "speed" ], "tests": { "total": 127, "kept": 127, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the amount of time it takes each monster to arrive.", "Find the order in which the monsters will arrive." ] }, { "question_id": 1922, "task_id": "count-good-numbers", "drop": [ "too_few_tests" ], "similar": [ "count-the-number-of-arrays-with-k-matching-adjacent-elements" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 3, "kept": 3, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "similar_to_test": [ "3405 count-the-number-of-arrays-with-k-matching-adjacent-elements" ] }, { "question_id": 1923, "task_id": "longest-common-subpath", "drop": [], "similar": [ "reconstruct-itinerary", "maximum-length-of-repeated-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "paths" ], "tests": { "total": 55, "kept": 55, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The same city is not listed multiple times consecutively in paths[i].", "sum(paths[i].length) <= 10**(5)" ], "public_tests": 3, "hints": [ "If there is a common path with length x, there is for sure a common path of length y where y < x.", "We can use binary search over the answer with the range [0, min(path[i].length)].", "Using binary search, we want to verify if we have a common path of length m. We can achieve this using hashing." ] }, { "question_id": 1924, "task_id": "erect-the-fence-ii", "drop": [ "premium" ] }, { "question_id": 1925, "task_id": "count-square-sum-triples", "drop": [], "similar": [ "number-of-unequal-triplets-in-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 23, "kept": 23, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate over all possible pairs (a,b) and check that the square root of a * a + b * b is an integers less than or equal n", "You can check that the square root of an integer is an integer using binary seach or a builtin function like sqrt" ] }, { "question_id": 1926, "task_id": "nearest-exit-from-entrance-in-maze", "drop": [ "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "maze", "entrance" ], "tests": { "total": 10, "kept": 8, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "maze[i][j] is either '.' or '+'." ] }, { "line": 7, "end_line": 7, "violates": [ "maze[i].length == n", "maze[i][j] is either '.' or '+'." ] } ], "unchecked_constraints": [ "0 <= entrancerow < m", "0 <= entrancecol < n", "entrance will always be an empty cell." ] }, { "question_id": 1927, "task_id": "sum-game", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 168, "kept": 161, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "num.length is even." ] }, { "line": 18, "end_line": 18, "violates": [ "num.length is even." ] }, { "line": 22, "end_line": 22, "violates": [ "num.length is even." ] }, { "line": 57, "end_line": 57, "violates": [ "num.length is even." ] }, { "line": 70, "end_line": 70, "violates": [ "num.length is even." ] }, { "line": 158, "end_line": 158, "violates": [ "num.length is even." ] }, { "line": 165, "end_line": 165, "violates": [ "num.length is even." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Bob can always make the total sum of both sides equal in mod 9.", "Why does the difference between the number of question marks on the left and right side matter?" ] }, { "question_id": 1928, "task_id": "minimum-cost-to-reach-destination-in-time", "drop": [], "similar": [ "maximum-cost-of-trip-with-k-highways", "maximum-path-quality-of-a-graph", "minimum-cost-to-reach-city-with-discounts", "find-minimum-time-to-reach-last-room-i", "find-minimum-time-to-reach-last-room-ii", "minimum-cost-path-with-edge-reversals" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "maxTime", "edges", "passingFees" ], "tests": { "total": 98, "kept": 97, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 75, "end_line": 75, "violates": [ "1 <= timei <= 1000" ] } ], "unchecked_constraints": [ "The graph may contain multiple edges between two nodes.", "The graph does not contain self loops." ], "public_tests": 3, "hints": [ "Consider a new graph where each node is one of the old nodes at a specific time. For example, node 0 at time 5.", "You need to find the shortest path in the new graph." ], "similar_to_test": [ "3341 find-minimum-time-to-reach-last-room-i", "3342 find-minimum-time-to-reach-last-room-ii" ] }, { "question_id": 1929, "task_id": "concatenation-of-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 71, "kept": 68, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Build an array of size 2 * n and assign nums[i] to ans[i] and ans[i + n]" ] }, { "question_id": 1930, "task_id": "unique-length-3-palindromic-subsequences", "drop": [], "similar": [ "count-palindromic-subsequences" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 75, "kept": 75, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "What is the maximum number of length-3 palindromic strings?", "How can we keep track of the characters that appeared to the left of a given position?" ] }, { "question_id": 1931, "task_id": "painting-a-grid-with-three-different-colors", "drop": [], "similar": [ "number-of-ways-to-paint-n-3-grid" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n" ], "tests": { "total": 61, "kept": 61, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Represent each colored column by a bitmask based on each cell color.", "Use bitmasks DP with state (currentCell, prevColumn)." ] }, { "question_id": 1933, "task_id": "check-if-string-is-decomposable-into-value-equal-substrings", "drop": [ "premium" ] }, { "question_id": 1935, "task_id": "maximum-number-of-words-you-can-type", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "text", "brokenLetters" ], "tests": { "total": 135, "kept": 134, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 88, "end_line": 88, "violates": [ "brokenLetters consists of distinct lowercase English letters." ] } ], "unchecked_constraints": [ "Each word only consists of lowercase English letters.", "text consists of words separated by a single space without any leading or trailing spaces." ], "public_tests": 3, "hints": [ "Check each word separately if it can be typed.", "A word can be typed if all its letters are not broken." ] }, { "question_id": 1936, "task_id": "add-minimum-number-of-rungs", "drop": [], "similar": [ "cutting-ribbons" ], "flags": [], "comparison": "exact", "parameter_names": [ "rungs", "dist" ], "tests": { "total": 102, "kept": 102, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "rungs is strictly increasing." ], "public_tests": 3, "hints": [ "Go as far as you can on the available rungs before adding new rungs.", "If you have to add a new rung, add it as high up as possible.", "Try using division to decrease the number of computations." ] }, { "question_id": 1937, "task_id": "maximum-number-of-points-with-cost", "drop": [], "similar": [ "minimum-path-sum", "minimize-the-difference-between-target-and-chosen-elements" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "points" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try using dynamic programming.", "dp[i][j] is the maximum number of points you can have if points[i][j] is the most recent cell you picked." ] }, { "question_id": 1938, "task_id": "maximum-genetic-difference-query", "drop": [], "similar": [ "maximum-xor-with-an-element-from-array" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "parents", "queries" ], "tests": { "total": 59, "kept": 52, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "0 <= vali <= 2 * 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= nodei <= parents.length - 1" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= vali <= 2 * 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= vali <= 2 * 10**(5)" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= vali <= 2 * 10**(5)" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= vali <= 2 * 10**(5)" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= vali <= 2 * 10**(5)" ] } ], "unchecked_constraints": [ "0 <= parents[i] <= parents.length - 1 for every node i that is not the root.", "parents[root] == -1" ], "public_tests": 2, "hints": [ "How can we use a trie to store all the XOR values in the path from a node to the root?", "How can we dynamically add the XOR values with a DFS search?" ] }, { "question_id": 1940, "task_id": "longest-common-subsequence-between-sorted-arrays", "drop": [ "premium" ] }, { "question_id": 1941, "task_id": "check-if-all-characters-have-equal-number-of-occurrences", "drop": [], "similar": [ "rings-and-rods", "make-number-of-distinct-characters-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 91, "kept": 90, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "1 <= s.length <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Build a dictionary containing the frequency of each character appearing in s", "Check if all values in the dictionary are the same." ] }, { "question_id": 1942, "task_id": "the-number-of-the-smallest-unoccupied-chair", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "times", "targetFriend" ], "tests": { "total": 101, "kept": 95, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= arrivali < leavingi <= 10**(5)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= arrivali < leavingi <= 10**(5)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= arrivali < leavingi <= 10**(5)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= arrivali < leavingi <= 10**(5)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= arrivali < leavingi <= 10**(5)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= arrivali < leavingi <= 10**(5)" ] } ], "unchecked_constraints": [ "Each arrivali time is distinct." ], "public_tests": 2, "hints": [ "Sort times by arrival time.", "for each arrival_i find the smallest unoccupied chair and mark it as occupied until leaving_i." ] }, { "question_id": 1943, "task_id": "describe-the-painting", "drop": [], "similar": [ "average-height-of-buildings-in-each-segment", "amount-of-new-area-painted-each-day", "shifting-letters-ii" ], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "segments" ], "tests": { "total": 98, "kept": 88, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= starti < endi <= 10**(5)" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= starti < endi <= 10**(5)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= starti < endi <= 10**(5)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= starti < endi <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= starti < endi <= 10**(5)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= starti < endi <= 10**(5)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= starti < endi <= 10**(5)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= starti < endi <= 10**(5)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= starti < endi <= 10**(5)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= starti < endi <= 10**(5)" ] } ], "unchecked_constraints": [ "Each colori is distinct." ], "public_tests": 3, "hints": [ "Can we sort the segments in a way to help solve the problem?", "How can we dynamically keep track of the sum of the current segment(s)?" ] }, { "question_id": 1944, "task_id": "number-of-visible-people-in-a-queue", "drop": [], "similar": [ "buildings-with-an-ocean-view", "sum-of-subarray-ranges", "sum-of-total-strength-of-wizards", "number-of-people-that-can-be-seen-in-a-grid", "find-building-where-alice-and-bob-can-meet" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "heights" ], "tests": { "total": 123, "kept": 97, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "All the values of heights are unique." ] }, { "line": 20, "end_line": 20, "violates": [ "All the values of heights are unique." ] }, { "line": 23, "end_line": 23, "violates": [ "All the values of heights are unique." ] }, { "line": 28, "end_line": 28, "violates": [ "All the values of heights are unique." ] }, { "line": 32, "end_line": 32, "violates": [ "All the values of heights are unique." ] }, { "line": 39, "end_line": 39, "violates": [ "All the values of heights are unique." ] }, { "line": 40, "end_line": 40, "violates": [ "All the values of heights are unique." ] }, { "line": 46, "end_line": 46, "violates": [ "All the values of heights are unique." ] }, { "line": 50, "end_line": 50, "violates": [ "All the values of heights are unique." ] }, { "line": 53, "end_line": 53, "violates": [ "All the values of heights are unique." ] }, { "line": 59, "end_line": 59, "violates": [ "All the values of heights are unique." ] }, { "line": 60, "end_line": 60, "violates": [ "All the values of heights are unique." ] }, { "line": 61, "end_line": 61, "violates": [ "All the values of heights are unique." ] }, { "line": 63, "end_line": 63, "violates": [ "All the values of heights are unique." ] }, { "line": 69, "end_line": 69, "violates": [ "All the values of heights are unique." ] }, { "line": 70, "end_line": 70, "violates": [ "All the values of heights are unique." ] }, { "line": 82, "end_line": 82, "violates": [ "All the values of heights are unique." ] }, { "line": 88, "end_line": 88, "violates": [ "All the values of heights are unique." ] }, { "line": 89, "end_line": 89, "violates": [ "All the values of heights are unique." ] }, { "line": 92, "end_line": 92, "violates": [ "All the values of heights are unique." ] }, { "line": 95, "end_line": 95, "violates": [ "All the values of heights are unique." ] }, { "line": 99, "end_line": 99, "violates": [ "All the values of heights are unique." ] }, { "line": 104, "end_line": 104, "violates": [ "All the values of heights are unique." ] }, { "line": 114, "end_line": 114, "violates": [ "All the values of heights are unique." ] }, { "line": 117, "end_line": 117, "violates": [ "All the values of heights are unique." ] }, { "line": 122, "end_line": 122, "violates": [ "All the values of heights are unique." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How to solve this problem in quadratic complexity ?", "For every subarray start at index i, keep finding new maximum values until a value larger than arr[i] is found.", "Since the limits are high, you need a linear solution.", "Use a stack to keep the values of the array sorted as you iterate the array from the end to the start.", "Keep popping from the stack the elements in sorted order until a value larger than arr[i] is found, these are the ones that person i can see." ] }, { "question_id": 1945, "task_id": "sum-of-digits-of-string-after-convert", "drop": [], "similar": [ "happy-number", "add-digits", "count-integers-with-even-digit-sum", "minimum-element-after-replacement-with-digit-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 93, "kept": 93, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "First, let's note that after the first transform the value will be at most 100 * 10 which is not much", "After The first transform, we can just do the rest of the transforms by brute force" ], "similar_to_test": [ "3300 minimum-element-after-replacement-with-digit-sum" ] }, { "question_id": 1946, "task_id": "largest-number-after-mutating-substring", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "num", "change" ], "tests": { "total": 125, "kept": 124, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "0 <= change[d] <= 9" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Should you change a digit if the new digit is smaller than the original?", "If changing the first digit and the last digit both make the number bigger, but you can only change one of them; which one should you change?", "Changing numbers closer to the front is always better" ] }, { "question_id": 1947, "task_id": "maximum-compatibility-score-sum", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "students", "mentors" ], "tests": { "total": 68, "kept": 68, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Calculate the compatibility score for each student-mentor pair.", "Try every permutation of students with the original mentors array." ] }, { "question_id": 1948, "task_id": "delete-duplicate-folders-in-system", "drop": [], "similar": [ "find-duplicate-file-in-system", "find-duplicate-subtrees" ], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "paths" ], "tests": { "total": 76, "kept": 68, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= paths[i][j].length <= 10" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= paths[i][j].length <= 10" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= paths[i][j].length <= 10" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= paths[i][j].length <= 10" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= paths[i][j].length <= 10" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= paths[i][j].length <= 10" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= paths[i][j].length <= 10" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= paths[i][j].length <= 10" ] } ], "unchecked_constraints": [ "path[i][j] consists of lowercase English letters.", "No two paths lead to the same folder.", "For any folder not at the root level, its parent folder will also be in the input.", "1 <= sum(paths[i][j].length) <= 2 * 10**(5)" ], "public_tests": 3, "hints": [ "Can we use a trie to build the folder structure?", "Can we utilize hashing to hash the folder structures?" ] }, { "question_id": 1950, "task_id": "maximum-of-minimum-values-in-all-subarrays", "drop": [ "premium" ] }, { "question_id": 1952, "task_id": "three-divisors", "drop": [], "similar": [ "find-greatest-common-divisor-of-array", "smallest-even-multiple" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 144, "kept": 78, "dropped": { "constraint_violation": 66 } }, "dropped_tests": [ { "line": 44, "end_line": 44, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 124, "end_line": 124, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 125, "end_line": 125, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 128, "end_line": 128, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 129, "end_line": 129, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 130, "end_line": 130, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 131, "end_line": 131, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 133, "end_line": 133, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 134, "end_line": 134, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 135, "end_line": 135, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 136, "end_line": 136, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 137, "end_line": 137, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 141, "end_line": 141, "violates": [ "1 <= n <= 10**(4)" ] }, { "line": 144, "end_line": 144, "violates": [ "1 <= n <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "You can count the number of divisors and just check that they are 3", "Beware of the case of n equal 1 as some solutions might fail in it" ] }, { "question_id": 1953, "task_id": "maximum-number-of-weeks-for-which-you-can-work", "drop": [], "similar": [ "task-scheduler" ], "flags": [], "comparison": "exact", "parameter_names": [ "milestones" ], "tests": { "total": 80, "kept": 80, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Work on the project with the largest number of milestones as long as it is possible.", "Does the project with the largest number of milestones affect the number of weeks?" ] }, { "question_id": 1954, "task_id": "minimum-garden-perimeter-to-collect-enough-apples", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "neededApples" ], "tests": { "total": 68, "kept": 61, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= neededApples <= 10**(15)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= neededApples <= 10**(15)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= neededApples <= 10**(15)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= neededApples <= 10**(15)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= neededApples <= 10**(15)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= neededApples <= 10**(15)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= neededApples <= 10**(15)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find a formula for the number of apples inside a square with a side length L.", "Iterate over the possible lengths of the square until enough apples are collected." ] }, { "question_id": 1955, "task_id": "count-number-of-special-subsequences", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 128, "kept": 128, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we first solve a simpler problem? Counting the number of subsequences with 1s followed by 0s.", "How can we keep track of the partially matched subsequences to help us find the answer?" ] }, { "question_id": 1956, "task_id": "minimum-time-for-k-virus-variants-to-spread", "drop": [ "premium" ] }, { "question_id": 1957, "task_id": "delete-characters-to-make-fancy-string", "drop": [], "similar": [ "find-maximum-removals-from-source-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 34, "kept": 34, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "What's the optimal way to delete characters if three or more consecutive characters are equal?", "If three or more consecutive characters are equal, keep two of them and delete the rest." ], "similar_to_test": [ "3316 find-maximum-removals-from-source-string" ] }, { "question_id": 1958, "task_id": "check-if-move-is-legal", "drop": [ "too_few_tests" ], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "board", "rMove", "cMove", "color" ], "tests": { "total": 8, "kept": 4, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "board[rMove][cMove] == '.'" ] }, { "line": 7, "end_line": 7, "violates": [ "board[rMove][cMove] == '.'" ] }, { "line": 8, "end_line": 8, "violates": [ "board[rMove][cMove] == '.'" ] }, { "line": 9, "end_line": 9, "violates": [ "board[rMove][cMove] == '.'" ] } ], "unchecked_constraints": [] }, { "question_id": 1959, "task_id": "minimum-total-space-wasted-with-k-resizing-operations", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 120, "kept": 114, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "0 <= k <= nums.length - 1" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= k <= nums.length - 1" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 106, "end_line": 106, "violates": [ "0 <= k <= nums.length - 1" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Given a range, how can you find the minimum waste if you can't perform any resize operations?", "Can we build our solution using dynamic programming using the current index and the number of resizing operations performed as the states?" ] }, { "question_id": 1960, "task_id": "maximum-product-of-the-length-of-two-palindromic-substrings", "drop": [], "similar": [ "maximum-product-of-the-length-of-two-palindromic-subsequences", "minimum-cost-to-make-array-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 173, "kept": 173, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "You can use Manacher's algorithm to get the maximum palindromic substring centered at each index", "After using Manacher's for each center use a line sweep from the center to the left and from the center to the right to find for each index the farthest center to it with distance \u2264 palin[center]", "After that, find the maximum palindrome size for each prefix in the string and for each suffix and the answer would be max(prefix[i] * suffix[i + 1])" ] }, { "question_id": 1961, "task_id": "check-if-string-is-a-prefix-of-array", "drop": [], "similar": [ "count-prefixes-of-a-given-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "words" ], "tests": { "total": 125, "kept": 124, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= s.length <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "There are only words.length prefix strings.", "Create all of them and see if s is one of them." ] }, { "question_id": 1962, "task_id": "remove-stones-to-minimize-the-total", "drop": [], "similar": [ "minimum-operations-to-halve-array-sum", "maximal-score-after-applying-k-operations", "take-gifts-from-the-richest-pile" ], "flags": [], "comparison": "exact", "parameter_names": [ "piles", "k" ], "tests": { "total": 83, "kept": 80, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "1 <= piles[i] <= 10**(4)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= piles[i] <= 10**(4)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= piles[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Choose the pile with the maximum number of stones each time.", "Use a data structure that helps you find the mentioned pile each time efficiently.", "One such data structure is a Priority Queue." ] }, { "question_id": 1963, "task_id": "minimum-number-of-swaps-to-make-the-string-balanced", "drop": [], "similar": [ "remove-invalid-parentheses", "minimum-add-to-make-parentheses-valid", "minimum-remove-to-make-valid-parentheses", "minimum-insertions-to-balance-a-parentheses-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 91, "kept": 60, "dropped": { "constraint_violation": 31 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "n is even." ] }, { "line": 30, "end_line": 30, "violates": [ "n is even." ] }, { "line": 36, "end_line": 36, "violates": [ "n is even." ] }, { "line": 38, "end_line": 38, "violates": [ "n is even." ] }, { "line": 41, "end_line": 41, "violates": [ "n is even." ] }, { "line": 42, "end_line": 42, "violates": [ "n is even." ] }, { "line": 43, "end_line": 43, "violates": [ "n is even." ] }, { "line": 44, "end_line": 44, "violates": [ "n is even." ] }, { "line": 45, "end_line": 45, "violates": [ "n is even." ] }, { "line": 46, "end_line": 46, "violates": [ "n is even." ] }, { "line": 47, "end_line": 47, "violates": [ "n is even." ] }, { "line": 49, "end_line": 49, "violates": [ "n is even." ] }, { "line": 50, "end_line": 50, "violates": [ "n is even." ] }, { "line": 51, "end_line": 51, "violates": [ "n is even." ] }, { "line": 54, "end_line": 54, "violates": [ "n is even." ] }, { "line": 57, "end_line": 57, "violates": [ "n is even." ] }, { "line": 62, "end_line": 62, "violates": [ "n is even." ] }, { "line": 66, "end_line": 66, "violates": [ "n is even." ] }, { "line": 69, "end_line": 69, "violates": [ "n is even." ] }, { "line": 73, "end_line": 73, "violates": [ "n is even." ] }, { "line": 74, "end_line": 74, "violates": [ "n is even." ] }, { "line": 76, "end_line": 76, "violates": [ "n is even." ] }, { "line": 78, "end_line": 78, "violates": [ "n is even." ] }, { "line": 79, "end_line": 79, "violates": [ "n is even." ] }, { "line": 81, "end_line": 81, "violates": [ "n is even." ] }, { "line": 84, "end_line": 84, "violates": [ "n is even." ] }, { "line": 85, "end_line": 85, "violates": [ "n is even." ] }, { "line": 86, "end_line": 86, "violates": [ "n is even." ] }, { "line": 89, "end_line": 89, "violates": [ "n is even." ] }, { "line": 90, "end_line": 90, "violates": [ "n is even." ] }, { "line": 92, "end_line": 92, "violates": [ "n is even." ] } ], "unchecked_constraints": [ "The number of opening brackets '[' equals n / 2, and the number of closing brackets ']' equals n / 2." ], "public_tests": 3, "hints": [ "Iterate over the string and keep track of the number of opening and closing brackets on each step.", "If the number of closing brackets is ever larger, you need to make a swap.", "Swap it with the opening bracket closest to the end of s." ] }, { "question_id": 1964, "task_id": "find-the-longest-valid-obstacle-course-at-each-position", "drop": [], "similar": [ "longest-increasing-subsequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "obstacles" ], "tests": { "total": 128, "kept": 128, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can you keep track of the minimum height for each obstacle course length?", "You can use binary search to find the longest previous obstacle course length that satisfies the conditions." ] }, { "question_id": 1966, "task_id": "binary-searchable-numbers-in-an-unsorted-array", "drop": [ "premium" ] }, { "question_id": 1967, "task_id": "number-of-strings-that-appear-as-substrings-in-word", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "patterns", "word" ], "tests": { "total": 122, "kept": 120, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 44, "end_line": 44, "violates": [ "patterns[i] and word consist of lowercase English letters." ] }, { "line": 76, "end_line": 76, "violates": [ "patterns[i] and word consist of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Deal with each of the patterns individually.", "Use the built-in function in the language you are using to find if the pattern exists as a substring in word." ] }, { "question_id": 1968, "task_id": "array-with-elements-not-equal-to-average-of-neighbors", "drop": [], "similar": [ "wiggle-sort", "wiggle-sort-ii", "design-neighbor-sum-service" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 115, "kept": 107, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 83, "end_line": 83, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 109, "end_line": 109, "violates": [ "0 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "A number can be the average of its neighbors if one neighbor is smaller than the number and the other is greater than the number.", "We can put numbers smaller than the median on odd indices and the rest on even indices." ] }, { "question_id": 1970, "task_id": "last-day-where-you-can-still-cross", "drop": [], "similar": [ "bricks-falling-when-hit", "escape-the-spreading-fire" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "row", "col", "cells" ], "tests": { "total": 54, "kept": 35, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "cells.length == row * col", "All the values of cells are unique." ] }, { "line": 10, "end_line": 10, "violates": [ "cells.length == row * col" ] }, { "line": 13, "end_line": 13, "violates": [ "cells.length == row * col" ] }, { "line": 14, "end_line": 14, "violates": [ "cells.length == row * col" ] }, { "line": 16, "end_line": 16, "violates": [ "cells.length == row * col", "All the values of cells are unique." ] }, { "line": 17, "end_line": 17, "violates": [ "cells.length == row * col", "All the values of cells are unique." ] }, { "line": 18, "end_line": 18, "violates": [ "cells.length == row * col" ] }, { "line": 22, "end_line": 22, "violates": [ "cells.length == row * col" ] }, { "line": 24, "end_line": 24, "violates": [ "cells.length == row * col", "All the values of cells are unique." ] }, { "line": 27, "end_line": 27, "violates": [ "cells.length == row * col" ] }, { "line": 31, "end_line": 31, "violates": [ "cells.length == row * col" ] }, { "line": 33, "end_line": 33, "violates": [ "cells.length == row * col", "All the values of cells are unique." ] }, { "line": 36, "end_line": 36, "violates": [ "cells.length == row * col" ] }, { "line": 37, "end_line": 37, "violates": [ "cells.length == row * col" ] }, { "line": 38, "end_line": 38, "violates": [ "cells.length == row * col" ] }, { "line": 41, "end_line": 41, "violates": [ "cells.length == row * col", "All the values of cells are unique." ] }, { "line": 43, "end_line": 43, "violates": [ "cells.length == row * col" ] }, { "line": 50, "end_line": 50, "violates": [ "cells.length == row * col", "All the values of cells are unique." ] }, { "line": 54, "end_line": 54, "violates": [ "cells.length == row * col", "All the values of cells are unique." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "What graph algorithm allows us to find whether a path exists?", "Can we use binary search to help us solve the problem?" ] }, { "question_id": 1971, "task_id": "find-if-path-exists-in-graph", "drop": [ "too_few_tests" ], "similar": [ "valid-arrangement-of-pairs", "paths-in-maze-that-lead-to-same-room" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "source", "destination" ], "tests": { "total": 4, "kept": 4, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There are no duplicate edges.", "There are no self edges." ] }, { "question_id": 1973, "task_id": "count-nodes-equal-to-sum-of-descendants", "drop": [ "premium" ] }, { "question_id": 1974, "task_id": "minimum-time-to-type-word-using-special-typewriter", "drop": [], "similar": [ "minimum-distance-to-type-a-word-using-two-fingers" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 129, "kept": 127, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "1 <= word.length <= 100" ] }, { "line": 60, "end_line": 60, "violates": [ "word consists of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "There are only two possible directions you can go when you move to the next letter.", "When moving to the next letter, you will always go in the direction that takes the least amount of time." ] }, { "question_id": 1975, "task_id": "maximum-matrix-sum", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 85, "kept": 81, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "n == matrix.length == matrix[i].length" ] }, { "line": 41, "end_line": 41, "violates": [ "n == matrix.length == matrix[i].length" ] }, { "line": 46, "end_line": 46, "violates": [ "n == matrix.length == matrix[i].length" ] }, { "line": 52, "end_line": 52, "violates": [ "n == matrix.length == matrix[i].length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to use the operation so that each row has only one negative number.", "If you have only one negative element you cannot convert it to positive." ] }, { "question_id": 1976, "task_id": "number-of-ways-to-arrive-at-destination", "drop": [], "similar": [ "all-paths-from-source-to-target", "path-with-maximum-probability", "second-minimum-time-to-reach-destination" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "roads" ], "tests": { "total": 64, "kept": 64, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There is at most one road connecting any two intersections.", "You can reach any intersection from any other intersection." ], "public_tests": 2, "hints": [ "First use any shortest path algorithm to get edges where dist[u] + weight = dist[v], here dist[x] is the shortest distance between node 0 and x", "Using those edges only the graph turns into a dag now we just need to know the number of ways to get from node 0 to node n - 1 on a dag using dp" ] }, { "question_id": 1977, "task_id": "number-of-ways-to-separate-numbers", "drop": [], "similar": [ "decode-ways", "decode-ways-ii", "restore-the-array", "number-of-beautiful-partitions" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 105, "kept": 105, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If we know the current number has d digits, how many digits can the previous number have?", "Is there a quick way of calculating the number of possibilities for the previous number if we know that it must have less than or equal to d digits? Try to do some pre-processing." ] }, { "question_id": 1979, "task_id": "find-greatest-common-divisor-of-array", "drop": [], "similar": [ "greatest-common-divisor-of-strings", "number-of-different-subsequences-gcds", "three-divisors", "smallest-even-multiple", "number-of-subarrays-with-gcd-equal-to-k", "find-the-number-of-subsequences-with-equal-gcd", "maximum-subarray-with-equal-products" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 117, "kept": 99, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the minimum and maximum in one iteration. Let them be mn and mx.", "Try all the numbers in the range [1, mn] and check the largest number which divides both of them." ], "similar_to_test": [ "3336 find-the-number-of-subsequences-with-equal-gcd", "3411 maximum-subarray-with-equal-products" ] }, { "question_id": 1980, "task_id": "find-unique-binary-string", "drop": [], "similar": [ "missing-number", "find-all-numbers-disappeared-in-an-array", "random-pick-with-blacklist" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 54, "kept": 13, "dropped": { "constraint_violation": 41 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "nums[i].length == n" ] }, { "line": 7, "end_line": 7, "violates": [ "nums[i].length == n" ] }, { "line": 8, "end_line": 8, "violates": [ "nums[i].length == n" ] }, { "line": 9, "end_line": 9, "violates": [ "nums[i].length == n" ] }, { "line": 11, "end_line": 11, "violates": [ "nums[i].length == n" ] }, { "line": 12, "end_line": 12, "violates": [ "nums[i].length == n" ] }, { "line": 13, "end_line": 13, "violates": [ "nums[i].length == n" ] }, { "line": 14, "end_line": 14, "violates": [ "nums[i].length == n", "nums[i].length == n" ] }, { "line": 15, "end_line": 15, "violates": [ "nums[i].length == n" ] }, { "line": 18, "end_line": 18, "violates": [ "nums[i].length == n" ] }, { "line": 19, "end_line": 19, "violates": [ "nums[i].length == n" ] }, { "line": 20, "end_line": 20, "violates": [ "nums[i].length == n" ] }, { "line": 21, "end_line": 21, "violates": [ "nums[i].length == n" ] }, { "line": 22, "end_line": 22, "violates": [ "nums[i].length == n" ] }, { "line": 24, "end_line": 24, "violates": [ "nums[i].length == n", "nums[i].length == n" ] }, { "line": 25, "end_line": 25, "violates": [ "nums[i].length == n" ] }, { "line": 26, "end_line": 26, "violates": [ "nums[i].length == n" ] }, { "line": 27, "end_line": 27, "violates": [ "nums[i].length == n" ] }, { "line": 28, "end_line": 28, "violates": [ "nums[i].length == n", "nums[i].length == n" ] }, { "line": 29, "end_line": 29, "violates": [ "nums[i].length == n" ] }, { "line": 31, "end_line": 31, "violates": [ "nums[i].length == n", "nums[i].length == n" ] }, { "line": 32, "end_line": 32, "violates": [ "nums[i].length == n" ] }, { "line": 33, "end_line": 33, "violates": [ "nums[i].length == n" ] }, { "line": 34, "end_line": 34, "violates": [ "nums[i].length == n" ] }, { "line": 35, "end_line": 35, "violates": [ "nums[i].length == n" ] }, { "line": 36, "end_line": 36, "violates": [ "nums[i].length == n" ] }, { "line": 37, "end_line": 37, "violates": [ "nums[i].length == n" ] }, { "line": 38, "end_line": 38, "violates": [ "nums[i].length == n" ] }, { "line": 39, "end_line": 39, "violates": [ "nums[i].length == n", "All the strings of nums are unique." ] }, { "line": 40, "end_line": 40, "violates": [ "nums[i].length == n" ] }, { "line": 42, "end_line": 42, "violates": [ "nums[i].length == n" ] }, { "line": 45, "end_line": 45, "violates": [ "nums[i].length == n" ] }, { "line": 46, "end_line": 46, "violates": [ "nums[i].length == n" ] }, { "line": 47, "end_line": 47, "violates": [ "nums[i].length == n" ] }, { "line": 48, "end_line": 48, "violates": [ "nums[i].length == n" ] }, { "line": 49, "end_line": 49, "violates": [ "nums[i].length == n" ] }, { "line": 51, "end_line": 51, "violates": [ "nums[i].length == n" ] }, { "line": 52, "end_line": 52, "violates": [ "nums[i].length == n" ] }, { "line": 53, "end_line": 53, "violates": [ "nums[i].length == n" ] }, { "line": 54, "end_line": 54, "violates": [ "nums[i].length == n" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= n <= 16", "nums[i].length == n" ] } ], "unchecked_constraints": [ "nums[i] is either '0' or '1'." ], "public_tests": 3, "hints": [ "We can convert the given strings into base 10 integers.", "Can we use recursion to generate all possible strings?" ] }, { "question_id": 1981, "task_id": "minimize-the-difference-between-target-and-chosen-elements", "drop": [], "similar": [ "partition-equal-subset-sum", "closest-subsequence-sum", "maximum-number-of-points-with-cost" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat", "target" ], "tests": { "total": 104, "kept": 87, "dropped": { "constraint_violation": 17 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= mat[i][j] <= 70", "1 <= target <= 800" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= mat[i][j] <= 70" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= mat[i][j] <= 70" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The sum of chosen elements will not be too large. Consider using a hash set to record all possible sums while iterating each row.", "Instead of keeping track of all possible sums, since in each row, we are adding positive numbers, only keep those that can be a candidate, not exceeding the target by too much." ] }, { "question_id": 1982, "task_id": "find-array-given-subset-sums", "drop": [], "similar": [ "subsets", "subsets-ii", "recover-the-original-array" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "n", "sums" ], "tests": { "total": 89, "kept": 39, "dropped": { "constraint_violation": 50 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "sums.length == 2**(n)" ] }, { "line": 9, "end_line": 9, "violates": [ "sums.length == 2**(n)" ] }, { "line": 10, "end_line": 10, "violates": [ "sums.length == 2**(n)" ] }, { "line": 11, "end_line": 11, "violates": [ "sums.length == 2**(n)" ] }, { "line": 12, "end_line": 12, "violates": [ "sums.length == 2**(n)", "sums.length == 2**(n)" ] }, { "line": 13, "end_line": 13, "violates": [ "sums.length == 2**(n)" ] }, { "line": 17, "end_line": 17, "violates": [ "sums.length == 2**(n)" ] }, { "line": 18, "end_line": 18, "violates": [ "sums.length == 2**(n)", "sums.length == 2**(n)" ] }, { "line": 19, "end_line": 19, "violates": [ "sums.length == 2**(n)" ] }, { "line": 20, "end_line": 20, "violates": [ "sums.length == 2**(n)" ] }, { "line": 22, "end_line": 22, "violates": [ "sums.length == 2**(n)" ] }, { "line": 23, "end_line": 23, "violates": [ "sums.length == 2**(n)" ] }, { "line": 24, "end_line": 24, "violates": [ "sums.length == 2**(n)" ] }, { "line": 25, "end_line": 25, "violates": [ "sums.length == 2**(n)", "sums.length == 2**(n)" ] }, { "line": 26, "end_line": 26, "violates": [ "sums.length == 2**(n)", "sums.length == 2**(n)" ] }, { "line": 27, "end_line": 27, "violates": [ "sums.length == 2**(n)" ] }, { "line": 28, "end_line": 28, "violates": [ "sums.length == 2**(n)" ] }, { "line": 29, "end_line": 29, "violates": [ "sums.length == 2**(n)" ] }, { "line": 30, "end_line": 30, "violates": [ "sums.length == 2**(n)" ] }, { "line": 32, "end_line": 32, "violates": [ "sums.length == 2**(n)" ] }, { "line": 33, "end_line": 33, "violates": [ "sums.length == 2**(n)" ] }, { "line": 34, "end_line": 34, "violates": [ "sums.length == 2**(n)", "sums.length == 2**(n)" ] }, { "line": 37, "end_line": 37, "violates": [ "sums.length == 2**(n)" ] }, { "line": 38, "end_line": 38, "violates": [ "sums.length == 2**(n)" ] }, { "line": 41, "end_line": 41, "violates": [ "sums.length == 2**(n)" ] }, { "line": 43, "end_line": 43, "violates": [ "sums.length == 2**(n)" ] }, { "line": 45, "end_line": 45, "violates": [ "sums.length == 2**(n)" ] }, { "line": 46, "end_line": 46, "violates": [ "sums.length == 2**(n)" ] }, { "line": 48, "end_line": 48, "violates": [ "sums.length == 2**(n)" ] }, { "line": 50, "end_line": 50, "violates": [ "sums.length == 2**(n)", "sums.length == 2**(n)" ] }, { "line": 51, "end_line": 51, "violates": [ "sums.length == 2**(n)", "sums.length == 2**(n)" ] }, { "line": 52, "end_line": 52, "violates": [ "sums.length == 2**(n)" ] }, { "line": 54, "end_line": 54, "violates": [ "sums.length == 2**(n)" ] }, { "line": 55, "end_line": 55, "violates": [ "sums.length == 2**(n)" ] }, { "line": 56, "end_line": 56, "violates": [ "sums.length == 2**(n)", "sums.length == 2**(n)" ] }, { "line": 57, "end_line": 57, "violates": [ "sums.length == 2**(n)" ] }, { "line": 58, "end_line": 58, "violates": [ "sums.length == 2**(n)" ] }, { "line": 59, "end_line": 59, "violates": [ "sums.length == 2**(n)" ] }, { "line": 60, "end_line": 60, "violates": [ "sums.length == 2**(n)" ] }, { "line": 61, "end_line": 61, "violates": [ "sums.length == 2**(n)" ] }, { "line": 65, "end_line": 65, "violates": [ "sums.length == 2**(n)" ] }, { "line": 66, "end_line": 66, "violates": [ "sums.length == 2**(n)" ] }, { "line": 68, "end_line": 68, "violates": [ "sums.length == 2**(n)" ] }, { "line": 71, "end_line": 71, "violates": [ "sums.length == 2**(n)" ] }, { "line": 76, "end_line": 76, "violates": [ "sums.length == 2**(n)" ] }, { "line": 77, "end_line": 77, "violates": [ "sums.length == 2**(n)" ] }, { "line": 79, "end_line": 79, "violates": [ "sums.length == 2**(n)" ] }, { "line": 81, "end_line": 81, "violates": [ "sums.length == 2**(n)" ] }, { "line": 87, "end_line": 87, "violates": [ "sums.length == 2**(n)" ] }, { "line": 89, "end_line": 89, "violates": [ "sums.length == 2**(n)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "What information do the two largest elements tell us?", "Can we use recursion to check all possible states?" ] }, { "question_id": 1983, "task_id": "widest-pair-of-indices-with-equal-range-sum", "drop": [ "premium" ] }, { "question_id": 1984, "task_id": "minimum-difference-between-highest-and-lowest-of-k-scores", "drop": [], "similar": [ "array-partition" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 95, "kept": 89, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 49, "end_line": 49, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 85, "end_line": 85, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For the difference between the highest and lowest element to be minimized, the k chosen scores need to be as close to each other as possible.", "What if the array was sorted?", "After sorting the scores, any contiguous k scores are as close to each other as possible.", "Apply a sliding window solution to iterate over each contiguous k scores, and find the minimum of the differences of all windows." ] }, { "question_id": 1985, "task_id": "find-the-kth-largest-integer-in-the-array", "drop": [], "similar": [ "kth-largest-element-in-an-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums[i] will not have any leading zeros." ], "public_tests": 3, "hints": [ "If two numbers have different lengths, which one will be larger?", "The longer number is the larger number.", "If two numbers have the same length, which one will be larger?", "Compare the two numbers starting from the most significant digit. Once you have found the first digit that differs, the one with the larger digit is the larger number." ] }, { "question_id": 1986, "task_id": "minimum-number-of-work-sessions-to-finish-the-tasks", "drop": [], "similar": [ "smallest-sufficient-team", "fair-distribution-of-cookies", "find-minimum-time-to-finish-all-jobs", "find-minimum-time-to-finish-all-jobs-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "tasks", "sessionTime" ], "tests": { "total": 123, "kept": 97, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= tasks[i] <= 10", "1 <= tasks[i] <= 10" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= tasks[i] <= 10", "1 <= tasks[i] <= 10" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= tasks[i] <= 10", "1 <= tasks[i] <= 10" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= tasks[i] <= 10", "1 <= tasks[i] <= 10" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= tasks[i] <= 10", "1 <= tasks[i] <= 10" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= n <= 14" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= tasks[i] <= 10", "1 <= tasks[i] <= 10" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= tasks[i] <= 10" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= tasks[i] <= 10" ] } ], "unchecked_constraints": [ "max(tasks[i]) <= sessionTime <= 15" ], "public_tests": 3, "hints": [ "Try all possible ways of assignment.", "If we can store the assignments in form of a state then we can reuse that state and solve the problem in a faster way." ] }, { "question_id": 1987, "task_id": "number-of-unique-good-subsequences", "drop": [], "similar": [ "distinct-subsequences", "distinct-subsequences-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "binary" ], "tests": { "total": 90, "kept": 90, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The number of unique good subsequences is equal to the number of unique decimal values there are for all possible subsequences.", "Find the answer at each index based on the previous indexes' answers." ] }, { "question_id": 1989, "task_id": "maximum-number-of-people-that-can-be-caught-in-tag", "drop": [ "premium" ] }, { "question_id": 1991, "task_id": "find-the-middle-index-in-array", "drop": [], "similar": [ "find-pivot-index", "partition-array-into-three-parts-with-equal-sum", "number-of-ways-to-split-array", "maximum-sum-score-of-array", "left-and-right-sum-differences" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 94, "kept": 92, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 50, "end_line": 50, "violates": [ "-1000 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Could we go from left to right and check to see if an index is a middle index?", "Do we need to sum every number to the left and right of an index each time?", "Use a prefix sum array where prefix[i] = nums[0] + nums[1] + ... + nums[i]." ] }, { "question_id": 1992, "task_id": "find-all-groups-of-farmland", "drop": [], "similar": [ "number-of-islands", "count-sub-islands" ], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "land" ], "tests": { "total": 74, "kept": 74, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Groups of farmland are rectangular in shape.", "land consists of only 0's and 1's." ], "public_tests": 3, "hints": [ "Since every group of farmland is rectangular, the top left corner of each group will have the smallest x-coordinate and y-coordinate of any farmland in the group.", "Similarly, the bottom right corner of each group will have the largest x-coordinate and y-coordinate of any farmland in the group.", "Use DFS to traverse through different groups of farmlands and keep track of the smallest and largest x-coordinate and y-coordinates you have seen in each group." ] }, { "question_id": 1994, "task_id": "the-number-of-good-subsets", "drop": [], "similar": [ "smallest-sufficient-team", "fair-distribution-of-cookies", "number-of-ways-to-wear-different-hats-to-each-other" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 108, "kept": 91, "dropped": { "constraint_violation": 17 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 30", "1 <= nums[i] <= 30" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 30", "1 <= nums[i] <= 30" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 30" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider only the numbers which have a good prime factorization.", "Use brute force to find all possible good subsets and then calculate its frequency in nums." ] }, { "question_id": 1995, "task_id": "count-special-quadruplets", "drop": [], "similar": [ "4sum", "increasing-triplet-subsequence", "count-good-triplets", "count-increasing-quadruplets" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 107, "kept": 89, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 30, "end_line": 30, "violates": [ "4 <= nums.length <= 50" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 106, "end_line": 106, "violates": [ "4 <= nums.length <= 50" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "N is very small, how can we use that?", "Can we check every possible quadruplet?" ] }, { "question_id": 1996, "task_id": "the-number-of-weak-characters-in-the-game", "drop": [], "similar": [ "russian-doll-envelopes", "maximum-height-by-stacking-cuboids" ], "flags": [], "comparison": "exact", "parameter_names": [ "properties" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the array on the basis of the attack values and group characters with the same attack together. How can you use these groups?", "Characters in one group will always have a lesser attack value than the characters of the next group. Hence, we will only need to check if there is a higher defense value present in the next groups." ] }, { "question_id": 1997, "task_id": "first-day-where-you-have-been-in-all-the-rooms", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nextVisit" ], "tests": { "total": 110, "kept": 69, "dropped": { "constraint_violation": 41 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 8, "end_line": 8, "violates": [ "0 <= nextVisit[i] <= i", "0 <= nextVisit[i] <= i" ] }, { "line": 17, "end_line": 17, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= nextVisit[i] <= i", "0 <= nextVisit[i] <= i" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 89, "end_line": 89, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= nextVisit[i] <= i", "0 <= nextVisit[i] <= i" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 96, "end_line": 96, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 97, "end_line": 97, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 98, "end_line": 98, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 99, "end_line": 99, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= nextVisit[i] <= i", "0 <= nextVisit[i] <= i" ] }, { "line": 103, "end_line": 103, "violates": [ "0 <= nextVisit[i] <= i" ] }, { "line": 109, "end_line": 109, "violates": [ "0 <= nextVisit[i] <= i" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The only way to get to room i+1 is when you are visiting room i and room i has been visited an even number of times.", "After visiting room i an odd number of times, you are required to visit room nextVisit[i] where nextVisit[i] <= i. It takes a fixed amount of days for you to come back from room nextVisit[i] to room i. Then, you have visited room i even number of times.nextVisit[i]", "Can you use Dynamic Programming to avoid recomputing the number of days it takes to visit room i from room nextVisit[i]?" ] }, { "question_id": 1998, "task_id": "gcd-sort-of-an-array", "drop": [], "similar": [ "rank-transform-of-a-matrix" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 168, "kept": 164, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 10, "end_line": 10, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 143, "end_line": 143, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 154, "end_line": 154, "violates": [ "2 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we build a graph with all the prime numbers and the original array?", "We can use union-find to determine which indices are connected (i.e., which indices can be swapped)." ] }, { "question_id": 1999, "task_id": "smallest-greater-multiple-made-of-two-digits", "drop": [ "premium" ] }, { "question_id": 2000, "task_id": "reverse-prefix-of-word", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "word", "ch" ], "tests": { "total": 133, "kept": 132, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= word.length <= 250" ] } ], "unchecked_constraints": [ "ch is a lowercase English letter." ], "public_tests": 3, "hints": [ "Find the first index where ch appears.", "Find a way to reverse a substring of word." ] }, { "question_id": 2001, "task_id": "number-of-pairs-of-interchangeable-rectangles", "drop": [], "similar": [ "number-of-good-pairs", "count-nice-pairs-in-an-array", "replace-non-coprime-numbers-in-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "rectangles" ], "tests": { "total": 84, "kept": 82, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 54, "end_line": 54, "violates": [ "1 <= widthi, heighti <= 10**(5)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= widthi, heighti <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Store the rectangle height and width ratio in a hashmap.", "Traverse the ratios, and for each ratio, use the frequency of the ratio to add to the total pair count." ] }, { "question_id": 2002, "task_id": "maximum-product-of-the-length-of-two-palindromic-subsequences", "drop": [], "similar": [ "valid-palindrome", "longest-palindromic-subsequence", "maximum-product-of-the-length-of-two-palindromic-substrings", "maximum-points-in-an-archery-competition" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 81, "kept": 61, "dropped": { "constraint_violation": 20 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "2 <= s.length <= 12" ] }, { "line": 29, "end_line": 29, "violates": [ "2 <= s.length <= 12" ] }, { "line": 38, "end_line": 38, "violates": [ "2 <= s.length <= 12" ] }, { "line": 39, "end_line": 39, "violates": [ "2 <= s.length <= 12" ] }, { "line": 43, "end_line": 43, "violates": [ "2 <= s.length <= 12" ] }, { "line": 45, "end_line": 45, "violates": [ "2 <= s.length <= 12" ] }, { "line": 48, "end_line": 48, "violates": [ "2 <= s.length <= 12" ] }, { "line": 51, "end_line": 51, "violates": [ "2 <= s.length <= 12" ] }, { "line": 52, "end_line": 52, "violates": [ "2 <= s.length <= 12" ] }, { "line": 53, "end_line": 53, "violates": [ "2 <= s.length <= 12" ] }, { "line": 54, "end_line": 54, "violates": [ "2 <= s.length <= 12" ] }, { "line": 58, "end_line": 58, "violates": [ "2 <= s.length <= 12" ] }, { "line": 59, "end_line": 59, "violates": [ "2 <= s.length <= 12" ] }, { "line": 61, "end_line": 61, "violates": [ "2 <= s.length <= 12" ] }, { "line": 62, "end_line": 62, "violates": [ "2 <= s.length <= 12" ] }, { "line": 63, "end_line": 63, "violates": [ "2 <= s.length <= 12" ] }, { "line": 70, "end_line": 70, "violates": [ "2 <= s.length <= 12" ] }, { "line": 73, "end_line": 73, "violates": [ "2 <= s.length <= 12" ] }, { "line": 76, "end_line": 76, "violates": [ "2 <= s.length <= 12" ] }, { "line": 78, "end_line": 78, "violates": [ "2 <= s.length <= 12" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Could you generate all possible pairs of disjoint subsequences?", "Could you find the maximum length palindrome in each subsequence for a pair of disjoint subsequences?" ] }, { "question_id": 2003, "task_id": "smallest-missing-genetic-value-in-each-subtree", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "parents", "nums" ], "tests": { "total": 38, "kept": 34, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "n == parents.length == nums.length" ] }, { "line": 32, "end_line": 32, "violates": [ "n == parents.length == nums.length" ] }, { "line": 35, "end_line": 35, "violates": [ "n == parents.length == nums.length" ] }, { "line": 37, "end_line": 37, "violates": [ "n == parents.length == nums.length" ] } ], "unchecked_constraints": [ "0 <= parents[i] <= n - 1 for i != 0", "parents represents a valid tree.", "Each nums[i] is distinct." ], "public_tests": 3, "hints": [ "If the subtree doesn't contain 1, then the missing value will always be 1.", "What data structure allows us to dynamically update the values that are currently not present?" ] }, { "question_id": 2005, "task_id": "subtree-removal-game-with-fibonacci-tree", "drop": [ "premium" ] }, { "question_id": 2006, "task_id": "count-number-of-pairs-with-absolute-difference-k", "drop": [], "similar": [ "two-sum", "k-diff-pairs-in-an-array", "finding-pairs-with-a-certain-sum", "count-equal-and-divisible-pairs-in-an-array", "count-number-of-bad-pairs", "count-the-number-of-fair-pairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 106, "kept": 88, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= k <= 99" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= k <= 99" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= k <= 99" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= k <= 99" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= k <= 99" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= k <= 99" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= k <= 99" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= k <= 99" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= k <= 99" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= k <= 99" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 100", "1 <= k <= 99" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we check every possible pair?", "Can we use a nested for loop to solve this problem?" ] }, { "question_id": 2007, "task_id": "find-original-array-from-doubled-array", "drop": [], "similar": [ "array-of-doubled-pairs", "recover-the-original-array" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "changed" ], "tests": { "total": 124, "kept": 113, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "0 <= changed[i] <= 10**(5)" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= changed[i] <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= changed[i] <= 10**(5)" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= changed[i] <= 10**(5)" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= changed[i] <= 10**(5)" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= changed[i] <= 10**(5)" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= changed[i] <= 10**(5)" ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= changed[i] <= 10**(5)" ] }, { "line": 108, "end_line": 108, "violates": [ "0 <= changed[i] <= 10**(5)" ] }, { "line": 111, "end_line": 111, "violates": [ "0 <= changed[i] <= 10**(5)" ] }, { "line": 124, "end_line": 124, "violates": [ "0 <= changed[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If changed is a doubled array, you should be able to delete elements and their doubled values until the array is empty.", "Which element is guaranteed to not be a doubled value? It is the smallest element.", "After removing the smallest element and its double from changed, is there another number that is guaranteed to not be a doubled value?" ] }, { "question_id": 2008, "task_id": "maximum-earnings-from-taxi", "drop": [], "similar": [ "maximum-profit-in-job-scheduling", "maximum-number-of-events-that-can-be-attended", "maximum-number-of-events-that-can-be-attended-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "rides" ], "tests": { "total": 71, "kept": 67, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= starti < endi <= n" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= starti < endi <= n" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= starti < endi <= n" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= n <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we sort the array to help us solve the problem?", "We can use dynamic programming to keep track of the maximum at each position." ] }, { "question_id": 2009, "task_id": "minimum-number-of-operations-to-make-array-continuous", "drop": [], "similar": [ "longest-repeating-character-replacement", "continuous-subarray-sum", "moving-stones-until-consecutive-ii", "minimum-one-bit-operations-to-make-integers-zero", "minimum-adjacent-swaps-for-k-consecutive-ones" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 136, "kept": 131, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the array.", "For every index do a binary search to get the possible right end of the window and calculate the possible answer." ] }, { "question_id": 2011, "task_id": "final-value-of-variable-after-performing-operations", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "operations" ], "tests": { "total": 88, "kept": 88, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "operations[i] will be either \"++X\", \"X++\", \"--X\", or \"X--\"." ], "public_tests": 3, "hints": [ "There are only two operations to keep track of.", "Use a variable to store the value after each operation." ] }, { "question_id": 2012, "task_id": "sum-of-beauty-in-the-array", "drop": [], "similar": [ "best-time-to-buy-and-sell-stock", "partition-array-into-disjoint-intervals", "maximum-value-of-an-ordered-triplet-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 136, "kept": 132, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use suffix/prefix arrays.", "prefix[i] records the maximum value in range (0, i - 1) inclusive.", "suffix[i] records the minimum value in range (i + 1, n - 1) inclusive." ] }, { "question_id": 2014, "task_id": "longest-subsequence-repeated-k-times", "drop": [], "similar": [ "longest-substring-with-at-least-k-repeating-characters" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 89, "kept": 68, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "2 <= k <= 2000", "2 <= n < min(2001, k * 8)" ] }, { "line": 28, "end_line": 28, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 34, "end_line": 34, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 35, "end_line": 35, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 37, "end_line": 37, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 46, "end_line": 46, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 48, "end_line": 48, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 49, "end_line": 49, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 51, "end_line": 51, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 56, "end_line": 56, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 61, "end_line": 61, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 62, "end_line": 62, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 65, "end_line": 65, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 68, "end_line": 68, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 69, "end_line": 69, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 77, "end_line": 77, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 80, "end_line": 80, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 83, "end_line": 83, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 86, "end_line": 86, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 87, "end_line": 87, "violates": [ "2 <= n < min(2001, k * 8)" ] }, { "line": 88, "end_line": 88, "violates": [ "2 <= n < min(2001, k * 8)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The length of the longest subsequence does not exceed n/k. Do you know why?", "Find the characters that could be included in the potential answer. A character occurring more than or equal to k times can be used in the answer up to (count of the character / k) times.", "Try all possible candidates in reverse lexicographic order, and check the string for the subsequence condition." ] }, { "question_id": 2015, "task_id": "average-height-of-buildings-in-each-segment", "drop": [ "premium" ] }, { "question_id": 2016, "task_id": "maximum-difference-between-increasing-elements", "drop": [], "similar": [ "best-time-to-buy-and-sell-stock", "two-furthest-houses-with-different-colors" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 118, "kept": 113, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Could you keep track of the minimum element visited while traversing?", "We have a potential candidate for the answer if the prefix min is less than nums[i]." ] }, { "question_id": 2017, "task_id": "grid-game", "drop": [], "similar": [ "minimum-penalty-for-a-shop" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 75, "kept": 73, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 46, "end_line": 46, "violates": [ "n == grid[r].length" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= grid[r][c] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "There are n choices for when the first robot moves to the second row.", "Can we use prefix sums to help solve this problem?" ] }, { "question_id": 2018, "task_id": "check-if-word-can-be-placed-in-crossword", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "board", "word" ], "tests": { "total": 134, "kept": 121, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= word.length <= max(m, n)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= word.length <= max(m, n)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= word.length <= max(m, n)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= word.length <= max(m, n)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= word.length <= max(m, n)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= word.length <= max(m, n)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= word.length <= max(m, n)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= word.length <= max(m, n)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= word.length <= max(m, n)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= word.length <= max(m, n)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= word.length <= max(m, n)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= word.length <= max(m, n)" ] }, { "line": 130, "end_line": 130, "violates": [ "1 <= word.length <= max(m, n)" ] } ], "unchecked_constraints": [ "board[i][j] will be ' ', '#', or a lowercase English letter.", "word will contain only lowercase English letters." ], "public_tests": 3, "hints": [ "Check all possible placements for the word.", "There is a limited number of places where a word can start." ] }, { "question_id": 2019, "task_id": "the-score-of-students-solving-math-expression", "drop": [], "similar": [ "basic-calculator", "different-ways-to-add-parentheses" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "s", "answers" ], "tests": { "total": 109, "kept": 105, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 38, "end_line": 38, "violates": [ "3 <= s.length <= 31" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= answers[i] <= 1000" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= answers[i] <= 1000" ] }, { "line": 87, "end_line": 87, "violates": [ "0 <= answers[i] <= 1000" ] } ], "unchecked_constraints": [ "s represents a valid expression that contains only digits 0-9, '+', and '*' only.", "All the integer operands in the expression are in the inclusive range [0, 9].", "1 <= The count of all operators ('+' and '*') in the math expression <= 15", "Test data are generated such that the correct answer of the expression is in the range of [0, 1000].", "Test data are generated such that value never exceeds 10**(9) in intermediate steps of multiplication." ], "public_tests": 3, "hints": [ "The number of operators in the equation is less. Could you find the right answer then generate all possible answers using different orders of operations?", "Divide the equation into blocks separated by the operators, and use memoization on the results of blocks for optimization.", "Use set and the max limit of the answer for further optimization." ] }, { "question_id": 2021, "task_id": "brightest-position-on-street", "drop": [ "premium" ] }, { "question_id": 2022, "task_id": "convert-1d-array-into-2d-array", "drop": [], "similar": [ "reshape-the-matrix" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "original", "m", "n" ], "tests": { "total": 85, "kept": 84, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 49, "end_line": 49, "violates": [ "1 <= original[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "When is it possible to convert original into a 2D array and when is it impossible?", "It is possible if and only if m * n == original.length", "If it is possible to convert original to a 2D array, keep an index i such that original[i] is the next element to add to the 2D array." ] }, { "question_id": 2023, "task_id": "number-of-pairs-of-strings-with-concatenation-equal-to-target", "drop": [], "similar": [ "two-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 127, "kept": 127, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums[i] and target do not have leading zeros." ], "public_tests": 3, "hints": [ "Try to concatenate every two different strings from the list.", "Count the number of pairs with concatenation equals to target." ] }, { "question_id": 2024, "task_id": "maximize-the-confusion-of-an-exam", "drop": [], "similar": [ "longest-substring-with-at-most-k-distinct-characters", "longest-repeating-character-replacement", "max-consecutive-ones-iii", "minimum-number-of-days-to-make-m-bouquets", "longest-nice-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "answerKey", "k" ], "tests": { "total": 141, "kept": 133, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "answerKey[i] is either 'T' or 'F'" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= k <= n" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= k <= n" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= k <= n" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= k <= n" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= k <= n" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= k <= n" ] }, { "line": 134, "end_line": 134, "violates": [ "1 <= k <= n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we use the maximum length at the previous position to help us find the answer for the current position?", "Can we use binary search to find the maximum consecutive same answer at every position?" ] }, { "question_id": 2025, "task_id": "maximum-number-of-ways-to-partition-an-array", "drop": [], "similar": [ "partition-equal-subset-sum", "partition-to-k-equal-sum-subsets" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 117, "kept": 113, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "-10**(5) <= k, nums[i] <= 10**(5)" ] }, { "line": 33, "end_line": 33, "violates": [ "-10**(5) <= k, nums[i] <= 10**(5)" ] }, { "line": 79, "end_line": 79, "violates": [ "-10**(5) <= k, nums[i] <= 10**(5)" ] }, { "line": 112, "end_line": 112, "violates": [ "-10**(5) <= k, nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "A pivot point splits the array into equal prefix and suffix. If no change is made to the array, the goal is to find the number of pivot p such that prefix[p-1] == suffix[p].", "Consider how prefix and suffix will change when we change a number nums[i] to k.", "When sweeping through each element, can you find the total number of pivots where the difference of prefix and suffix happens to equal to the changes of k-nums[i]." ] }, { "question_id": 2027, "task_id": "minimum-moves-to-convert-string", "drop": [], "similar": [ "minimum-cost-to-convert-string-i", "minimum-cost-to-convert-string-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 166, "kept": 166, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the smallest substring you need to consider at a time.", "Try delaying a move as long as possible." ] }, { "question_id": 2028, "task_id": "find-missing-observations", "drop": [], "similar": [ "number-of-dice-rolls-with-target-sum", "dice-roll-simulation" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "rolls", "mean", "n" ], "tests": { "total": 116, "kept": 113, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 97, "end_line": 97, "violates": [ "1 <= rolls[i], mean <= 6" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= rolls[i], mean <= 6" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= rolls[i], mean <= 6" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "What should the sum of the n rolls be?", "Could you generate an array of size n such that each element is between 1 and 6?" ] }, { "question_id": 2029, "task_id": "stone-game-ix", "drop": [], "similar": [ "stone-game", "stone-game-ii", "stone-game-iii", "stone-game-iv", "stone-game-v", "stone-game-vi", "stone-game-vii", "stone-game-viii", "stone-game-ix" ], "flags": [ "figure_reference" ], "comparison": "exact", "parameter_names": [ "stones" ], "tests": { "total": 108, "kept": 104, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= stones[i] <= 10**(4)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= stones[i] <= 10**(4)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= stones[i] <= 10**(4)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= stones[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "There are limited outcomes given the current sum and the stones remaining.", "Can we greedily simulate starting with taking a stone with remainder 1 or 2 divided by 3?" ] }, { "question_id": 2030, "task_id": "smallest-k-length-subsequence-with-occurrences-of-a-letter", "drop": [], "similar": [ "remove-duplicate-letters", "subarray-with-elements-greater-than-varying-threshold", "find-the-lexicographically-smallest-valid-sequence" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "s", "k", "letter", "repetition" ], "tests": { "total": 45, "kept": 45, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "letter is a lowercase English letter, and appears in s at least repetition times." ], "public_tests": 3, "hints": [ "Use stack. For every character to be appended, decide how many character(s) from the stack needs to get popped based on the stack length and the count of the required character.", "Pop the extra characters out from the stack and return the characters in the stack (reversed)." ], "similar_to_test": [ "3302 find-the-lexicographically-smallest-valid-sequence" ] }, { "question_id": 2031, "task_id": "count-subarrays-with-more-ones-than-zeros", "drop": [ "premium" ] }, { "question_id": 2032, "task_id": "two-out-of-three", "drop": [], "similar": [], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums1", "nums2", "nums3" ], "tests": { "total": 100, "kept": 96, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 62, "end_line": 62, "violates": [ "1 <= nums1[i], nums2[j], nums3[k] <= 100" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums1[i], nums2[j], nums3[k] <= 100" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums1[i], nums2[j], nums3[k] <= 100" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums1[i], nums2[j], nums3[k] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "What data structure can we use to help us quickly find whether an element belongs in an array?", "Can we count the frequencies of the elements in each array?" ] }, { "question_id": 2033, "task_id": "minimum-operations-to-make-a-uni-value-grid", "drop": [], "similar": [ "minimum-moves-to-equal-array-elements-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid", "x" ], "tests": { "total": 95, "kept": 95, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Is it possible to make two integers a and b equal if they have different remainders dividing by x?", "If it is possible, which number should you select to minimize the number of operations?", "What if the elements are sorted?" ] }, { "question_id": 2035, "task_id": "partition-array-into-two-arrays-to-minimize-sum-difference", "drop": [], "similar": [ "partition-equal-subset-sum", "split-array-with-same-average", "tallest-billboard", "last-stone-weight-ii", "fair-distribution-of-cookies", "closest-subsequence-sum", "number-of-ways-to-split-array", "minimum-sum-of-squared-difference", "split-with-minimum-sum" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 88, "kept": 86, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 42, "end_line": 42, "violates": [ "-10**(7) <= nums[i] <= 10**(7)" ] }, { "line": 88, "end_line": 88, "violates": [ "-10**(7) <= nums[i] <= 10**(7)" ] } ], "unchecked_constraints": [ "1 <= n <= 15", "nums.length == 2 * n" ], "public_tests": 3, "hints": [ "The target sum for the two partitions is sum(nums) / 2.", "Could you reduce the time complexity if you arbitrarily divide nums into two halves (two arrays)? Meet-in-the-Middle?", "For both halves, pre-calculate a 2D array where the kth index will store all possible sum values if only k elements from this half are added.", "For each sum of k elements in the first half, find the best sum of n-k elements in the second half such that the two sums add up to a value closest to the target sum from hint 1. These two subsets will form one array of the partition." ] }, { "question_id": 2036, "task_id": "maximum-alternating-subarray-sum", "drop": [ "premium" ] }, { "question_id": 2037, "task_id": "minimum-number-of-moves-to-seat-everyone", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "seats", "students" ], "tests": { "total": 101, "kept": 96, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 53, "end_line": 53, "violates": [ "1 <= seats[i], students[j] <= 100" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= seats[i], students[j] <= 100" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= seats[i], students[j] <= 100" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= seats[i], students[j] <= 100" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= seats[i], students[j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we sort the arrays to help solve the problem?", "Can we greedily match each student to a seat?", "The smallest positioned student will go to the smallest positioned chair, and then the next smallest positioned student will go to the next smallest positioned chair, and so on." ] }, { "question_id": 2038, "task_id": "remove-colored-pieces-if-both-neighbors-are-the-same-color", "drop": [], "similar": [ "longest-subarray-with-maximum-bitwise-and" ], "flags": [], "comparison": "exact", "parameter_names": [ "colors" ], "tests": { "total": 182, "kept": 182, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Does the number of moves a player can make depend on what the other player does? No", "How many moves can Alice make if colors == \"AAAAAA\"", "If a group of n consecutive pieces has the same color, the player can take n - 2 of those pieces if n is greater than or equal to 3" ] }, { "question_id": 2039, "task_id": "the-time-when-the-network-becomes-idle", "drop": [], "similar": [ "network-delay-time", "n-ary-tree-level-order-traversal", "maximum-depth-of-n-ary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges", "patience" ], "tests": { "total": 51, "kept": 51, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= patience[i] <= 10**(5) for 1 <= i < n", "There are no duplicate edges.", "Each server can directly or indirectly reach another server." ], "public_tests": 2, "hints": [ "What method can you use to find the shortest time taken for a message from a data server to reach the master server? How can you use this value and the server's patience value to determine the time at which the server sends its last message?", "What is the time when the last message sent from a server gets back to the server?", "For each data server, by the time the server receives the first returned messages, how many messages has the server sent?" ] }, { "question_id": 2040, "task_id": "kth-smallest-product-of-two-sorted-arrays", "drop": [], "similar": [ "find-k-pairs-with-smallest-sums", "k-diff-pairs-in-an-array", "maximum-number-of-robots-within-budget" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "k" ], "tests": { "total": 108, "kept": 93, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= k <= nums1.length * nums2.length" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= k <= nums1.length * nums2.length" ] } ], "unchecked_constraints": [ "nums1 and nums2 are sorted." ], "public_tests": 3, "hints": [ "Can we split this problem into four cases depending on the sign of the numbers?", "Can we binary search the value?" ] }, { "question_id": 2042, "task_id": "check-if-numbers-are-ascending-in-a-sentence", "drop": [], "similar": [ "string-to-integer-atoi", "sorting-the-sentence", "check-if-all-as-appears-before-all-bs" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 204, "kept": 204, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of tokens in s is between 2 and 100, inclusive.", "The tokens in s are separated by a single space.", "There are at least two numbers in s.", "Each number in s is a positive number less than 100, with no leading zeros.", "s contains no leading or trailing spaces." ], "public_tests": 3, "hints": [ "Use string tokenization of your language to extract all the tokens of the string easily.", "For each token extracted, how can you tell if it is a number? Does the first letter being a digit mean something?", "Compare the number with the previously occurring number to check if ascending order is maintained." ] }, { "question_id": 2044, "task_id": "count-number-of-maximum-bitwise-or-subsets", "drop": [], "similar": [ "subsets", "largest-combination-with-bitwise-and-greater-than-zero", "longest-subarray-with-maximum-bitwise-and" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 113, "kept": 107, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= nums.length <= 16" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we enumerate all possible subsets?", "The maximum bitwise-OR is the bitwise-OR of the whole array." ] }, { "question_id": 2045, "task_id": "second-minimum-time-to-reach-destination", "drop": [], "similar": [ "network-delay-time", "find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance", "number-of-ways-to-arrive-at-destination" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "time", "change" ], "tests": { "total": 84, "kept": 84, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There are no duplicate edges.", "Each vertex can be reached directly or indirectly from every other vertex." ], "public_tests": 2, "hints": [ "How much is change actually necessary while calculating the required path?", "How many extra edges do we need to add to the shortest path?" ] }, { "question_id": 2046, "task_id": "sort-linked-list-already-sorted-using-absolute-values", "drop": [ "premium" ] }, { "question_id": 2047, "task_id": "number-of-valid-words-in-a-sentence", "drop": [], "similar": [ "maximum-number-of-words-found-in-sentences" ], "flags": [], "comparison": "exact", "parameter_names": [ "sentence" ], "tests": { "total": 377, "kept": 377, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "sentence only contains lowercase English letters, digits, ' ', '-', '!', '.', and ','.", "There will be at least 1 token." ], "public_tests": 3, "hints": [ "Iterate through the string to split it by spaces.", "Count the number of characters of each type (letters, numbers, hyphens, and punctuations)." ] }, { "question_id": 2048, "task_id": "next-greater-numerically-balanced-number", "drop": [], "similar": [ "find-the-width-of-columns-of-a-grid" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 58, "kept": 23, "dropped": { "constraint_violation": 35 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 15, "end_line": 15, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 18, "end_line": 18, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 55, "end_line": 55, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= n <= 10**(6)" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= n <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "How far away can the next greater numerically balanced number be from n?", "With the given constraints, what is the largest numerically balanced number?" ] }, { "question_id": 2049, "task_id": "count-nodes-with-the-highest-score", "drop": [], "similar": [ "sum-of-distances-in-tree", "delete-nodes-and-return-forest", "maximum-product-of-splitted-binary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "parents" ], "tests": { "total": 79, "kept": 79, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= parents[i] <= n - 1 for i != 0", "parents represents a valid binary tree." ], "public_tests": 2, "hints": [ "For each node, you need to find the sizes of the subtrees rooted in each of its children. Maybe DFS?", "How to determine the number of nodes in the rest of the tree? Can you subtract the size of the subtree rooted at the node from the total number of nodes of the tree?", "Use these values to compute the score of the node. Track the maximum score, and how many nodes achieve such score." ] }, { "question_id": 2050, "task_id": "parallel-courses-iii", "drop": [], "similar": [ "course-schedule-iii", "parallel-courses", "single-threaded-cpu", "process-tasks-using-servers", "maximum-employees-to-be-invited-to-a-meeting" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "relations", "time" ], "tests": { "total": 60, "kept": 60, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= prevCoursej, nextCoursej <= n", "prevCoursej != nextCoursej", "All the pairs [prevCoursej, nextCoursej] are unique.", "The given graph is a directed acyclic graph." ], "public_tests": 2, "hints": [ "What is the earliest time a course can be taken?", "How would you solve the problem if all courses take equal time?", "How would you generalize this approach?" ] }, { "question_id": 2052, "task_id": "minimum-cost-to-separate-sentence-into-rows", "drop": [ "premium" ] }, { "question_id": 2053, "task_id": "kth-distinct-string-in-an-array", "drop": [], "similar": [ "count-common-words-with-one-occurrence" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "k" ], "tests": { "total": 110, "kept": 54, "dropped": { "constraint_violation": 56 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= k <= arr.length <= 1000", "1 <= arr[i].length <= 5" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= arr[i].length <= 5", "arr[i] consists of lowercase English letters." ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= k <= arr.length <= 1000" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= k <= arr.length <= 1000", "1 <= arr[i].length <= 5" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= k <= arr.length <= 1000" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= arr[i].length <= 5" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= arr[i].length <= 5" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try 'mapping' the strings to check if they are unique or not." ] }, { "question_id": 2054, "task_id": "two-best-non-overlapping-events", "drop": [], "similar": [ "maximum-profit-in-job-scheduling", "maximum-number-of-events-that-can-be-attended-ii", "maximize-win-from-two-segments", "maximum-score-of-non-overlapping-intervals" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "events" ], "tests": { "total": 97, "kept": 90, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= valuei <= 10**(6)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= valuei <= 10**(6)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= valuei <= 10**(6)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= startTimei <= endTimei <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= valuei <= 10**(6)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= startTimei <= endTimei <= 10**(9)", "1 <= valuei <= 10**(6)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= startTimei <= endTimei <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "How can sorting the events on the basis of their start times help? How about end times?", "How can we quickly get the maximum score of an interval not intersecting with the interval we chose?" ] }, { "question_id": 2055, "task_id": "plates-between-candles", "drop": [], "similar": [ "find-first-and-last-position-of-element-in-sorted-array", "can-make-palindrome-from-substring" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "s", "queries" ], "tests": { "total": 13, "kept": 13, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can you find the indices of the most left and right candles for a given substring, perhaps by using binary search (or better) over an array of indices of all the bars?", "Once the indices of the most left and right bars are determined, how can you efficiently count the number of plates within the range? Prefix sums?" ] }, { "question_id": 2056, "task_id": "number-of-valid-move-combinations-on-chessboard", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "pieces", "positions" ], "tests": { "total": 100, "kept": 99, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 85, "end_line": 85, "violates": [ "1 <= n <= 4" ] } ], "unchecked_constraints": [ "pieces only contains the strings \"rook\", \"queen\", and \"bishop\".", "There will be at most one queen on the chessboard.", "Each positions[i] is distinct." ], "public_tests": 3, "hints": [ "N is small, we can generate all possible move combinations.", "For each possible move combination, determine which ones are valid." ] }, { "question_id": 2057, "task_id": "smallest-index-with-equal-value", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 98, "kept": 86, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 12, "end_line": 12, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= nums[i] <= 9" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Starting with i=0, check the condition for each index. The first one you find to be true is the smallest index." ] }, { "question_id": 2058, "task_id": "find-the-minimum-and-maximum-number-of-nodes-between-critical-points", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 117, "kept": 0, "dropped": { "unreadable": 117 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true }, { "line": 102, "end_line": 102, "unreadable": true }, { "line": 103, "end_line": 103, "unreadable": true }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 105, "end_line": 105, "unreadable": true }, { "line": 106, "end_line": 106, "unreadable": true }, { "line": 107, "end_line": 107, "unreadable": true }, { "line": 108, "end_line": 108, "unreadable": true }, { "line": 109, "end_line": 109, "unreadable": true }, { "line": 110, "end_line": 110, "unreadable": true }, { "line": 111, "end_line": 111, "unreadable": true }, { "line": 112, "end_line": 112, "unreadable": true }, { "line": 113, "end_line": 113, "unreadable": true }, { "line": 114, "end_line": 114, "unreadable": true }, { "line": 115, "end_line": 115, "unreadable": true }, { "line": 116, "end_line": 116, "unreadable": true }, { "line": 117, "end_line": 117, "unreadable": true }, { "line": 118, "end_line": 118, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is in the range [2, 10**(5)].", "1 <= Node.val <= 10**(5)" ] }, { "question_id": 2059, "task_id": "minimum-operations-to-convert-number", "drop": [], "similar": [ "minimum-operations-to-reduce-x-to-zero" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "start", "goal" ], "tests": { "total": 134, "kept": 119, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "start != goal" ] }, { "line": 6, "end_line": 6, "violates": [ "All the integers in nums are distinct." ] }, { "line": 13, "end_line": 13, "violates": [ "start != goal" ] }, { "line": 18, "end_line": 18, "violates": [ "All the integers in nums are distinct." ] }, { "line": 23, "end_line": 23, "violates": [ "start != goal" ] }, { "line": 29, "end_line": 29, "violates": [ "All the integers in nums are distinct." ] }, { "line": 45, "end_line": 45, "violates": [ "All the integers in nums are distinct." ] }, { "line": 55, "end_line": 55, "violates": [ "All the integers in nums are distinct." ] }, { "line": 81, "end_line": 81, "violates": [ "All the integers in nums are distinct." ] }, { "line": 89, "end_line": 89, "violates": [ "All the integers in nums are distinct." ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= start <= 1000" ] }, { "line": 95, "end_line": 95, "violates": [ "All the integers in nums are distinct." ] }, { "line": 119, "end_line": 119, "violates": [ "All the integers in nums are distinct." ] }, { "line": 128, "end_line": 128, "violates": [ "All the integers in nums are distinct." ] }, { "line": 130, "end_line": 130, "violates": [ "All the integers in nums are distinct." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Once x drops below 0 or goes above 1000, is it possible to continue performing operations on x?", "How can you use BFS to find the minimum operations?" ] }, { "question_id": 2060, "task_id": "check-if-an-original-string-exists-given-two-encoded-strings", "drop": [], "similar": [ "valid-word-abbreviation", "check-if-two-string-arrays-are-equivalent" ], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "s2" ], "tests": { "total": 195, "kept": 151, "dropped": { "constraint_violation": 44 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 125, "end_line": 125, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 129, "end_line": 129, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 130, "end_line": 130, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 145, "end_line": 145, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 147, "end_line": 147, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 149, "end_line": 149, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 155, "end_line": 155, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 165, "end_line": 165, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 168, "end_line": 168, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 169, "end_line": 169, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 172, "end_line": 172, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 179, "end_line": 179, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 181, "end_line": 181, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 182, "end_line": 182, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 185, "end_line": 185, "violates": [ "1 <= s1.length, s2.length <= 40" ] }, { "line": 195, "end_line": 195, "violates": [ "1 <= s1.length, s2.length <= 40" ] } ], "unchecked_constraints": [ "The number of consecutive digits in s1 and s2 does not exceed 3." ], "public_tests": 3, "hints": [ "For s1 and s2, divide each into a sequence of single alphabet strings and digital strings. The problem now becomes comparing if two sequences are equal.", "A single alphabet string has no variation, but a digital string has variations. For example: \"124\" can be interpreted as 1+2+4, 12+4, 1+24, and 124 wildcard characters.", "There are four kinds of comparisons: a single alphabet vs another; a single alphabet vs a number, a number vs a single alphabet, and a number vs another number. In the case of a number vs another (a single alphabet or a number), can you decrease the number by the min length of both?", "There is a recurrence relation in the search which ends when either a single alphabet != another, or one sequence ran out, or both sequences ran out." ] }, { "question_id": 2061, "task_id": "number-of-spaces-cleaning-robot-cleaned", "drop": [ "premium" ] }, { "question_id": 2062, "task_id": "count-vowel-substrings-of-a-string", "drop": [], "similar": [ "number-of-matching-subsequences", "subarrays-with-k-different-integers", "number-of-substrings-with-only-1s", "longest-substring-of-all-vowels-in-order", "total-appeal-of-a-string", "count-of-substrings-containing-every-vowel-and-k-consonants-ii", "count-of-substrings-containing-every-vowel-and-k-consonants-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 110, "kept": 109, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 69, "end_line": 69, "violates": [ "1 <= word.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "While generating substrings starting at any index, do you need to continue generating larger substrings if you encounter a consonant?", "Can you store the count of characters to avoid generating substrings altogether?" ], "similar_to_test": [ "3305 count-of-substrings-containing-every-vowel-and-k-consonants-i", "3306 count-of-substrings-containing-every-vowel-and-k-consonants-ii" ] }, { "question_id": 2063, "task_id": "vowels-of-all-substrings", "drop": [], "similar": [ "number-of-substrings-containing-all-three-characters", "total-appeal-of-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 80, "kept": 79, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= word.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Since generating substrings is not an option, can we count the number of substrings a vowel appears in?", "How much does each vowel contribute to the total sum?" ] }, { "question_id": 2064, "task_id": "minimized-maximum-of-products-distributed-to-any-store", "drop": [], "similar": [ "koko-eating-bananas", "capacity-to-ship-packages-within-d-days", "maximum-candies-allocated-to-k-children", "find-the-smallest-divisor-given-a-threshold", "magnetic-force-between-two-balls", "minimum-limit-of-balls-in-a-bag", "minimum-time-to-complete-trips", "maximum-number-of-robots-within-budget" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "quantities" ], "tests": { "total": 108, "kept": 98, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= quantities[i] <= 10**(5)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= quantities[i] <= 10**(5)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= quantities[i] <= 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= quantities[i] <= 10**(5)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= m <= n <= 10**(5)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= quantities[i] <= 10**(5)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= quantities[i] <= 10**(5)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= quantities[i] <= 10**(5)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= quantities[i] <= 10**(5)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= quantities[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "There exists a monotonic nature such that when x is smaller than some number, there will be no way to distribute, and when x is not smaller than that number, there will always be a way to distribute.", "If you are given a number k, where the number of products given to any store does not exceed k, could you determine if all products can be distributed?", "Implement a function canDistribute(k), which returns true if you can distribute all products such that any store will not be given more than k products, and returns false if you cannot. Use this function to binary search for the smallest possible k." ] }, { "question_id": 2065, "task_id": "maximum-path-quality-of-a-graph", "drop": [], "similar": [ "cherry-pickup", "minimum-cost-to-reach-destination-in-time" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "values", "edges", "maxTime" ], "tests": { "total": 89, "kept": 88, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 73, "end_line": 73, "violates": [ "0 <= values[i] <= 10**(8)" ] } ], "unchecked_constraints": [ "0 <= uj < vj <= n - 1", "10 <= timej, maxTime <= 100", "All the pairs [uj, vj] are unique.", "There are at most four edges connected to each node.", "The graph may not be connected." ], "public_tests": 3, "hints": [ "How many nodes can you visit within maxTime seconds?", "Can you try every valid path?" ] }, { "question_id": 2067, "task_id": "number-of-equal-count-substrings", "drop": [ "premium" ] }, { "question_id": 2068, "task_id": "check-whether-two-strings-are-almost-equivalent", "drop": [], "similar": [ "find-the-occurrence-of-first-almost-equal-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "word1", "word2" ], "tests": { "total": 148, "kept": 83, "dropped": { "constraint_violation": 65 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "n == word1.length == word2.length" ] }, { "line": 29, "end_line": 29, "violates": [ "n == word1.length == word2.length" ] }, { "line": 31, "end_line": 31, "violates": [ "word1 and word2 consist only of lowercase English letters." ] }, { "line": 33, "end_line": 33, "violates": [ "n == word1.length == word2.length" ] }, { "line": 35, "end_line": 35, "violates": [ "n == word1.length == word2.length" ] }, { "line": 36, "end_line": 36, "violates": [ "n == word1.length == word2.length" ] }, { "line": 37, "end_line": 37, "violates": [ "n == word1.length == word2.length" ] }, { "line": 39, "end_line": 39, "violates": [ "n == word1.length == word2.length" ] }, { "line": 40, "end_line": 40, "violates": [ "n == word1.length == word2.length" ] }, { "line": 43, "end_line": 43, "violates": [ "n == word1.length == word2.length" ] }, { "line": 45, "end_line": 45, "violates": [ "n == word1.length == word2.length" ] }, { "line": 48, "end_line": 48, "violates": [ "n == word1.length == word2.length" ] }, { "line": 49, "end_line": 49, "violates": [ "n == word1.length == word2.length" ] }, { "line": 50, "end_line": 50, "violates": [ "n == word1.length == word2.length" ] }, { "line": 51, "end_line": 51, "violates": [ "n == word1.length == word2.length" ] }, { "line": 52, "end_line": 52, "violates": [ "n == word1.length == word2.length" ] }, { "line": 54, "end_line": 54, "violates": [ "n == word1.length == word2.length" ] }, { "line": 55, "end_line": 55, "violates": [ "n == word1.length == word2.length" ] }, { "line": 60, "end_line": 60, "violates": [ "n == word1.length == word2.length" ] }, { "line": 61, "end_line": 61, "violates": [ "n == word1.length == word2.length" ] }, { "line": 63, "end_line": 63, "violates": [ "n == word1.length == word2.length" ] }, { "line": 65, "end_line": 65, "violates": [ "n == word1.length == word2.length" ] }, { "line": 67, "end_line": 67, "violates": [ "n == word1.length == word2.length" ] }, { "line": 70, "end_line": 70, "violates": [ "n == word1.length == word2.length" ] }, { "line": 71, "end_line": 71, "violates": [ "n == word1.length == word2.length" ] }, { "line": 72, "end_line": 72, "violates": [ "n == word1.length == word2.length" ] }, { "line": 73, "end_line": 73, "violates": [ "n == word1.length == word2.length" ] }, { "line": 74, "end_line": 74, "violates": [ "n == word1.length == word2.length" ] }, { "line": 76, "end_line": 76, "violates": [ "n == word1.length == word2.length" ] }, { "line": 77, "end_line": 77, "violates": [ "n == word1.length == word2.length" ] }, { "line": 78, "end_line": 78, "violates": [ "n == word1.length == word2.length" ] }, { "line": 80, "end_line": 80, "violates": [ "n == word1.length == word2.length" ] }, { "line": 81, "end_line": 81, "violates": [ "n == word1.length == word2.length" ] }, { "line": 83, "end_line": 83, "violates": [ "n == word1.length == word2.length" ] }, { "line": 84, "end_line": 84, "violates": [ "n == word1.length == word2.length" ] }, { "line": 85, "end_line": 85, "violates": [ "n == word1.length == word2.length" ] }, { "line": 91, "end_line": 91, "violates": [ "n == word1.length == word2.length" ] }, { "line": 93, "end_line": 93, "violates": [ "n == word1.length == word2.length" ] }, { "line": 96, "end_line": 96, "violates": [ "n == word1.length == word2.length" ] }, { "line": 101, "end_line": 101, "violates": [ "n == word1.length == word2.length" ] }, { "line": 102, "end_line": 102, "violates": [ "n == word1.length == word2.length" ] }, { "line": 103, "end_line": 103, "violates": [ "n == word1.length == word2.length" ] }, { "line": 104, "end_line": 104, "violates": [ "n == word1.length == word2.length" ] }, { "line": 105, "end_line": 105, "violates": [ "n == word1.length == word2.length" ] }, { "line": 106, "end_line": 106, "violates": [ "n == word1.length == word2.length" ] }, { "line": 109, "end_line": 109, "violates": [ "n == word1.length == word2.length" ] }, { "line": 110, "end_line": 110, "violates": [ "n == word1.length == word2.length", "word1 and word2 consist only of lowercase English letters." ] }, { "line": 115, "end_line": 115, "violates": [ "n == word1.length == word2.length", "word1 and word2 consist only of lowercase English letters." ] }, { "line": 119, "end_line": 119, "violates": [ "n == word1.length == word2.length" ] }, { "line": 122, "end_line": 122, "violates": [ "n == word1.length == word2.length" ] }, { "line": 123, "end_line": 123, "violates": [ "n == word1.length == word2.length" ] }, { "line": 124, "end_line": 124, "violates": [ "n == word1.length == word2.length" ] }, { "line": 127, "end_line": 127, "violates": [ "n == word1.length == word2.length" ] }, { "line": 128, "end_line": 128, "violates": [ "n == word1.length == word2.length" ] }, { "line": 129, "end_line": 129, "violates": [ "n == word1.length == word2.length" ] }, { "line": 130, "end_line": 130, "violates": [ "n == word1.length == word2.length" ] }, { "line": 132, "end_line": 132, "violates": [ "n == word1.length == word2.length" ] }, { "line": 133, "end_line": 133, "violates": [ "n == word1.length == word2.length" ] }, { "line": 134, "end_line": 134, "violates": [ "n == word1.length == word2.length" ] }, { "line": 140, "end_line": 140, "violates": [ "n == word1.length == word2.length" ] }, { "line": 141, "end_line": 141, "violates": [ "n == word1.length == word2.length", "1 <= n <= 100" ] }, { "line": 143, "end_line": 143, "violates": [ "n == word1.length == word2.length" ] }, { "line": 144, "end_line": 144, "violates": [ "n == word1.length == word2.length" ] }, { "line": 145, "end_line": 145, "violates": [ "n == word1.length == word2.length" ] }, { "line": 149, "end_line": 149, "violates": [ "n == word1.length == word2.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "What data structure can we use to count the frequency of each character?", "Are there edge cases where a character is present in one string but not the other?" ], "similar_to_test": [ "3303 find-the-occurrence-of-first-almost-equal-substring" ] }, { "question_id": 2070, "task_id": "most-beautiful-item-for-each-query", "drop": [], "similar": [ "closest-room", "find-the-score-of-all-prefixes-of-an-array", "maximum-sum-queries" ], "flags": [], "comparison": "exact", "parameter_names": [ "items", "queries" ], "tests": { "total": 106, "kept": 100, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= pricei, beautyi, queries[j] <= 10**(9)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= pricei, beautyi, queries[j] <= 10**(9)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= pricei, beautyi, queries[j] <= 10**(9)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= pricei, beautyi, queries[j] <= 10**(9)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= pricei, beautyi, queries[j] <= 10**(9)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= pricei, beautyi, queries[j] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we process the queries in a smart order to avoid repeatedly checking the same items?", "How can we use the answer to a query for other queries?" ] }, { "question_id": 2071, "task_id": "maximum-number-of-tasks-you-can-assign", "drop": [], "similar": [ "most-profit-assigning-work", "maximum-running-time-of-n-computers", "maximum-number-of-robots-within-budget", "maximum-matching-of-players-with-trainers", "maximize-the-minimum-powered-city" ], "flags": [], "comparison": "exact", "parameter_names": [ "tasks", "workers", "pills", "strength" ], "tests": { "total": 119, "kept": 119, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Is it possible to assign the first k smallest tasks to the workers?", "How can you efficiently try every k?" ] }, { "question_id": 2073, "task_id": "time-needed-to-buy-tickets", "drop": [], "similar": [ "number-of-students-unable-to-eat-lunch" ], "flags": [], "comparison": "exact", "parameter_names": [ "tickets", "k" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Loop through the line of people and decrement the number of tickets for each to buy one at a time as if simulating the line moving forward. Keep track of how many tickets have been sold up until person k has no more tickets to buy.", "Remember that those who have no more tickets to buy will leave the line." ] }, { "question_id": 2074, "task_id": "reverse-nodes-in-even-length-groups", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "reverse-nodes-in-k-group", "reverse-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the list is in the range [1, 10**(5)].", "0 <= Node.val <= 10**(5)" ] }, { "question_id": 2075, "task_id": "decode-the-slanted-ciphertext", "drop": [], "similar": [ "diagonal-traverse" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "encodedText", "rows" ], "tests": { "total": 112, "kept": 111, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 73, "end_line": 73, "violates": [ "encodedText consists of lowercase English letters and ' ' only." ] } ], "unchecked_constraints": [ "encodedText is a valid encoding of some originalText that does not have trailing spaces.", "The testcases are generated such that there is only one possible originalText." ], "public_tests": 3, "hints": [ "How can you use rows and encodedText to find the number of columns of the matrix?", "Once you have the number of rows and columns, you can create the matrix and place encodedText in it. How should you place it in the matrix?", "How should you traverse the matrix to \"decode\" originalText?" ] }, { "question_id": 2076, "task_id": "process-restricted-friend-requests", "drop": [], "similar": [ "number-of-islands-ii", "smallest-string-with-swaps", "maximum-employees-to-be-invited-to-a-meeting" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "restrictions", "requests" ], "tests": { "total": 72, "kept": 72, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= uj, vj <= n - 1", "uj != vj" ], "public_tests": 3, "hints": [ "For each request, we could loop through all restrictions. Can you think of doing a check-in close to O(1)?", "Could you use Union Find?" ] }, { "question_id": 2077, "task_id": "paths-in-maze-that-lead-to-same-room", "drop": [ "premium" ] }, { "question_id": 2078, "task_id": "two-furthest-houses-with-different-colors", "drop": [], "similar": [ "replace-elements-with-greatest-element-on-right-side", "maximum-distance-between-a-pair-of-values", "maximum-difference-between-increasing-elements" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "colors" ], "tests": { "total": 90, "kept": 90, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Test data are generated such that at least two houses have different colors." ], "public_tests": 3, "hints": [ "The constraints are small. Can you try the combination of every two houses?", "Greedily, the maximum distance will come from either the pair of the leftmost house and possibly some house on the right with a different color, or the pair of the rightmost house and possibly some house on the left with a different color." ] }, { "question_id": 2079, "task_id": "watering-plants", "drop": [], "similar": [ "watering-plants-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "plants", "capacity" ], "tests": { "total": 84, "kept": 84, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "max(plants[i]) <= capacity <= 10**(9)" ], "public_tests": 3, "hints": [ "Simulate the process.", "Return to refill the container once you meet a plant that needs more water than you have." ] }, { "question_id": 2081, "task_id": "sum-of-k-mirror-numbers", "drop": [], "similar": [ "strobogrammatic-number-ii", "prime-palindrome" ], "flags": [], "comparison": "exact", "parameter_names": [ "k", "n" ], "tests": { "total": 59, "kept": 57, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= n <= 30" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= n <= 30" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Since we need to reduce search space, instead of checking if every number is a palindrome in base-10, can we try to \"generate\" the palindromic numbers?", "If you are provided with a d digit number, how can you generate a palindrome with 2*d or 2*d - 1 digit?", "Try brute-forcing and checking if the palindrome you generated is a \"k-Mirror\" number." ] }, { "question_id": 2083, "task_id": "substrings-that-begin-and-end-with-the-same-letter", "drop": [ "premium" ] }, { "question_id": 2085, "task_id": "count-common-words-with-one-occurrence", "drop": [], "similar": [ "intersection-of-two-arrays", "uncommon-words-from-two-sentences", "kth-distinct-string-in-an-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "words1", "words2" ], "tests": { "total": 103, "kept": 100, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "words1[i] and words2[j] consists only of lowercase English letters." ] }, { "line": 16, "end_line": 16, "violates": [ "words1[i] and words2[j] consists only of lowercase English letters." ] }, { "line": 67, "end_line": 67, "violates": [ "words1[i] and words2[j] consists only of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Could you try every word?", "Could you use a hash map to achieve a good complexity?" ] }, { "question_id": 2086, "task_id": "minimum-number-of-food-buckets-to-feed-the-hamsters", "drop": [], "similar": [ "maximum-number-of-people-that-can-be-caught-in-tag", "brightest-position-on-street" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "hamsters" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "hamsters[i] is either'H' or '.'." ], "public_tests": 3, "hints": [ "When is it impossible to feed all the hamsters?", "When one or more hamsters do not have an empty space adjacent to it.", "Assuming all previous hamsters are fed. If there is a hamster at index i and you are able to place a bucket at index i - 1 or i + 1, where should you put it?", "It is always better to place a bucket at index i + 1 because it can feed the next hamster as well." ] }, { "question_id": 2087, "task_id": "minimum-cost-homecoming-of-a-robot-in-a-grid", "drop": [], "similar": [ "unique-paths", "minimum-path-sum", "bomb-enemy", "count-square-submatrices-with-all-ones", "paths-in-matrix-whose-sum-is-divisible-by-k", "check-if-there-is-a-path-with-equal-number-of-0s-and-1s" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "startPos", "homePos", "rowCosts", "colCosts" ], "tests": { "total": 80, "kept": 80, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= startrow, homerow < m", "0 <= startcol, homecol < n" ], "public_tests": 2, "hints": [ "Irrespective of what path the robot takes, it will have to traverse all the rows between startRow and homeRow and all the columns between startCol and homeCol.", "Hence, making any other move other than traversing the required rows and columns will potentially incur more cost which can be avoided." ] }, { "question_id": 2088, "task_id": "count-fertile-pyramids-in-a-land", "drop": [], "similar": [ "count-square-submatrices-with-all-ones", "get-biggest-three-rhombus-sums-in-a-grid" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 74, "kept": 74, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think about how dynamic programming can help solve the problem.", "For any fixed cell (r, c), can you calculate the maximum height of the pyramid for which it is the apex? Let us denote this value as dp[r][c].", "How will the values at dp[r+1][c-1] and dp[r+1][c+1] help in determining the value at dp[r][c]?", "For the cell (r, c), is there a relation between the number of pyramids for which it serves as the apex and dp[r][c]? How does it help in calculating the answer?" ] }, { "question_id": 2089, "task_id": "find-target-indices-after-sorting-array", "drop": [], "similar": [ "find-first-and-last-position-of-element-in-sorted-array", "rank-transform-of-an-array", "find-words-containing-character" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 118, "kept": 115, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= nums[i], target <= 100" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i], target <= 100" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= nums[i], target <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try \"sorting\" the array first.", "Now find all indices in the array whose values are equal to target." ] }, { "question_id": 2090, "task_id": "k-radius-subarray-averages", "drop": [], "similar": [ "minimum-size-subarray-sum", "moving-average-from-data-stream", "subarray-sum-equals-k", "maximum-average-subarray-i", "number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold", "find-the-grid-of-region-average" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 94, "kept": 94, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "To calculate the average of a subarray, you need the sum and the K. K is already given. How could you quickly calculate the sum of a subarray?", "Use the Prefix Sums method to calculate the subarray sums.", "It is possible that the sum of all the elements does not fit in a 32-bit integer type. Be sure to use a 64-bit integer type for the prefix sum array." ] }, { "question_id": 2091, "task_id": "removing-minimum-and-maximum-from-array", "drop": [], "similar": [ "maximum-points-you-can-obtain-from-cards", "minimum-deletions-to-make-character-frequencies-unique" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 102, "kept": 102, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The integers in nums are distinct." ], "public_tests": 3, "hints": [ "There can only be three scenarios for deletions such that both minimum and maximum elements are removed:", "Scenario 1: Both elements are removed by only deleting from the front.", "Scenario 2: Both elements are removed by only deleting from the back.", "Scenario 3: Delete from the front to remove one of the elements, and delete from the back to remove the other element.", "Compare which of the three scenarios results in the minimum number of moves." ] }, { "question_id": 2092, "task_id": "find-all-people-with-secret", "drop": [], "similar": [ "reachable-nodes-in-subdivided-graph" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "n", "meetings", "firstPerson" ], "tests": { "total": 84, "kept": 80, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "1 <= firstPerson <= n - 1" ] }, { "line": 42, "end_line": 42, "violates": [ "xi != yi" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= firstPerson <= n - 1" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= firstPerson <= n - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Could you model all the meetings happening at the same time as a graph?", "What data structure can you use to efficiently share the secret?", "You can use the union-find data structure to quickly determine who knows the secret and share the secret." ] }, { "question_id": 2093, "task_id": "minimum-cost-to-reach-city-with-discounts", "drop": [ "premium" ] }, { "question_id": 2094, "task_id": "finding-3-digit-even-numbers", "drop": [], "similar": [ "find-numbers-with-even-number-of-digits", "unique-3-digit-even-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "digits" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The range of possible answers includes all even numbers between 100 and 999 inclusive. Could you check each possible answer to see if it could be formed from the digits in the array?" ], "similar_to_test": [ "3483 unique-3-digit-even-numbers" ] }, { "question_id": 2095, "task_id": "delete-the-middle-node-of-a-linked-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "remove-nth-node-from-end-of-list", "reorder-list", "remove-linked-list-elements", "middle-of-the-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 2, "kept": 0, "dropped": { "unreadable": 2 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is in the range [1, 10**(5)].", "1 <= Node.val <= 10**(5)" ] }, { "question_id": 2096, "task_id": "step-by-step-directions-from-a-binary-tree-node-to-another", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "path-sum-ii", "lowest-common-ancestor-of-a-binary-tree", "binary-tree-paths", "find-distance-in-a-binary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "startValue", "destValue" ], "tests": { "total": 84, "kept": 0, "dropped": { "unreadable": 84 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is n.", "2 <= n <= 10**(5)", "1 <= Node.val <= n", "All the values in the tree are unique.", "1 <= startValue, destValue <= n" ] }, { "question_id": 2097, "task_id": "valid-arrangement-of-pairs", "drop": [], "similar": [ "reconstruct-itinerary", "find-if-path-exists-in-graph" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "pairs" ], "tests": { "total": 79, "kept": 79, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "No two pairs are exactly the same.", "There exists a valid arrangement of pairs." ], "public_tests": 3, "hints": [ "Could you convert this into a graph problem?", "Consider the pairs as edges and each number as a node.", "We have to find an Eulerian path of this graph. Hierholzer\u2019s algorithm can be used." ] }, { "question_id": 2098, "task_id": "subsequence-of-size-k-with-the-largest-even-sum", "drop": [ "premium" ] }, { "question_id": 2099, "task_id": "find-subsequence-of-length-k-with-the-largest-sum", "drop": [], "similar": [ "kth-largest-element-in-an-array", "maximize-sum-of-array-after-k-negations", "sort-integers-by-the-number-of-1-bits", "minimum-difference-in-sums-after-removal-of-elements" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 99, "kept": 98, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "-10**(5) <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "From a greedy perspective, what k elements should you pick?", "Could you sort the array while maintaining the index?" ] }, { "question_id": 2100, "task_id": "find-good-days-to-rob-the-bank", "drop": [], "similar": [ "non-decreasing-array", "longest-mountain-in-array", "find-in-mountain-array", "maximum-ascending-subarray-sum", "find-all-good-indices" ], "flags": [], "comparison": "exact", "parameter_names": [ "security", "time" ], "tests": { "total": 123, "kept": 123, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The trivial solution is to check the time days before and after each day. There are a lot of repeated operations using this solution. How could we optimize this solution?", "We can use precomputation to make the solution faster.", "Use an array to store the number of days before the i^th day that is non-increasing, and another array to store the number of days after the i^th day that is non-decreasing." ] }, { "question_id": 2101, "task_id": "detonate-the-maximum-bombs", "drop": [], "similar": [ "minesweeper", "number-of-provinces", "max-area-of-island", "rotting-oranges" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "bombs" ], "tests": { "total": 115, "kept": 98, "dropped": { "constraint_violation": 17 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= xi, yi, ri <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "How can we model the relationship between different bombs? Can \"graphs\" help us?", "Bombs are nodes and are connected to other bombs in their range by directed edges.", "If we know which bombs will be affected when any bomb is detonated, how can we find the total number of bombs that will be detonated if we start from a fixed bomb?", "Run a Depth First Search (DFS) from every node, and all the nodes it reaches are the bombs that will be detonated." ] }, { "question_id": 2103, "task_id": "rings-and-rods", "drop": [], "similar": [ "check-if-all-characters-have-equal-number-of-occurrences" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "rings" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "rings.length == 2 * n", "1 <= n <= 100", "rings[i] where i is even is either 'R', 'G', or 'B' (0-indexed).", "rings[i] where i is odd is a digit from '0' to '9' (0-indexed)." ], "public_tests": 3, "hints": [ "For every rod, look through \u2018rings\u2019 to see if the rod contains all colors.", "Create 3 booleans, 1 for each color, to store if that color is present for the current rod. If all 3 are true after looking through the string, then the rod contains all the colors." ] }, { "question_id": 2104, "task_id": "sum-of-subarray-ranges", "drop": [], "similar": [ "next-greater-element-i", "sum-of-subarray-minimums", "number-of-visible-people-in-a-queue", "count-number-of-homogenous-substrings", "sum-of-total-strength-of-wizards" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 127, "kept": 127, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can you get the max/min of a certain subarray by using the max/min of a smaller subarray within it?", "Notice that the max of the subarray from index i to j is equal to max of (max of the subarray from index i to j-1) and nums[j]." ] }, { "question_id": 2105, "task_id": "watering-plants-ii", "drop": [], "similar": [ "watering-plants" ], "flags": [], "comparison": "exact", "parameter_names": [ "plants", "capacityA", "capacityB" ], "tests": { "total": 104, "kept": 103, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 76, "end_line": 76, "violates": [ "1 <= plants[i] <= 10**(6)" ] } ], "unchecked_constraints": [ "max(plants[i]) <= capacityA, capacityB <= 10**(9)" ], "public_tests": 3, "hints": [ "Try \"simulating\" the process.", "Since watering each plant takes the same amount of time, where will Alice and Bob meet if they start watering the plants simultaneously? How can you use this to optimize your solution?", "What will you do when both Alice and Bob have to water the same plant?" ] }, { "question_id": 2106, "task_id": "maximum-fruits-harvested-after-at-most-k-steps", "drop": [], "similar": [ "maximum-performance-of-a-team" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "fruits", "startPos", "k" ], "tests": { "total": 114, "kept": 114, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "positioni-1 < positioni for any i > 0 (0-indexed)" ], "public_tests": 3, "hints": [ "Does an optimal path have very few patterns? For example, could a path that goes left, turns and goes right, then turns again and goes left be any better than a path that simply goes left, turns, and goes right?", "The optimal path turns at most once. That is, the optimal path is one of these: to go left only; to go right only; to go left, turn and go right; or to go right, turn and go left.", "Moving x steps left then k-x steps right gives you a range of positions that you can reach.", "Use prefix sums to get the sum of all fruits for each possible range.", "Use a similar strategy for all the paths that go right, then turn and go left." ] }, { "question_id": 2107, "task_id": "number-of-unique-flavors-after-sharing-k-candies", "drop": [ "premium" ] }, { "question_id": 2108, "task_id": "find-first-palindromic-string-in-the-array", "drop": [], "similar": [ "valid-palindrome" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 104, "kept": 101, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "words[i] consists only of lowercase English letters." ] }, { "line": 76, "end_line": 76, "violates": [ "words[i] consists only of lowercase English letters." ] }, { "line": 96, "end_line": 96, "violates": [ "words[i] consists only of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Iterate through the elements in order. As soon as the current element is a palindrome, return it.", "To check if an element is a palindrome, can you reverse the string?" ] }, { "question_id": 2109, "task_id": "adding-spaces-to-a-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "spaces" ], "tests": { "total": 127, "kept": 71, "dropped": { "constraint_violation": 56 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= spaces.length <= 3 * 10**(5)" ] }, { "line": 6, "end_line": 6, "violates": [ "1 <= spaces.length <= 3 * 10**(5)" ] }, { "line": 15, "end_line": 15, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 18, "end_line": 18, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 20, "end_line": 20, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= spaces.length <= 3 * 10**(5)" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 28, "end_line": 28, "violates": [ "s consists only of lowercase and uppercase English letters." ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 35, "end_line": 35, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 61, "end_line": 61, "violates": [ "s consists only of lowercase and uppercase English letters." ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 87, "end_line": 87, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 98, "end_line": 98, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 102, "end_line": 102, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 104, "end_line": 104, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 107, "end_line": 107, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 110, "end_line": 110, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 111, "end_line": 111, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 112, "end_line": 112, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 113, "end_line": 113, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 115, "end_line": 115, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 120, "end_line": 120, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= spaces.length <= 3 * 10**(5)" ] }, { "line": 123, "end_line": 123, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 126, "end_line": 126, "violates": [ "0 <= spaces[i] <= s.length - 1" ] }, { "line": 127, "end_line": 127, "violates": [ "0 <= spaces[i] <= s.length - 1" ] } ], "unchecked_constraints": [ "All the values of spaces are strictly increasing." ], "public_tests": 3, "hints": [ "Create a new string, initially empty, as the modified string. Iterate through the original string and append each character of the original string to the new string. However, each time you reach a character that requires a space before it, append a space before appending the character.", "Since the array of indices for the space locations is sorted, use a pointer to keep track of the next index to place a space. Only increment the pointer once a space has been appended.", "Ensure that your append operation can be done in O(1)." ] }, { "question_id": 2110, "task_id": "number-of-smooth-descent-periods-of-a-stock", "drop": [], "similar": [ "subarray-product-less-than-k", "number-of-valid-subarrays", "number-of-zero-filled-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "prices" ], "tests": { "total": 116, "kept": 100, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= prices[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Any array is a series of adjacent longest possible smooth descent periods. For example, [5,3,2,1,7,6] is [5] + [3,2,1] + [7,6].", "Think of a 2-pointer approach to traverse the array and find each longest possible period.", "Suppose you found the longest possible period with a length of k. How many periods are within that period? How can you count them quickly? Think of the formula to calculate the sum of 1, 2, 3, ..., k." ] }, { "question_id": 2111, "task_id": "minimum-operations-to-make-the-array-k-increasing", "drop": [], "similar": [ "longest-increasing-subsequence", "minimum-swaps-to-make-sequences-increasing" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "k" ], "tests": { "total": 133, "kept": 95, "dropped": { "constraint_violation": 38 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 6, "end_line": 6, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= arr[i], k <= arr.length", "1 <= arr[i], k <= arr.length" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= arr[i], k <= arr.length", "1 <= arr[i], k <= arr.length" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 128, "end_line": 128, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 130, "end_line": 130, "violates": [ "1 <= arr[i], k <= arr.length" ] }, { "line": 134, "end_line": 134, "violates": [ "1 <= arr[i], k <= arr.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we divide the array into non-overlapping subsequences and simplify the problem?", "In the final array, arr[i-k] \u2264 arr[i] should hold. We can use this to divide the array into at most k non-overlapping sequences, where arr[i] will belong to the (i%k)th sequence.", "Now our problem boils down to performing the minimum operations on each sequence such that it becomes non-decreasing. Our answer will be the sum of operations on each sequence.", "Which indices of a sequence should we not change in order to count the minimum operations? Can finding the longest non-decreasing subsequence of the sequence help?" ] }, { "question_id": 2113, "task_id": "elements-in-array-after-removing-and-replacing-elements", "drop": [ "premium" ] }, { "question_id": 2114, "task_id": "maximum-number-of-words-found-in-sentences", "drop": [], "similar": [ "number-of-valid-words-in-a-sentence" ], "flags": [], "comparison": "exact", "parameter_names": [ "sentences" ], "tests": { "total": 78, "kept": 75, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "sentences[i] consists only of lowercase English letters and ' ' only." ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= sentences[i].length <= 100" ] }, { "line": 39, "end_line": 39, "violates": [ "sentences[i] consists only of lowercase English letters and ' ' only." ] } ], "unchecked_constraints": [ "sentences[i] does not have leading or trailing spaces.", "All the words in sentences[i] are separated by a single space." ], "public_tests": 2, "hints": [ "Process each sentence separately and count the number of words by looking for the number of space characters in the sentence and adding it by 1." ] }, { "question_id": 2115, "task_id": "find-all-possible-recipes-from-given-supplies", "drop": [], "similar": [ "course-schedule-ii", "count-good-meals" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "recipes", "ingredients", "supplies" ], "tests": { "total": 103, "kept": 64, "dropped": { "constraint_violation": 39 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 12, "end_line": 12, "violates": [ "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 34, "end_line": 34, "violates": [ "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 71, "end_line": 71, "violates": [ "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 73, "end_line": 73, "violates": [ "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= recipes[i].length, ingredients[i][j].length, supplies[k].length <= 10", "recipes[i], ingredients[i][j], and supplies[k] consist only of lowercase English letters." ] } ], "unchecked_constraints": [ "All the values of recipes and supplies combined are unique.", "Each ingredients[i] does not contain any duplicate values." ], "public_tests": 3, "hints": [ "Can we use a data structure to quickly query whether we have a certain ingredient?", "Once we verify that we can make a recipe, we can add it to our ingredient data structure. We can then check if we can make more recipes as a result of this." ] }, { "question_id": 2116, "task_id": "check-if-a-parentheses-string-can-be-valid", "drop": [], "similar": [ "valid-parentheses", "generate-parentheses", "valid-parenthesis-string", "minimum-remove-to-make-valid-parentheses", "check-if-there-is-a-valid-parentheses-string-path" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "s", "locked" ], "tests": { "total": 81, "kept": 45, "dropped": { "constraint_violation": 36 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "n == s.length == locked.length" ] }, { "line": 8, "end_line": 8, "violates": [ "n == s.length == locked.length" ] }, { "line": 12, "end_line": 12, "violates": [ "n == s.length == locked.length" ] }, { "line": 16, "end_line": 16, "violates": [ "n == s.length == locked.length" ] }, { "line": 18, "end_line": 18, "violates": [ "n == s.length == locked.length" ] }, { "line": 20, "end_line": 20, "violates": [ "n == s.length == locked.length" ] }, { "line": 26, "end_line": 26, "violates": [ "n == s.length == locked.length" ] }, { "line": 28, "end_line": 28, "violates": [ "n == s.length == locked.length" ] }, { "line": 29, "end_line": 29, "violates": [ "n == s.length == locked.length" ] }, { "line": 31, "end_line": 31, "violates": [ "n == s.length == locked.length" ] }, { "line": 32, "end_line": 32, "violates": [ "n == s.length == locked.length" ] }, { "line": 34, "end_line": 34, "violates": [ "n == s.length == locked.length" ] }, { "line": 35, "end_line": 35, "violates": [ "n == s.length == locked.length" ] }, { "line": 37, "end_line": 37, "violates": [ "n == s.length == locked.length" ] }, { "line": 43, "end_line": 43, "violates": [ "n == s.length == locked.length" ] }, { "line": 46, "end_line": 46, "violates": [ "n == s.length == locked.length" ] }, { "line": 48, "end_line": 48, "violates": [ "n == s.length == locked.length" ] }, { "line": 49, "end_line": 49, "violates": [ "n == s.length == locked.length" ] }, { "line": 50, "end_line": 50, "violates": [ "n == s.length == locked.length" ] }, { "line": 54, "end_line": 54, "violates": [ "n == s.length == locked.length" ] }, { "line": 55, "end_line": 55, "violates": [ "n == s.length == locked.length" ] }, { "line": 56, "end_line": 56, "violates": [ "n == s.length == locked.length" ] }, { "line": 60, "end_line": 60, "violates": [ "n == s.length == locked.length" ] }, { "line": 61, "end_line": 61, "violates": [ "n == s.length == locked.length" ] }, { "line": 63, "end_line": 63, "violates": [ "n == s.length == locked.length" ] }, { "line": 65, "end_line": 65, "violates": [ "n == s.length == locked.length" ] }, { "line": 66, "end_line": 66, "violates": [ "n == s.length == locked.length" ] }, { "line": 68, "end_line": 68, "violates": [ "n == s.length == locked.length" ] }, { "line": 69, "end_line": 69, "violates": [ "n == s.length == locked.length" ] }, { "line": 71, "end_line": 71, "violates": [ "n == s.length == locked.length" ] }, { "line": 72, "end_line": 72, "violates": [ "n == s.length == locked.length" ] }, { "line": 73, "end_line": 73, "violates": [ "n == s.length == locked.length" ] }, { "line": 74, "end_line": 74, "violates": [ "n == s.length == locked.length" ] }, { "line": 76, "end_line": 76, "violates": [ "n == s.length == locked.length" ] }, { "line": 77, "end_line": 77, "violates": [ "n == s.length == locked.length" ] }, { "line": 80, "end_line": 80, "violates": [ "n == s.length == locked.length" ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Can an odd length string ever be valid?", "From left to right, if a locked ')' is encountered, it must be balanced with either a locked '(' or an unlocked index on its left. If neither exist, what conclusion can be drawn? If both exist, which one is more preferable to use?", "After the above, we may have locked indices of '(' and additional unlocked indices. How can you balance out the locked '(' now? What if you cannot balance any locked '('?" ] }, { "question_id": 2117, "task_id": "abbreviating-the-product-of-a-range", "drop": [], "similar": [ "factorial-trailing-zeroes", "maximum-trailing-zeros-in-a-cornered-path", "find-all-good-indices" ], "flags": [], "comparison": "exact", "parameter_names": [ "left", "right" ], "tests": { "total": 74, "kept": 72, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 45, "end_line": 45, "violates": [ "1 <= left <= right <= 10**(4)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= left <= right <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Calculating the number of trailing zeros, the last five digits, and the first five digits can all be done separately.", "Use a prime factorization property to find the number of trailing zeros. Use modulo to find the last 5 digits. Use a logarithm property to find the first 5 digits.", "The number of trailing zeros C is nothing but the number of times the product is completely divisible by 10. Since 2 and 5 are the only prime factors of 10, C will be equal to the minimum number of times 2 or 5 appear in the prime factorization of the product.", "Iterate through the integers from left to right. For every integer, keep dividing it by 2 as long as it is divisible by 2 and C occurrences of 2 haven't been removed in total. Repeat this process for 5. Finally, multiply the integer under modulo of 10^5 with the product obtained till now to obtain the last five digits.", "The product P can be represented as P=10^(x+y) where x is the integral part and y is the fractional part of x+y. Using the property \"if S = A * B, then log(S) = log(A) + log(B)\", we can write x+y = log_10(P) = sum(log_10(i)) for each integer i in [left, right]. Once we obtain the sum, the first five digits can be represented as floor(10^(y+4))." ] }, { "question_id": 2119, "task_id": "a-number-after-a-double-reversal", "drop": [], "similar": [ "reverse-integer", "reverse-bits" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 66, "kept": 18, "dropped": { "constraint_violation": 48 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 12, "end_line": 12, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 13, "end_line": 13, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 15, "end_line": 15, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 16, "end_line": 16, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 17, "end_line": 17, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 18, "end_line": 18, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 20, "end_line": 20, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 35, "end_line": 35, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 55, "end_line": 55, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= num <= 10**(6)" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= num <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Other than the number 0 itself, any number that ends with 0 would lose some digits permanently when reversed." ] }, { "question_id": 2120, "task_id": "execution-of-all-suffix-instructions-staying-in-a-grid", "drop": [], "similar": [ "out-of-boundary-paths", "robot-return-to-origin" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "startPos", "s" ], "tests": { "total": 89, "kept": 89, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= startrow, startcol < n" ], "public_tests": 3, "hints": [ "The constraints are not very large. Can we simulate the execution by starting from each index of s?", "Before any of the stopping conditions is met, stop the simulation for that index and set the answer for that index." ] }, { "question_id": 2121, "task_id": "intervals-between-identical-elements", "drop": [], "similar": [ "continuous-subarray-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 89, "kept": 86, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 44, "end_line": 44, "violates": [ "1 <= arr[i] <= 10**(5)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= arr[i] <= 10**(5)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= arr[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each unique value found in the array, store a sorted list of indices of elements that have this value in the array.", "One way of doing this is to use a HashMap that maps the values to their list of indices. Update this mapping as you iterate through the array.", "Process each list of indices separately and get the sum of intervals for the elements of that value by utilizing prefix sums.", "For each element, keep track of the sum of indices of the identical elements that have come before and that will come after respectively. Use this to calculate the sum of intervals for that element to the rest of the elements with identical values." ] }, { "question_id": 2122, "task_id": "recover-the-original-array", "drop": [], "similar": [ "find-array-given-subset-sums", "find-original-array-from-doubled-array" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 111, "kept": 105, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [ "2 * n == nums.length", "1 <= n <= 1000", "The test cases are generated such that there exists at least one valid array arr." ], "public_tests": 3, "hints": [ "If we fix the value of k, how can we check if an original array exists for the fixed k?", "The smallest value of nums is obtained by subtracting k from the smallest value of the original array. How can we use this to reduce the search space for finding a valid k?", "You can compute every possible k by using the smallest value of nums (as lower[i]) against every other value in nums (as the corresponding higher[i]).", "For every computed k, greedily pair up the values in nums. This can be done sorting nums, then using a map to store previous values and searching that map for a corresponding lower[i] for the current nums[j] (as higher[i])." ] }, { "question_id": 2123, "task_id": "minimum-operations-to-remove-adjacent-ones-in-matrix", "drop": [ "premium" ] }, { "question_id": 2124, "task_id": "check-if-all-as-appears-before-all-bs", "drop": [], "similar": [ "minimum-deletions-to-make-string-balanced", "check-if-array-is-sorted-and-rotated", "check-if-numbers-are-ascending-in-a-sentence" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 152, "kept": 152, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "You can check the opposite: check if there is a \u2018b\u2019 before an \u2018a\u2019. Then, negate and return that answer.", "s should not have any occurrences of \u201cba\u201d as a substring." ] }, { "question_id": 2125, "task_id": "number-of-laser-beams-in-a-bank", "drop": [], "similar": [ "set-matrix-zeroes" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "bank" ], "tests": { "total": 117, "kept": 117, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What is the commonality between security devices on the same row?", "Each device on the same row has the same number of beams pointing towards the devices on the next row with devices.", "If you were given an integer array where each element is the number of security devices on each row, can you solve it?", "Convert the input to such an array, skip any row with no security device, then find the sum of the product between adjacent elements." ] }, { "question_id": 2126, "task_id": "destroying-asteroids", "drop": [], "similar": [ "asteroid-collision" ], "flags": [], "comparison": "exact", "parameter_names": [ "mass", "asteroids" ], "tests": { "total": 88, "kept": 88, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Choosing the asteroid to collide with can be done greedily.", "If an asteroid will destroy the planet, then every bigger asteroid will also destroy the planet.", "You only need to check the smallest asteroid at each collision. If it will destroy the planet, then every other asteroid will also destroy the planet.", "Sort the asteroids in non-decreasing order by mass, then greedily try to collide with the asteroids in that order." ] }, { "question_id": 2127, "task_id": "maximum-employees-to-be-invited-to-a-meeting", "drop": [], "similar": [ "redundant-connection", "parallel-courses-iii", "process-restricted-friend-requests" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "favorite" ], "tests": { "total": 127, "kept": 63, "dropped": { "constraint_violation": 64 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "favorite[i] != i" ] }, { "line": 5, "end_line": 5, "violates": [ "favorite[i] != i" ] }, { "line": 7, "end_line": 7, "violates": [ "favorite[i] != i" ] }, { "line": 9, "end_line": 9, "violates": [ "favorite[i] != i", "favorite[i] != i" ] }, { "line": 12, "end_line": 12, "violates": [ "favorite[i] != i" ] }, { "line": 20, "end_line": 20, "violates": [ "favorite[i] != i" ] }, { "line": 22, "end_line": 22, "violates": [ "favorite[i] != i" ] }, { "line": 23, "end_line": 23, "violates": [ "favorite[i] != i" ] }, { "line": 24, "end_line": 24, "violates": [ "favorite[i] != i" ] }, { "line": 25, "end_line": 25, "violates": [ "favorite[i] != i" ] }, { "line": 26, "end_line": 26, "violates": [ "favorite[i] != i" ] }, { "line": 28, "end_line": 28, "violates": [ "favorite[i] != i" ] }, { "line": 29, "end_line": 29, "violates": [ "favorite[i] != i" ] }, { "line": 33, "end_line": 33, "violates": [ "favorite[i] != i" ] }, { "line": 34, "end_line": 34, "violates": [ "favorite[i] != i" ] }, { "line": 37, "end_line": 37, "violates": [ "favorite[i] != i" ] }, { "line": 38, "end_line": 38, "violates": [ "favorite[i] != i" ] }, { "line": 39, "end_line": 39, "violates": [ "favorite[i] != i" ] }, { "line": 41, "end_line": 41, "violates": [ "favorite[i] != i" ] }, { "line": 42, "end_line": 42, "violates": [ "favorite[i] != i" ] }, { "line": 43, "end_line": 43, "violates": [ "favorite[i] != i" ] }, { "line": 44, "end_line": 44, "violates": [ "favorite[i] != i" ] }, { "line": 47, "end_line": 47, "violates": [ "favorite[i] != i" ] }, { "line": 48, "end_line": 48, "violates": [ "favorite[i] != i" ] }, { "line": 50, "end_line": 50, "violates": [ "favorite[i] != i" ] }, { "line": 51, "end_line": 51, "violates": [ "favorite[i] != i" ] }, { "line": 53, "end_line": 53, "violates": [ "favorite[i] != i" ] }, { "line": 54, "end_line": 54, "violates": [ "favorite[i] != i" ] }, { "line": 55, "end_line": 55, "violates": [ "favorite[i] != i" ] }, { "line": 58, "end_line": 58, "violates": [ "favorite[i] != i", "favorite[i] != i" ] }, { "line": 60, "end_line": 60, "violates": [ "favorite[i] != i" ] }, { "line": 61, "end_line": 61, "violates": [ "favorite[i] != i" ] }, { "line": 62, "end_line": 62, "violates": [ "favorite[i] != i" ] }, { "line": 65, "end_line": 65, "violates": [ "favorite[i] != i" ] }, { "line": 66, "end_line": 66, "violates": [ "favorite[i] != i" ] }, { "line": 67, "end_line": 67, "violates": [ "favorite[i] != i" ] }, { "line": 69, "end_line": 69, "violates": [ "favorite[i] != i" ] }, { "line": 71, "end_line": 71, "violates": [ "favorite[i] != i" ] }, { "line": 73, "end_line": 73, "violates": [ "favorite[i] != i" ] }, { "line": 76, "end_line": 76, "violates": [ "favorite[i] != i" ] }, { "line": 77, "end_line": 77, "violates": [ "favorite[i] != i" ] }, { "line": 78, "end_line": 78, "violates": [ "favorite[i] != i" ] }, { "line": 79, "end_line": 79, "violates": [ "favorite[i] != i" ] }, { "line": 80, "end_line": 80, "violates": [ "favorite[i] != i" ] }, { "line": 81, "end_line": 81, "violates": [ "favorite[i] != i" ] }, { "line": 84, "end_line": 84, "violates": [ "favorite[i] != i" ] }, { "line": 86, "end_line": 86, "violates": [ "favorite[i] != i" ] }, { "line": 88, "end_line": 88, "violates": [ "favorite[i] != i" ] }, { "line": 90, "end_line": 90, "violates": [ "favorite[i] != i" ] }, { "line": 92, "end_line": 92, "violates": [ "favorite[i] != i" ] }, { "line": 97, "end_line": 97, "violates": [ "favorite[i] != i" ] }, { "line": 98, "end_line": 98, "violates": [ "favorite[i] != i" ] }, { "line": 99, "end_line": 99, "violates": [ "favorite[i] != i" ] }, { "line": 100, "end_line": 100, "violates": [ "favorite[i] != i" ] }, { "line": 105, "end_line": 105, "violates": [ "favorite[i] != i" ] }, { "line": 106, "end_line": 106, "violates": [ "favorite[i] != i" ] }, { "line": 110, "end_line": 110, "violates": [ "favorite[i] != i" ] }, { "line": 113, "end_line": 113, "violates": [ "favorite[i] != i" ] }, { "line": 115, "end_line": 115, "violates": [ "favorite[i] != i" ] }, { "line": 118, "end_line": 118, "violates": [ "favorite[i] != i" ] }, { "line": 122, "end_line": 122, "violates": [ "favorite[i] != i" ] }, { "line": 125, "end_line": 125, "violates": [ "favorite[i] != i" ] }, { "line": 126, "end_line": 126, "violates": [ "favorite[i] != i" ] }, { "line": 128, "end_line": 128, "violates": [ "favorite[i] != i" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "From the given array favorite, create a graph where for every index i, there is a directed edge from favorite[i] to i. The graph will be a combination of cycles and chains of acyclic edges. Now, what are the ways in which we can choose employees to sit at the table?", "The first way by which we can choose employees is by selecting a cycle of the graph. It can be proven that in this case, the employees that do not lie in the cycle can never be seated at the table (unless the cycle has a length of 2).", "The second way is by combining acyclic chains. At most two chains can be combined by a cycle of length 2, where each chain ends on one of the employees in the cycle." ] }, { "question_id": 2128, "task_id": "remove-all-ones-with-row-and-column-flips", "drop": [ "premium" ] }, { "question_id": 2129, "task_id": "capitalize-the-title", "drop": [], "similar": [ "detect-capital", "to-lower-case" ], "flags": [], "comparison": "exact", "parameter_names": [ "title" ], "tests": { "total": 137, "kept": 137, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Each word consists of uppercase and lowercase English letters and is non-empty.", "title consists of words separated by a single space without any leading or trailing spaces." ], "public_tests": 3, "hints": [ "Firstly, try to find all the words present in the string.", "On the basis of each word's lengths, simulate the process explained in Problem." ] }, { "question_id": 2130, "task_id": "maximum-twin-sum-of-a-linked-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "reverse-linked-list", "palindrome-linked-list", "middle-of-the-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 89, "kept": 0, "dropped": { "unreadable": 89 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is an even integer in the range [2, 10**(5)].", "1 <= Node.val <= 10**(5)" ] }, { "question_id": 2131, "task_id": "longest-palindrome-by-concatenating-two-letter-words", "drop": [], "similar": [ "palindrome-pairs", "longest-palindrome" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 52, "kept": 52, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "A palindrome must be mirrored over the center. Suppose we have a palindrome. If we prepend the word \"ab\" on the left, what must we append on the right to keep it a palindrome?", "We must append \"ba\" on the right. The number of times we can do this is the minimum of (occurrences of \"ab\") and (occurrences of \"ba\").", "For words that are already palindromes, e.g. \"aa\", we can prepend and append these in pairs as described in the previous hint. We can also use exactly one in the middle to form an even longer palindrome." ] }, { "question_id": 2132, "task_id": "stamping-the-grid", "drop": [], "similar": [ "maximal-square", "bomb-enemy", "matrix-block-sum" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid", "stampHeight", "stampWidth" ], "tests": { "total": 81, "kept": 81, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use prefix sums here?" ] }, { "question_id": 2133, "task_id": "check-if-every-row-and-column-contains-all-numbers", "drop": [], "similar": [ "valid-sudoku", "matrix-diagonal-sum", "first-completely-painted-row-or-column" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 57, "kept": 51, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= matrix[i][j] <= n" ] }, { "line": 13, "end_line": 13, "violates": [ "n == matrix.length == matrix[i].length" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= matrix[i][j] <= n" ] }, { "line": 37, "end_line": 37, "violates": [ "n == matrix.length == matrix[i].length", "1 <= matrix[i][j] <= n" ] }, { "line": 42, "end_line": 42, "violates": [ "n == matrix.length == matrix[i].length" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= matrix[i][j] <= n" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use for loops to check each row for every number from 1 to n. Similarly, do the same for each column.", "For each check, you can keep a set of the unique elements in the checked row/col. By the end of the check, the size of the set should be n." ] }, { "question_id": 2134, "task_id": "minimum-swaps-to-group-all-1s-together-ii", "drop": [], "similar": [ "minimum-swaps-to-group-all-1s-together", "time-needed-to-rearrange-a-binary-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 117, "kept": 117, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Notice that the number of 1\u2019s to be grouped together is fixed. It is the number of 1's the whole array has.", "Call this number total. We should then check for every subarray of size total (possibly wrapped around), how many swaps are required to have the subarray be all 1\u2019s.", "The number of swaps required is the number of 0\u2019s in the subarray.", "To eliminate the circular property of the array, we can append the original array to itself. Then, we check each subarray of length total.", "How do we avoid recounting the number of 0\u2019s in the subarray each time? The Sliding Window technique can help." ] }, { "question_id": 2135, "task_id": "count-words-obtained-after-adding-a-letter", "drop": [], "similar": [ "strings-differ-by-one-character", "count-substrings-that-differ-by-one-character", "maximum-score-from-removing-substrings" ], "flags": [], "comparison": "exact", "parameter_names": [ "startWords", "targetWords" ], "tests": { "total": 68, "kept": 64, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= startWords[i].length, targetWords[j].length <= 26" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= startWords[i].length, targetWords[j].length <= 26" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= startWords[i].length, targetWords[j].length <= 26" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= startWords[i].length, targetWords[j].length <= 26" ] } ], "unchecked_constraints": [ "Each string of startWords and targetWords consists of lowercase English letters only.", "No letter occurs more than once in any string of startWords or targetWords." ], "public_tests": 2, "hints": [ "Which data structure can be used to efficiently check if a string exists in startWords?", "After appending a letter, all letters of a string can be rearranged in any possible way. How can we use this to reduce our search space while checking if a string in targetWords can be obtained from a string in startWords?" ] }, { "question_id": 2136, "task_id": "earliest-possible-day-of-full-bloom", "drop": [], "similar": [ "minimum-number-of-days-to-make-m-bouquets" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "plantTime", "growTime" ], "tests": { "total": 102, "kept": 101, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 87, "end_line": 87, "violates": [ "1 <= plantTime[i], growTime[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "List the planting like the diagram above shows, where a row represents the timeline of a seed. A row i is above another row j if the last day planting seed i is ahead of the last day for seed j. Does it have any advantage to spend some days to plant seed j before completely planting seed i?", "No. It does not help seed j but could potentially delay the completion of seed i, resulting in a worse final answer. Remaining focused is a part of the optimal solution.", "Sort the seeds by their growTime in descending order. Can you prove why this strategy is the other part of the optimal solution? Note the bloom time of a seed is the sum of plantTime of all seeds preceding this seed plus the growTime of this seed.", "There is no way to improve this strategy. The seed to bloom last dominates the final answer. Exchanging the planting of this seed with another seed with either a larger or smaller growTime will result in a potentially worse answer." ] }, { "question_id": 2137, "task_id": "pour-water-between-buckets-to-make-water-levels-equal", "drop": [ "premium" ] }, { "question_id": 2138, "task_id": "divide-a-string-into-groups-of-size-k", "drop": [], "similar": [ "text-justification", "positions-of-large-groups" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k", "fill" ], "tests": { "total": 110, "kept": 103, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "s consists of lowercase English letters only." ] }, { "line": 9, "end_line": 9, "violates": [ "s consists of lowercase English letters only." ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= s.length <= 100" ] }, { "line": 68, "end_line": 68, "violates": [ "s consists of lowercase English letters only." ] }, { "line": 79, "end_line": 79, "violates": [ "s consists of lowercase English letters only." ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= s.length <= 100" ] }, { "line": 100, "end_line": 100, "violates": [ "s consists of lowercase English letters only." ] } ], "unchecked_constraints": [ "fill is a lowercase English letter." ], "public_tests": 2, "hints": [ "Using the length of the string and k, can you count the number of groups the string can be divided into?", "Try completing each group using characters from the string. If there aren\u2019t enough characters for the last group, use the fill character to complete the group." ] }, { "question_id": 2139, "task_id": "minimum-moves-to-reach-target-score", "drop": [], "similar": [ "number-of-steps-to-reduce-a-number-to-zero", "number-of-steps-to-reduce-a-number-in-binary-representation-to-one" ], "flags": [], "comparison": "exact", "parameter_names": [ "target", "maxDoubles" ], "tests": { "total": 140, "kept": 131, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "1 <= target <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= target <= 10**(9)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= target <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= target <= 10**(9)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= target <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= target <= 10**(9)" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= maxDoubles <= 100" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= target <= 10**(9)" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= target <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Solve the opposite problem: start at the given score and move to 1.", "It is better to use the move of the second type once we can to lose more scores fast." ] }, { "question_id": 2140, "task_id": "solving-questions-with-brainpower", "drop": [], "similar": [ "house-robber", "frog-jump" ], "flags": [], "comparison": "exact", "parameter_names": [ "questions" ], "tests": { "total": 108, "kept": 49, "dropped": { "constraint_violation": 59 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= pointsi, brainpoweri <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each question, we can either solve it or skip it. How can we use Dynamic Programming to decide the most optimal option for each problem?", "We store for each question the maximum points we can earn if we started the exam on that question.", "If we skip a question, then the answer for it will be the same as the answer for the next question.", "If we solve a question, then the answer for it will be the points of the current question plus the answer for the next solvable question.", "The maximum of these two values will be the answer to the current question." ] }, { "question_id": 2141, "task_id": "maximum-running-time-of-n-computers", "drop": [], "similar": [ "minimum-moves-to-equal-array-elements", "sell-diminishing-valued-colored-balls", "maximum-number-of-tasks-you-can-assign", "minimum-time-to-complete-trips", "minimum-amount-of-time-to-fill-cups" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "batteries" ], "tests": { "total": 114, "kept": 114, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For a given running time, can you determine if it is possible to run all n computers simultaneously?", "Try to use Binary Search to find the maximal running time" ] }, { "question_id": 2143, "task_id": "choose-numbers-from-two-arrays-in-range", "drop": [ "premium" ] }, { "question_id": 2144, "task_id": "minimum-cost-of-buying-candies-with-discount", "drop": [], "similar": [ "array-partition", "minimum-absolute-difference", "minimum-number-of-operations-to-satisfy-conditions", "check-if-grid-satisfies-conditions" ], "flags": [], "comparison": "exact", "parameter_names": [ "cost" ], "tests": { "total": 96, "kept": 84, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= cost[i] <= 100" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= cost[i] <= 100" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= cost[i] <= 100" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= cost.length <= 100", "1 <= cost[i] <= 100" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= cost[i] <= 100" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= cost[i] <= 100" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= cost[i] <= 100" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= cost[i] <= 100" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= cost[i] <= 100" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= cost[i] <= 100" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= cost[i] <= 100" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= cost[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If we consider costs from high to low, what is the maximum cost of a single candy that we can get for free?", "How can we generalize this approach to maximize the costs of the candies we get for free?", "Can \u201csorting\u201d the array help us find the minimum cost?" ] }, { "question_id": 2145, "task_id": "count-the-hidden-sequences", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "differences", "lower", "upper" ], "tests": { "total": 123, "kept": 120, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] }, { "line": 44, "end_line": 44, "violates": [ "-10**(5) <= differences[i] <= 10**(5)" ] }, { "line": 97, "end_line": 97, "violates": [ "-10**(5) <= lower <= upper <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Fix the first element of the hidden sequence to any value x and ignore the given bounds. Notice that we can then determine all the other elements of the sequence by using the differences array.", "We will also be able to determine the difference between the minimum and maximum elements of the sequence. Notice that the value of x does not affect this.", "We now have the \u2018range\u2019 of the sequence (difference between min and max element), we can then calculate how many ways there are to fit this range into the given range of lower to upper.", "Answer is (upper - lower + 1) - (range of sequence)" ] }, { "question_id": 2146, "task_id": "k-highest-ranked-items-within-a-price-range", "drop": [], "similar": [ "kth-largest-element-in-an-array", "as-far-from-land-as-possible", "reward-top-k-students" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid", "pricing", "start", "k" ], "tests": { "total": 79, "kept": 79, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "2 <= low <= high <= 10**(5)", "0 <= row <= m - 1", "0 <= col <= n - 1", "grid[row][col] > 0" ], "public_tests": 3, "hints": [ "Could you determine the rank of every item efficiently?", "We can perform a breadth-first search from the starting position and know the length of the shortest path from start to every item.", "Sort all the items according to the conditions listed in the problem, and return the first k (or all if less than k exist) items as the answer." ] }, { "question_id": 2147, "task_id": "number-of-ways-to-divide-a-long-corridor", "drop": [], "similar": [ "decode-ways-ii", "minimum-cost-to-cut-a-stick", "ways-to-split-array-into-three-subarrays" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "corridor" ], "tests": { "total": 145, "kept": 145, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Divide the corridor into segments. Each segment has two seats, starts precisely with one seat, and ends precisely with the other seat.", "How many dividers can you install between two adjacent segments? You must install precisely one. Otherwise, you would have created a section with not exactly two seats.", "If there are k plants between two adjacent segments, there are k + 1 positions (ways) you could install the divider you must install.", "The problem now becomes: Find the product of all possible positions between every two adjacent segments." ] }, { "question_id": 2148, "task_id": "count-elements-with-strictly-smaller-and-greater-elements", "drop": [], "similar": [ "find-smallest-letter-greater-than-target" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 120, "kept": 120, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "All the elements in the array should be counted except for the minimum and maximum elements.", "If the array has n elements, the answer will be n - count(min(nums)) - count(max(nums))", "This formula will not work in case the array has all the elements equal, why?" ] }, { "question_id": 2149, "task_id": "rearrange-array-elements-by-sign", "drop": [], "similar": [ "wiggle-subsequence", "sort-array-by-parity-ii", "partition-array-according-to-given-pivot", "largest-number-after-digit-swaps-by-parity" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 99, "kept": 98, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "nums.length is even" ] } ], "unchecked_constraints": [ "1 <= |nums[i]| <= 10**(5)", "nums consists of equal number of positive and negative integers." ], "public_tests": 2, "hints": [ "Divide the array into two parts- one comprising of only positive integers and the other of negative integers.", "Merge the two parts to get the resultant array." ] }, { "question_id": 2150, "task_id": "find-all-lonely-numbers-in-the-array", "drop": [], "similar": [ "frequency-of-the-most-frequent-element" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums" ], "tests": { "total": 148, "kept": 144, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 52, "end_line": 52, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 122, "end_line": 122, "violates": [ "0 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For a given element x, how can you quickly check if x - 1 and x + 1 are present in the array without reiterating through the entire array?", "Use a set or a hash map." ] }, { "question_id": 2151, "task_id": "maximum-good-people-based-on-statements", "drop": [], "similar": [ "maximum-score-words-formed-by-letters" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "statements" ], "tests": { "total": 75, "kept": 71, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "statements[i][i] == 2" ] }, { "line": 7, "end_line": 7, "violates": [ "statements[i][i] == 2" ] }, { "line": 24, "end_line": 24, "violates": [ "statements[i][i] == 2" ] }, { "line": 41, "end_line": 41, "violates": [ "statements[i][i] == 2" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "You should test every possible assignment of good and bad people, using a bitmask.", "In each bitmask, if the person i is good, then his statements should be consistent with the bitmask in order for the assignment to be valid.", "If the assignment is valid, count how many people are good and keep track of the maximum." ] }, { "question_id": 2152, "task_id": "minimum-number-of-lines-to-cover-points", "drop": [ "premium" ] }, { "question_id": 2154, "task_id": "keep-multiplying-found-values-by-two", "drop": [], "similar": [ "largest-number-at-least-twice-of-others", "check-if-n-and-its-double-exist" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "original" ], "tests": { "total": 115, "kept": 74, "dropped": { "constraint_violation": 41 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i], original <= 1000", "1 <= nums[i], original <= 1000" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i], original <= 1000", "1 <= nums[i], original <= 1000" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i], original <= 1000", "1 <= nums[i], original <= 1000" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i], original <= 1000", "1 <= nums[i], original <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i], original <= 1000", "1 <= nums[i], original <= 1000" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i], original <= 1000", "1 <= nums[i], original <= 1000" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i], original <= 1000", "1 <= nums[i], original <= 1000" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i], original <= 1000", "1 <= nums[i], original <= 1000" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= nums[i], original <= 1000", "1 <= nums[i], original <= 1000" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= nums[i], original <= 1000" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= nums[i], original <= 1000", "1 <= nums[i], original <= 1000" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= nums[i], original <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Repeatedly iterate through the array and check if the current value of original is in the array.", "If original is not found, stop and return its current value.", "Otherwise, multiply original by 2 and repeat the process.", "Use set data structure to check the existence faster." ] }, { "question_id": 2155, "task_id": "all-divisions-with-the-highest-score-of-a-binary-array", "drop": [], "similar": [ "ones-and-zeroes", "max-consecutive-ones-ii", "count-subarrays-with-more-ones-than-zeros", "array-partition", "divide-array-in-sets-of-k-consecutive-numbers" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums" ], "tests": { "total": 98, "kept": 98, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "When you iterate the array, maintain the number of zeros and ones on the left side. Can you quickly calculate the number of ones on the right side?", "The number of ones on the right side equals the number of ones in the whole array minus the number of ones on the left side.", "Alternatively, you can quickly calculate it by using a prefix sum array." ] }, { "question_id": 2156, "task_id": "find-substring-with-given-hash-value", "drop": [], "similar": [ "distinct-echo-substrings" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "power", "modulo", "k", "hashValue" ], "tests": { "total": 96, "kept": 46, "dropped": { "constraint_violation": 50 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 4, "end_line": 4, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= hashValue < modulo" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 92, "end_line": 92, "violates": [ "s consists of lowercase English letters only." ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= power, modulo <= 10**(9)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= power, modulo <= 10**(9)" ] } ], "unchecked_constraints": [ "The test cases are generated such that an answer always exists." ], "public_tests": 2, "hints": [ "How can we update the hash value efficiently while iterating instead of recalculating it each time?", "Use the rolling hash method." ] }, { "question_id": 2157, "task_id": "groups-of-strings", "drop": [], "similar": [ "word-ladder-ii", "similar-string-groups", "largest-component-size-by-common-factor" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 70, "kept": 67, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= words[i].length <= 26" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= words[i].length <= 26" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= words[i].length <= 26" ] } ], "unchecked_constraints": [ "No letter occurs more than once in words[i]." ], "public_tests": 2, "hints": [ "Can we build a graph from words, where there exists an edge between nodes i and j if words[i] and words[j] are connected?", "The problem now boils down to finding the total number of components and the size of the largest component in the graph.", "How can we use bit masking to reduce the search space while adding edges to node i?" ] }, { "question_id": 2158, "task_id": "amount-of-new-area-painted-each-day", "drop": [ "premium" ] }, { "question_id": 2160, "task_id": "minimum-sum-of-four-digit-number-after-splitting-digits", "drop": [], "similar": [ "add-digits", "difference-between-element-sum-and-digit-sum-of-an-array", "alternating-digit-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 83, "kept": 83, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Notice that the most optimal way to obtain the minimum possible sum using 4 digits is by summing up two 2-digit numbers.", "We can use the two smallest digits out of the four as the digits found in the tens place respectively.", "Similarly, we use the final 2 larger digits as the digits found in the ones place." ] }, { "question_id": 2161, "task_id": "partition-array-according-to-given-pivot", "drop": [], "similar": [ "partition-list", "rearrange-array-elements-by-sign" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "pivot" ], "tests": { "total": 105, "kept": 105, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "pivot equals to an element of nums." ], "public_tests": 2, "hints": [ "Could you put the elements smaller than the pivot and greater than the pivot in a separate list as in the sequence that they occur?", "With the separate lists generated, could you then generate the result?" ] }, { "question_id": 2162, "task_id": "minimum-cost-to-set-cooking-time", "drop": [], "similar": [ "minimum-time-difference" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "startAt", "moveCost", "pushCost", "targetSeconds" ], "tests": { "total": 118, "kept": 116, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= targetSeconds <= 6039" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= targetSeconds <= 6039" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Define a separate function Cost(mm, ss) where 0 <= mm <= 99 and 0 <= ss <= 99. This function should calculate the cost of setting the cooking time to mm minutes and ss seconds", "The range of the minutes is small (i.e., [0, 99]), how can you use that?", "For every mm in [0, 99], calculate the needed ss to make mm:ss equal to targetSeconds and minimize the cost of setting the cooking time to mm:ss", "Be careful in some cases when ss is not in the valid range [0, 99]." ] }, { "question_id": 2163, "task_id": "minimum-difference-in-sums-after-removal-of-elements", "drop": [], "similar": [ "product-of-array-except-self", "find-subsequence-of-length-k-with-the-largest-sum", "find-minimum-cost-to-remove-array-elements" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 117, "kept": 111, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [ "nums.length == 3 * n", "1 <= n <= 10**(5)" ], "public_tests": 2, "hints": [ "The lowest possible difference can be obtained when the sum of the first n elements in the resultant array is minimum, and the sum of the next n elements is maximum.", "For every index i, think about how you can find the minimum possible sum of n elements with indices lesser or equal to i, if possible.", "Similarly, for every index i, try to find the maximum possible sum of n elements with indices greater or equal to i, if possible.", "Now for all indices, check if we can consider it as the partitioning index and hence find the answer." ], "similar_to_test": [ "3469 find-minimum-cost-to-remove-array-elements" ] }, { "question_id": 2164, "task_id": "sort-even-and-odd-indices-independently", "drop": [], "similar": [ "sort-array-by-parity", "sort-array-by-parity-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 107, "kept": 87, "dropped": { "constraint_violation": 20 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums.length <= 100", "1 <= nums[i] <= 100" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to separate the elements at odd indices from the elements at even indices.", "Sort the two groups of elements individually.", "Combine them to form the resultant array." ] }, { "question_id": 2165, "task_id": "smallest-value-of-the-rearranged-number", "drop": [], "similar": [ "largest-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 121, "kept": 100, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 27, "end_line": 27, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 33, "end_line": 33, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 47, "end_line": 47, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 48, "end_line": 48, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 55, "end_line": 55, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 57, "end_line": 57, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 69, "end_line": 69, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 70, "end_line": 70, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 71, "end_line": 71, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 73, "end_line": 73, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 75, "end_line": 75, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 86, "end_line": 86, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 92, "end_line": 92, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 93, "end_line": 93, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 106, "end_line": 106, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 109, "end_line": 109, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 111, "end_line": 111, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 112, "end_line": 112, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 116, "end_line": 116, "violates": [ "-10**(15) <= num <= 10**(15)" ] }, { "line": 122, "end_line": 122, "violates": [ "-10**(15) <= num <= 10**(15)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For positive numbers, the leading digit should be the smallest nonzero digit. Then the remaining digits follow in ascending order.", "For negative numbers, the digits should be arranged in descending order." ] }, { "question_id": 2167, "task_id": "minimum-time-to-remove-all-cars-containing-illegal-goods", "drop": [], "similar": [ "minimum-number-of-k-consecutive-bit-flips" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 101, "kept": 101, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Build an array withoutFirst where withoutFirst[i] stores the minimum time to remove all the cars containing illegal goods from the \u2018suffix\u2019 of the sequence starting from the ith car without using any type 1 operations.", "Next, build an array onlyFirst where onlyFirst[i] stores the minimum time to remove all the cars containing illegal goods from the \u2018prefix\u2019 of the sequence ending on the ith car using only type 1 operations.", "Finally, we can compare the best way to split the operations amongst these two types by finding the minimum time across all onlyFirst[i] + withoutFirst[i + 1]." ] }, { "question_id": 2168, "task_id": "unique-substrings-with-equal-digit-frequency", "drop": [ "premium" ] }, { "question_id": 2169, "task_id": "count-operations-to-obtain-zero", "drop": [], "similar": [ "number-of-steps-to-reduce-a-number-to-zero" ], "flags": [], "comparison": "exact", "parameter_names": [ "num1", "num2" ], "tests": { "total": 78, "kept": 77, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 65, "end_line": 65, "violates": [ "0 <= num1, num2 <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try simulating the process until either of the two integers is zero.", "Count the number of operations done." ] }, { "question_id": 2170, "task_id": "minimum-operations-to-make-the-array-alternating", "drop": [], "similar": [ "minimum-deletions-to-make-array-beautiful", "minimum-number-of-flips-to-make-the-binary-string-alternating" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 135, "kept": 132, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Count the frequency of each element in odd positions in the array. Do the same for elements in even positions.", "To minimize the number of operations we need to maximize the number of elements we keep from the original array.", "What are the possible combinations of elements we can choose from odd indices and even indices so that the number of unchanged elements is maximized?" ] }, { "question_id": 2171, "task_id": "removing-minimum-number-of-magic-beans", "drop": [], "similar": [ "minimum-moves-to-equal-array-elements-ii", "minimum-operations-to-reduce-x-to-zero" ], "flags": [], "comparison": "exact", "parameter_names": [ "beans" ], "tests": { "total": 107, "kept": 106, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 66, "end_line": 66, "violates": [ "1 <= beans[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Notice that if we choose to make x bags of beans empty, we should choose the x bags with the least amount of beans.", "Notice that if the minimum number of beans in a non-empty bag is m, then the best way to make all bags have an equal amount of beans is to reduce all the bags to have m beans.", "Can we iterate over how many bags we should remove and choose the one that minimizes the total amount of beans to remove?", "Sort the bags of beans first." ] }, { "question_id": 2172, "task_id": "maximum-and-sum-of-array", "drop": [], "similar": [ "minimum-xor-sum-of-two-arrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "numSlots" ], "tests": { "total": 89, "kept": 68, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= numSlots <= 9" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= n <= 2 * numSlots" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= numSlots <= 9" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= n <= 2 * numSlots" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= n <= 2 * numSlots" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= n <= 2 * numSlots" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 15" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= n <= 2 * numSlots" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= n <= 2 * numSlots", "1 <= nums[i] <= 15" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= n <= 2 * numSlots" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 15" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= n <= 2 * numSlots" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 15" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= numSlots <= 9" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 15" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 15" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 15" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 15" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= numSlots <= 9" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= n <= 2 * numSlots" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= numSlots <= 9", "1 <= nums[i] <= 15" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can you think of a dynamic programming solution to this problem?", "Can you use a bitmask to represent the state of the slots?" ] }, { "question_id": 2174, "task_id": "remove-all-ones-with-row-and-column-flips-ii", "drop": [ "premium" ] }, { "question_id": 2176, "task_id": "count-equal-and-divisible-pairs-in-an-array", "drop": [], "similar": [ "count-number-of-pairs-with-absolute-difference-k", "count-number-of-bad-pairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 89, "kept": 87, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i], k <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For every possible pair of indices (i, j) where i < j, check if it satisfies the given conditions." ] }, { "question_id": 2177, "task_id": "find-three-consecutive-integers-that-sum-to-a-given-number", "drop": [], "similar": [ "longest-consecutive-sequence", "number-of-ways-to-buy-pens-and-pencils" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 52, "kept": 50, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "0 <= num <= 10**(15)" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= num <= 10**(15)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Notice that if a solution exists, we can represent them as x-1, x, x+1. What does this tell us about the number?", "Notice the sum of the numbers will be 3x. Can you solve for x?" ] }, { "question_id": 2178, "task_id": "maximum-split-of-positive-even-integers", "drop": [], "similar": [], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "finalSum" ], "tests": { "total": 50, "kept": 50, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "First, check if finalSum is divisible by 2. If it isn\u2019t, then we cannot split it into even integers.", "Let k be the number of elements in our split. As we want the maximum number of elements, we should try to use the first k - 1 even elements to grow our sum as slowly as possible.", "Thus, we find the maximum sum of the first k - 1 even elements which is less than finalSum.", "We then add the difference over to the kth element." ] }, { "question_id": 2179, "task_id": "count-good-triplets-in-an-array", "drop": [], "similar": [ "count-of-smaller-numbers-after-self", "increasing-triplet-subsequence", "create-sorted-array-through-instructions", "number-of-good-paths", "count-increasing-quadruplets" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 100, "kept": 100, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums1 and nums2 are permutations of [0, 1, ..., n - 1]." ], "public_tests": 2, "hints": [ "For every value y, how can you find the number of values x (0 \u2264 x, y \u2264 n - 1) such that x appears before y in both of the arrays?", "Similarly, for every value y, try finding the number of values z (0 \u2264 y, z \u2264 n - 1) such that z appears after y in both of the arrays.", "Now, for every value y, count the number of good triplets that can be formed if y is considered as the middle element." ] }, { "question_id": 2180, "task_id": "count-integers-with-even-digit-sum", "drop": [], "similar": [ "sum-of-numbers-with-units-digit-k", "sum-of-digits-of-string-after-convert", "number-of-ways-to-buy-pens-and-pencils", "separate-the-digits-in-an-array", "find-if-digit-game-can-be-won", "count-evenly-good-integers" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 34, "kept": 34, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate through all integers from 1 to num.", "For any integer, extract the individual digits to compute their sum and check if it is even." ] }, { "question_id": 2181, "task_id": "merge-nodes-in-between-zeros", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "linked-list-components" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the list is in the range [3, 2 * 10**(5)].", "0 <= Node.val <= 1000", "There are no two consecutive nodes with Node.val == 0.", "The beginning and end of the linked list have Node.val == 0." ] }, { "question_id": 2182, "task_id": "construct-string-with-repeat-limit", "drop": [], "similar": [ "rearrange-string-k-distance-apart" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "repeatLimit" ], "tests": { "total": 66, "kept": 65, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 61, "end_line": 61, "violates": [ "1 <= repeatLimit <= s.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Start constructing the string in descending order of characters.", "When repeatLimit is reached, pick the next largest character." ] }, { "question_id": 2183, "task_id": "count-array-pairs-divisible-by-k", "drop": [], "similar": [ "number-of-single-divisor-triplets", "check-if-array-pairs-are-divisible-by-k", "find-the-number-of-good-pairs-ii", "find-the-number-of-good-pairs-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 102, "kept": 101, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i], k <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For any element in the array, what is the smallest number it should be multiplied with such that the product is divisible by k?", "The smallest number which should be multiplied with nums[i] so that the product is divisible by k is k / gcd(k, nums[i]). Now think about how you can store and update the count of such numbers present in the array efficiently." ] }, { "question_id": 2184, "task_id": "number-of-ways-to-build-sturdy-brick-wall", "drop": [ "premium" ] }, { "question_id": 2185, "task_id": "counting-words-with-a-given-prefix", "drop": [], "similar": [ "check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence", "count-prefixes-of-a-given-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "words", "pref" ], "tests": { "total": 153, "kept": 153, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Go through each word in words and increment the answer if pref is a prefix of the word." ] }, { "question_id": 2186, "task_id": "minimum-number-of-steps-to-make-two-strings-anagram-ii", "drop": [], "similar": [ "minimum-number-of-steps-to-make-two-strings-anagram" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 110, "kept": 102, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= s.length, t.length <= 2 * 10**(5)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= s.length, t.length <= 2 * 10**(5)" ] }, { "line": 25, "end_line": 25, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= s.length, t.length <= 2 * 10**(5)" ] }, { "line": 58, "end_line": 58, "violates": [ "s and t consist of lowercase English letters." ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= s.length, t.length <= 2 * 10**(5)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= s.length, t.length <= 2 * 10**(5)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= s.length, t.length <= 2 * 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Notice that for anagrams, the order of the letters is irrelevant.", "For each letter, we can count its frequency in s and t.", "For each letter, its contribution to the answer is the absolute difference between its frequency in s and t." ] }, { "question_id": 2187, "task_id": "minimum-time-to-complete-trips", "drop": [], "similar": [ "maximum-candies-allocated-to-k-children", "minimum-speed-to-arrive-on-time", "minimized-maximum-of-products-distributed-to-any-store", "maximum-running-time-of-n-computers", "maximum-number-of-robots-within-budget", "minimize-maximum-of-array", "minimum-amount-of-damage-dealt-to-bob" ], "flags": [], "comparison": "exact", "parameter_names": [ "time", "totalTrips" ], "tests": { "total": 103, "kept": 103, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For a given amount of time, how can we count the total number of trips completed by all buses within that time?", "Consider using binary search." ], "similar_to_test": [ "3273 minimum-amount-of-damage-dealt-to-bob" ] }, { "question_id": 2188, "task_id": "minimum-time-to-finish-the-race", "drop": [], "similar": [ "minimum-skips-to-arrive-at-meeting-on-time" ], "flags": [], "comparison": "exact", "parameter_names": [ "tires", "changeTime", "numLaps" ], "tests": { "total": 100, "kept": 98, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 46, "end_line": 46, "violates": [ "1 <= fi, changeTime <= 10**(5)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= fi, changeTime <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What is the maximum number of times we would want to go around the track without changing tires?", "Can we precompute the minimum time to go around the track x times without changing tires?", "Can we use dynamic programming to solve this efficiently using the precomputed values?" ] }, { "question_id": 2189, "task_id": "number-of-ways-to-build-house-of-cards", "drop": [ "premium" ] }, { "question_id": 2190, "task_id": "most-frequent-number-following-key-in-an-array", "drop": [], "similar": [ "sort-array-by-increasing-frequency" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "key" ], "tests": { "total": 103, "kept": 101, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [ "The test cases will be generated such that the answer is unique." ], "public_tests": 2, "hints": [ "Count the number of times each target value follows the key in the array.", "Choose the target with the maximum count and return it." ] }, { "question_id": 2191, "task_id": "sort-the-jumbled-numbers", "drop": [], "similar": [ "map-sum-pairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "mapping", "nums" ], "tests": { "total": 110, "kept": 55, "dropped": { "constraint_violation": 55 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 20, "end_line": 20, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "All the values of mapping[i] are unique." ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 35, "end_line": 35, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 37, "end_line": 37, "violates": [ "All the values of mapping[i] are unique.", "0 <= nums[i] < 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 40, "end_line": 40, "violates": [ "All the values of mapping[i] are unique.", "0 <= nums[i] < 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "All the values of mapping[i] are unique." ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 67, "end_line": 67, "violates": [ "All the values of mapping[i] are unique.", "0 <= nums[i] < 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "All the values of mapping[i] are unique." ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 72, "end_line": 72, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 73, "end_line": 73, "violates": [ "All the values of mapping[i] are unique.", "0 <= nums[i] < 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "All the values of mapping[i] are unique." ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 81, "end_line": 81, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 83, "end_line": 83, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 93, "end_line": 93, "violates": [ "All the values of mapping[i] are unique." ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 98, "end_line": 98, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 99, "end_line": 99, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 103, "end_line": 103, "violates": [ "All the values of mapping[i] are unique." ] }, { "line": 104, "end_line": 104, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 108, "end_line": 108, "violates": [ "0 <= nums[i] < 10**(9)" ] }, { "line": 110, "end_line": 110, "violates": [ "0 <= nums[i] < 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Map the original numbers to new numbers by the mapping rule and sort the new numbers.", "To maintain the same relative order for equal mapped values, use the index in the original input array as a tiebreaker." ] }, { "question_id": 2192, "task_id": "all-ancestors-of-a-node-in-a-directed-acyclic-graph", "drop": [], "similar": [ "number-of-restricted-paths-from-first-to-last-node" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 63, "kept": 63, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There are no duplicate edges.", "The graph is directed and acyclic." ], "public_tests": 2, "hints": [ "Consider how reversing each edge of the graph can help us.", "How can performing BFS/DFS on the reversed graph help us find the ancestors of every node?" ] }, { "question_id": 2193, "task_id": "minimum-number-of-moves-to-make-palindrome", "drop": [], "similar": [ "minimum-insertion-steps-to-make-a-string-palindrome", "minimum-number-of-flips-to-make-binary-grid-palindromic-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 105, "kept": 105, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s can be converted to a palindrome using a finite number of moves." ], "public_tests": 2, "hints": [ "Consider a greedy strategy.", "Let\u2019s start by making the leftmost and rightmost characters match with some number of swaps.", "If we figure out how to do that using the minimum number of swaps, then we can delete the leftmost and rightmost characters and solve the problem recursively." ] }, { "question_id": 2194, "task_id": "cells-in-a-range-on-an-excel-sheet", "drop": [], "similar": [ "excel-sheet-column-title", "excel-sheet-column-number", "matrix-cells-in-distance-order" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 175, "kept": 93, "dropped": { "constraint_violation": 82 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 15, "end_line": 15, "violates": [ "s.length == 5" ] }, { "line": 16, "end_line": 16, "violates": [ "s.length == 5" ] }, { "line": 20, "end_line": 20, "violates": [ "s.length == 5" ] }, { "line": 25, "end_line": 25, "violates": [ "s.length == 5" ] }, { "line": 27, "end_line": 27, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 28, "end_line": 28, "violates": [ "s.length == 5" ] }, { "line": 29, "end_line": 29, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 32, "end_line": 32, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 35, "end_line": 35, "violates": [ "s.length == 5" ] }, { "line": 36, "end_line": 36, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 39, "end_line": 39, "violates": [ "s.length == 5" ] }, { "line": 43, "end_line": 43, "violates": [ "s.length == 5" ] }, { "line": 44, "end_line": 44, "violates": [ "s.length == 5" ] }, { "line": 46, "end_line": 46, "violates": [ "s.length == 5" ] }, { "line": 47, "end_line": 47, "violates": [ "s.length == 5" ] }, { "line": 48, "end_line": 48, "violates": [ "s.length == 5" ] }, { "line": 50, "end_line": 50, "violates": [ "s.length == 5" ] }, { "line": 52, "end_line": 52, "violates": [ "s.length == 5" ] }, { "line": 53, "end_line": 53, "violates": [ "s.length == 5" ] }, { "line": 56, "end_line": 56, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 58, "end_line": 58, "violates": [ "s.length == 5" ] }, { "line": 62, "end_line": 62, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 63, "end_line": 63, "violates": [ "s.length == 5" ] }, { "line": 64, "end_line": 64, "violates": [ "s.length == 5" ] }, { "line": 65, "end_line": 65, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 66, "end_line": 66, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 67, "end_line": 67, "violates": [ "s.length == 5" ] }, { "line": 68, "end_line": 68, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 70, "end_line": 70, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 71, "end_line": 71, "violates": [ "s.length == 5" ] }, { "line": 73, "end_line": 73, "violates": [ "s.length == 5" ] }, { "line": 76, "end_line": 76, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 77, "end_line": 77, "violates": [ "s.length == 5" ] }, { "line": 78, "end_line": 78, "violates": [ "s.length == 5" ] }, { "line": 80, "end_line": 80, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 81, "end_line": 81, "violates": [ "s.length == 5" ] }, { "line": 84, "end_line": 84, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 85, "end_line": 85, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 91, "end_line": 91, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 92, "end_line": 92, "violates": [ "s.length == 5" ] }, { "line": 93, "end_line": 93, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 94, "end_line": 94, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 95, "end_line": 95, "violates": [ "s.length == 5" ] }, { "line": 96, "end_line": 96, "violates": [ "s.length == 5" ] }, { "line": 97, "end_line": 97, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 99, "end_line": 99, "violates": [ "s.length == 5" ] }, { "line": 103, "end_line": 103, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 104, "end_line": 104, "violates": [ "s.length == 5" ] }, { "line": 105, "end_line": 105, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 106, "end_line": 106, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 107, "end_line": 107, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 108, "end_line": 108, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 113, "end_line": 113, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 114, "end_line": 114, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 116, "end_line": 116, "violates": [ "s.length == 5" ] }, { "line": 119, "end_line": 119, "violates": [ "s.length == 5" ] }, { "line": 122, "end_line": 122, "violates": [ "s.length == 5" ] }, { "line": 123, "end_line": 123, "violates": [ "s.length == 5" ] }, { "line": 124, "end_line": 124, "violates": [ "s.length == 5" ] }, { "line": 126, "end_line": 126, "violates": [ "s.length == 5" ] }, { "line": 128, "end_line": 128, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 129, "end_line": 129, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 130, "end_line": 130, "violates": [ "s.length == 5" ] }, { "line": 131, "end_line": 131, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 134, "end_line": 134, "violates": [ "s.length == 5" ] }, { "line": 136, "end_line": 136, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 139, "end_line": 139, "violates": [ "s.length == 5" ] }, { "line": 140, "end_line": 140, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 143, "end_line": 143, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 144, "end_line": 144, "violates": [ "s.length == 5" ] }, { "line": 146, "end_line": 146, "violates": [ "s.length == 5" ] }, { "line": 147, "end_line": 147, "violates": [ "s.length == 5" ] }, { "line": 148, "end_line": 148, "violates": [ "s.length == 5" ] }, { "line": 149, "end_line": 149, "violates": [ "s.length == 5" ] }, { "line": 153, "end_line": 153, "violates": [ "s.length == 5" ] }, { "line": 160, "end_line": 160, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 165, "end_line": 165, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 167, "end_line": 167, "violates": [ "s.length == 5", "'A' <= s[0] <= s[3] <= 'Z'", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 172, "end_line": 172, "violates": [ "s.length == 5", "'1' <= s[1] <= s[4] <= '9'" ] }, { "line": 174, "end_line": 174, "violates": [ "s.length == 5" ] }, { "line": 176, "end_line": 176, "violates": [ "s.length == 5" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "From the given string, find the corresponding rows and columns.", "Iterate through the columns in ascending order and for each column, iterate through the rows in ascending order to obtain the required cells in sorted order." ] }, { "question_id": 2195, "task_id": "append-k-integers-with-minimal-sum", "drop": [], "similar": [ "remove-k-digits", "find-all-numbers-disappeared-in-an-array", "kth-missing-positive-number", "maximum-number-of-integers-to-choose-from-a-range-i", "maximum-number-of-integers-to-choose-from-a-range-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 111, "kept": 110, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The k smallest numbers that do not appear in nums will result in the minimum sum.", "Recall that the sum of the first n positive numbers is equal to n * (n+1) / 2.", "Initialize the answer as the sum of 1 to k. Then, adjust the answer depending on the values in nums." ] }, { "question_id": 2196, "task_id": "create-binary-tree-from-descriptions", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "convert-sorted-list-to-binary-search-tree", "number-of-ways-to-reconstruct-a-tree" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "descriptions" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The binary tree described by descriptions is valid." ] }, { "question_id": 2197, "task_id": "replace-non-coprime-numbers-in-array", "drop": [], "similar": [ "remove-all-adjacent-duplicates-in-string-ii", "number-of-pairs-of-interchangeable-rectangles", "split-the-array-to-make-coprime-products" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 134, "kept": 121, "dropped": { "int_overflow": 10, "constraint_violation": 3 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 45, "end_line": 45, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 65, "end_line": 65, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 91, "end_line": 91, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 95, "end_line": 95, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 97, "end_line": 97, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 115, "end_line": 115, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 119, "end_line": 119, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 121, "end_line": 121, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 122, "end_line": 122, "unrepresentable_in": [ "cpp", "rust", "java" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [ "The test cases are generated such that the values in the final array are less than or equal to 10**(8)." ], "public_tests": 2, "hints": [ "Notice that the order of merging two numbers into their LCM does not matter so we can greedily merge elements to its left if possible.", "If a new value is formed, we should recursively check if it can be merged with the value to its left.", "To simulate the merge efficiently, we can maintain a stack that stores processed elements. When we iterate through the array, we only compare with the top of the stack (which is the value to its left)." ] }, { "question_id": 2198, "task_id": "number-of-single-divisor-triplets", "drop": [ "premium" ] }, { "question_id": 2200, "task_id": "find-all-k-distant-indices-in-an-array", "drop": [], "similar": [ "two-sum", "shortest-word-distance", "minimum-absolute-difference-between-elements-with-constraint" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "key", "k" ], "tests": { "total": 107, "kept": 95, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= k <= nums.length" ] }, { "line": 6, "end_line": 6, "violates": [ "1 <= k <= nums.length" ] }, { "line": 7, "end_line": 7, "violates": [ "1 <= k <= nums.length" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 1000", "1 <= k <= nums.length" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= k <= nums.length" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= k <= nums.length" ] } ], "unchecked_constraints": [ "key is an integer from the array nums." ], "public_tests": 2, "hints": [ "For every occurrence of key in nums, find all indices within distance k from it.", "Use a hash table to remove duplicate indices." ] }, { "question_id": 2201, "task_id": "count-artifacts-that-can-be-extracted", "drop": [], "similar": [ "maximal-square" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "artifacts", "dig" ], "tests": { "total": 66, "kept": 66, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "No two artifacts will overlap.", "The number of cells covered by an artifact is at most 4.", "The entries of dig are unique." ], "public_tests": 2, "hints": [ "Check if each coordinate of each artifact has been excavated. How can we do this quickly without iterating over the dig array every time?", "Consider marking all excavated cells in a 2D boolean array." ] }, { "question_id": 2202, "task_id": "maximize-the-topmost-element-after-k-moves", "drop": [], "similar": [ "gas-station" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 148, "kept": 147, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "0 <= nums[i], k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each index i, how can we check if nums[i] can be present at the top of the pile or not after k moves?", "For which conditions will we end up with an empty pile?" ] }, { "question_id": 2203, "task_id": "minimum-weighted-subgraph-with-the-required-paths", "drop": [], "similar": [ "minimum-cost-to-make-at-least-one-valid-path-in-a-grid", "escape-the-spreading-fire", "disconnect-path-in-a-binary-matrix-by-at-most-one-flip" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "src1", "src2", "dest" ], "tests": { "total": 58, "kept": 58, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "src1, src2, and dest are pairwise distinct.", "1 <= weight[i] <= 10**(5)" ], "public_tests": 2, "hints": [ "Consider what the paths from src1 to dest and src2 to dest would look like in the optimal solution.", "It can be shown that in an optimal solution, the two paths from src1 and src2 will coincide at one node, and the remaining part to dest will be the same for both paths. Now consider how to find the node where the paths will coincide.", "How can algorithms for finding the shortest path between two nodes help us?" ] }, { "question_id": 2204, "task_id": "distance-to-a-cycle-in-undirected-graph", "drop": [ "premium" ] }, { "question_id": 2206, "task_id": "divide-array-into-equal-pairs", "drop": [], "similar": [ "sort-array-by-increasing-frequency", "distribute-elements-into-two-arrays-i", "distribute-elements-into-two-arrays-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 91, "kept": 87, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 500" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 500" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 500" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 500" ] } ], "unchecked_constraints": [ "nums.length == 2 * n", "1 <= n <= 500" ], "public_tests": 2, "hints": [ "For any number x in the range [1, 500], count the number of elements in nums whose values are equal to x.", "The elements with equal value can be divided completely into pairs if and only if their count is even." ] }, { "question_id": 2207, "task_id": "maximize-number-of-subsequences-in-a-string", "drop": [], "similar": [ "longest-common-subsequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "text", "pattern" ], "tests": { "total": 138, "kept": 136, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= text.length <= 10**(5)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= text.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Find the optimal position to add pattern[0] so that the number of subsequences is maximized. Similarly, find the optimal position to add pattern[1].", "For each of the above cases, count the number of times the pattern occurs as a subsequence in text. The larger count is the required answer." ] }, { "question_id": 2208, "task_id": "minimum-operations-to-halve-array-sum", "drop": [], "similar": [ "remove-stones-to-minimize-the-total", "minimum-operations-to-exceed-threshold-value-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 81, "kept": 77, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 10**(7)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10**(7)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(7)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It is always optimal to halve the largest element.", "What data structure allows for an efficient query of the maximum element?", "Use a heap or priority queue to maintain the current elements." ] }, { "question_id": 2209, "task_id": "minimum-white-tiles-after-covering-with-carpets", "drop": [], "similar": [ "edit-distance" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "floor", "numCarpets", "carpetLen" ], "tests": { "total": 110, "kept": 108, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 82, "end_line": 82, "violates": [ "1 <= carpetLen <= floor.length <= 1000" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= carpetLen <= floor.length <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can you think of a DP solution?", "Let DP[i][j] denote the minimum number of white tiles still visible from indices i to floor.length-1 after covering with at most j carpets.", "The transition will be whether to put down the carpet at position i (if possible), or not." ] }, { "question_id": 2210, "task_id": "count-hills-and-valleys-in-an-array", "drop": [], "similar": [ "find-peak-element", "monotonic-array", "minimum-subsequence-in-non-increasing-order" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 154, "kept": 154, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each index, could you find the closest non-equal neighbors?", "Ensure that adjacent indices that are part of the same hill or valley are not double-counted." ] }, { "question_id": 2211, "task_id": "count-collisions-on-a-road", "drop": [], "similar": [ "asteroid-collision", "car-fleet", "last-moment-before-all-ants-fall-out-of-a-plank", "car-fleet-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "directions" ], "tests": { "total": 177, "kept": 177, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "In what circumstances does a moving car not collide with another car?", "If we disregard the moving cars that do not collide with another car, what does each moving car contribute to the answer?", "Will stationary cars contribute towards the answer?" ] }, { "question_id": 2212, "task_id": "maximum-points-in-an-archery-competition", "drop": [], "similar": [ "maximum-product-of-the-length-of-two-palindromic-subsequences" ], "flags": [ "multiple_answers", "has_images" ], "comparison": "exact", "parameter_names": [ "numArrows", "aliceArrows" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "aliceArrows.length == bobArrows.length == 12", "0 <= aliceArrows[i], bobArrows[i] <= numArrows", "sum(aliceArrows[i]) == numArrows" ], "public_tests": 2, "hints": [ "To obtain points for some certain section x, what is the minimum number of arrows Bob must shoot?", "Given the small number of sections, can we brute force which sections Bob wants to win?", "For every set of sections Bob wants to win, check if we have the required amount of arrows. If we do, it is a valid selection." ] }, { "question_id": 2213, "task_id": "longest-substring-of-one-repeating-character", "drop": [], "similar": [ "merge-intervals", "longest-repeating-character-replacement", "consecutive-characters", "create-sorted-array-through-instructions", "longest-increasing-subsequence-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "queryCharacters", "queryIndices" ], "tests": { "total": 80, "kept": 69, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "k == queryCharacters.length == queryIndices.length" ] }, { "line": 22, "end_line": 22, "violates": [ "k == queryCharacters.length == queryIndices.length", "0 <= queryIndices[i] < s.length" ] }, { "line": 27, "end_line": 27, "violates": [ "k == queryCharacters.length == queryIndices.length", "0 <= queryIndices[i] < s.length" ] }, { "line": 35, "end_line": 35, "violates": [ "k == queryCharacters.length == queryIndices.length" ] }, { "line": 46, "end_line": 46, "violates": [ "k == queryCharacters.length == queryIndices.length" ] }, { "line": 51, "end_line": 51, "violates": [ "k == queryCharacters.length == queryIndices.length" ] }, { "line": 54, "end_line": 54, "violates": [ "k == queryCharacters.length == queryIndices.length", "0 <= queryIndices[i] < s.length" ] }, { "line": 62, "end_line": 62, "violates": [ "k == queryCharacters.length == queryIndices.length" ] }, { "line": 79, "end_line": 79, "violates": [ "k == queryCharacters.length == queryIndices.length", "0 <= queryIndices[i] < s.length" ] }, { "line": 80, "end_line": 80, "violates": [ "k == queryCharacters.length == queryIndices.length", "0 <= queryIndices[i] < s.length" ] }, { "line": 81, "end_line": 81, "violates": [ "k == queryCharacters.length == queryIndices.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a segment tree to perform fast point updates and range queries.", "We need each segment tree node to store the length of the longest substring of that segment consisting of only 1 repeating character.", "We will also have each segment tree node store the leftmost and rightmost character of the segment, the max length of a prefix substring consisting of only 1 repeating character, and the max length of a suffix substring consisting of only 1 repeating character.", "Use this information to properly merge the two segment tree nodes together." ] }, { "question_id": 2214, "task_id": "minimum-health-to-beat-game", "drop": [ "premium" ] }, { "question_id": 2215, "task_id": "find-the-difference-of-two-arrays", "drop": [], "similar": [ "intersection-of-two-arrays", "intersection-of-two-arrays-ii", "intersection-of-multiple-arrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 112, "kept": 107, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= nums1.length, nums2.length <= 1000" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= nums1.length, nums2.length <= 1000" ] }, { "line": 38, "end_line": 38, "violates": [ "-1000 <= nums1[i], nums2[i] <= 1000" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums1.length, nums2.length <= 1000" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= nums1.length, nums2.length <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each integer in nums1, check if it exists in nums2.", "Do the same for each integer in nums2." ] }, { "question_id": 2216, "task_id": "minimum-deletions-to-make-array-beautiful", "drop": [], "similar": [ "minimum-deletions-to-make-character-frequencies-unique", "minimum-operations-to-make-the-array-alternating" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 125, "kept": 123, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= nums.length <= 10**(5)" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Delete as many adjacent equal elements as necessary.", "If the length of nums is odd after the entire process, delete the last element." ] }, { "question_id": 2217, "task_id": "find-palindrome-with-fixed-length", "drop": [], "similar": [ "palindrome-number", "find-the-closest-palindrome", "lexicographically-smallest-beautiful-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "queries", "intLength" ], "tests": { "total": 110, "kept": 110, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For any value of queries[i] and intLength, how can you check if there exists at least queries[i] palindromes of length intLength?", "Since a palindrome reads the same forwards and backwards, consider how you can efficiently find the first half (ceil(intLength/2) digits) of the palindrome." ] }, { "question_id": 2218, "task_id": "maximum-value-of-k-coins-from-piles", "drop": [], "similar": [ "coin-change", "coin-change-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "piles", "k" ], "tests": { "total": 96, "kept": 94, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "1 <= piles[i][j] <= 10**(5)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= piles[i][j] <= 10**(5)" ] } ], "unchecked_constraints": [ "1 <= k <= sum(piles[i].length) <= 2000" ], "public_tests": 2, "hints": [ "For each pile i, what will be the total value of coins we can collect if we choose the first j coins?", "How can we use dynamic programming to combine the results from different piles to find the most optimal answer?" ] }, { "question_id": 2219, "task_id": "maximum-sum-score-of-array", "drop": [ "premium" ] }, { "question_id": 2220, "task_id": "minimum-bit-flips-to-convert-number", "drop": [], "similar": [ "minimum-flips-to-make-a-or-b-equal-to-c", "minimum-number-of-operations-to-make-array-xor-equal-to-k", "smallest-number-with-all-set-bits" ], "flags": [], "comparison": "exact", "parameter_names": [ "start", "goal" ], "tests": { "total": 85, "kept": 66, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 35, "end_line": 35, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= start, goal <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= start, goal <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If the value of a bit in start and goal differ, then we need to flip that bit.", "Consider using the XOR operation to determine which bits need a bit flip." ], "similar_to_test": [ "3370 smallest-number-with-all-set-bits" ] }, { "question_id": 2221, "task_id": "find-triangular-sum-of-an-array", "drop": [], "similar": [ "pascals-triangle-ii", "calculate-digit-sum-of-a-string", "min-max-game" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 96, "kept": 92, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= nums[i] <= 9" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= nums[i] <= 9" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try simulating the entire process.", "To reduce space, use a temporary array to update nums in every step instead of creating a new array at each step." ] }, { "question_id": 2222, "task_id": "number-of-ways-to-select-buildings", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 162, "kept": 162, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "There are only 2 valid patterns: \u2018101\u2019 and \u2018010\u2019. Think about how we can construct these 2 patterns from smaller patterns.", "Count the number of subsequences of the form \u201801\u2019 or \u201810\u2019 first. Let n01[i] be the number of \u201801\u2019 subsequences that exist in the prefix of s up to the ith building. How can you compute n01[i]?", "Let n0[i] and n1[i] be the number of \u20180\u2019s and \u20181\u2019s that exists in the prefix of s up to i respectively. Then n01[i] = n01[i \u2013 1] if s[i] == \u20180\u2019, otherwise n01[i] = n01[i \u2013 1] + n0[i \u2013 1].", "The same logic applies to building the n10 array and subsequently the n101 and n010 arrays for the number of \u2018101\u2019 and \u2018010\u2018 subsequences." ] }, { "question_id": 2223, "task_id": "sum-of-scores-of-built-strings", "drop": [], "similar": [ "longest-happy-prefix" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 123, "kept": 123, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Each s_i is a suffix of the string s, so consider algorithms that can determine the longest prefix that is also a suffix.", "Could you use the Z array from the Z algorithm to find the score of each s_i?" ] }, { "question_id": 2224, "task_id": "minimum-number-of-operations-to-convert-time", "drop": [], "similar": [ "coin-change", "design-an-atm-machine", "count-days-spent-together" ], "flags": [], "comparison": "exact", "parameter_names": [ "current", "correct" ], "tests": { "total": 138, "kept": 135, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "current <= correct" ] }, { "line": 32, "end_line": 32, "violates": [ "current <= correct" ] }, { "line": 133, "end_line": 133, "violates": [ "current <= correct" ] } ], "unchecked_constraints": [ "current and correct are in the format \"HH:MM\"" ], "public_tests": 2, "hints": [ "Convert the times to minutes.", "Use the operation with the biggest value possible at each step." ] }, { "question_id": 2225, "task_id": "find-players-with-zero-or-one-losses", "drop": [], "similar": [ "lowest-common-ancestor-of-a-binary-tree" ], "flags": [], "comparison": "exact", "parameter_names": [ "matches" ], "tests": { "total": 69, "kept": 66, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "All matches[i] are unique." ] }, { "line": 45, "end_line": 45, "violates": [ "All matches[i] are unique." ] }, { "line": 62, "end_line": 62, "violates": [ "All matches[i] are unique." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Count the number of times a player loses while iterating through the matches." ] }, { "question_id": 2226, "task_id": "maximum-candies-allocated-to-k-children", "drop": [], "similar": [ "koko-eating-bananas", "minimum-limit-of-balls-in-a-bag", "minimum-speed-to-arrive-on-time", "maximum-number-of-removable-characters", "minimized-maximum-of-products-distributed-to-any-store", "minimum-time-to-complete-trips", "minimize-maximum-of-array", "maximize-happiness-of-selected-children" ], "flags": [], "comparison": "exact", "parameter_names": [ "candies", "k" ], "tests": { "total": 82, "kept": 80, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= candies[i] <= 10**(7)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= candies[i] <= 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For a fixed number of candies c, how can you check if each child can get c candies?", "Use binary search to find the maximum c as the answer." ] }, { "question_id": 2229, "task_id": "check-if-an-array-is-consecutive", "drop": [ "premium" ] }, { "question_id": 2231, "task_id": "largest-number-after-digit-swaps-by-parity", "drop": [], "similar": [ "largest-number-at-least-twice-of-others", "sort-array-by-parity", "sort-array-by-parity-ii", "smallest-string-with-swaps", "rearrange-array-elements-by-sign" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 78, "kept": 20, "dropped": { "constraint_violation": 58 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= num <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The bigger digit should appear first (more to the left) because it contributes more to the value of the number.", "Get all the even digits, as well as odd digits. Sort them separately.", "Reconstruct the number by giving the earlier digits the highest available digit of the same parity." ] }, { "question_id": 2232, "task_id": "minimize-result-by-adding-parentheses-to-expression", "drop": [], "similar": [ "basic-calculator", "different-ways-to-add-parentheses", "solve-the-equation" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "expression" ], "tests": { "total": 134, "kept": 105, "dropped": { "constraint_violation": 29 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 42, "end_line": 42, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 46, "end_line": 46, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 51, "end_line": 51, "violates": [ "3 <= expression.length <= 10", "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 52, "end_line": 52, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 54, "end_line": 54, "violates": [ "3 <= expression.length <= 10", "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 56, "end_line": 56, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 58, "end_line": 58, "violates": [ "3 <= expression.length <= 10" ] }, { "line": 60, "end_line": 60, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 67, "end_line": 67, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 68, "end_line": 68, "violates": [ "3 <= expression.length <= 10", "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 69, "end_line": 69, "violates": [ "3 <= expression.length <= 10", "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 70, "end_line": 70, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 71, "end_line": 71, "violates": [ "3 <= expression.length <= 10", "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 72, "end_line": 72, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 73, "end_line": 73, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 74, "end_line": 74, "violates": [ "3 <= expression.length <= 10", "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 83, "end_line": 83, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 86, "end_line": 86, "violates": [ "3 <= expression.length <= 10" ] }, { "line": 92, "end_line": 92, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 96, "end_line": 96, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 104, "end_line": 104, "violates": [ "3 <= expression.length <= 10" ] }, { "line": 106, "end_line": 106, "violates": [ "3 <= expression.length <= 10" ] }, { "line": 115, "end_line": 115, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 116, "end_line": 116, "violates": [ "3 <= expression.length <= 10" ] }, { "line": 118, "end_line": 118, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 121, "end_line": 121, "violates": [ "3 <= expression.length <= 10", "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 128, "end_line": 128, "violates": [ "expression consists of digits from '1' to '9' and '+'." ] }, { "line": 130, "end_line": 130, "violates": [ "3 <= expression.length <= 10" ] } ], "unchecked_constraints": [ "expression starts and ends with digits.", "expression contains exactly one '+'.", "The original value of expression, and the value of expression after adding any pair of parentheses that meets the requirements fits within a signed 32-bit integer." ], "public_tests": 3, "hints": [ "The maximum length of expression is very low. We can try every possible spot to place the parentheses.", "Every possibility of expression is of the form a * (b + c) * d where a, b, c, d represent integers. Note the edge cases where a and/or d do not exist, in which case use 1 instead of them." ] }, { "question_id": 2233, "task_id": "maximum-product-after-k-increments", "drop": [], "similar": [ "minimum-size-subarray-sum", "minimum-increment-to-make-array-unique", "minimum-operations-to-make-the-array-increasing" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 101, "kept": 85, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= nums.length, k <= 10**(5)", "1 <= nums.length, k <= 10**(5)" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= nums.length, k <= 10**(5)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= nums.length, k <= 10**(5)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= nums.length, k <= 10**(5)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= nums.length, k <= 10**(5)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums.length, k <= 10**(5)", "1 <= nums.length, k <= 10**(5)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums.length, k <= 10**(5)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums.length, k <= 10**(5)", "1 <= nums.length, k <= 10**(5)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums.length, k <= 10**(5)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums.length, k <= 10**(5)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums.length, k <= 10**(5)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums.length, k <= 10**(5)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums.length, k <= 10**(5)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums.length, k <= 10**(5)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= nums.length, k <= 10**(5)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums.length, k <= 10**(5)", "1 <= nums.length, k <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If you can increment only once, which number should you increment?", "We should always prioritize the smallest number. What kind of data structure could we use?", "Use a min heap to hold all the numbers. Each time we do an operation, replace the top of the heap x by x + 1." ] }, { "question_id": 2234, "task_id": "maximum-total-beauty-of-the-gardens", "drop": [], "similar": [ "split-array-largest-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "flowers", "newFlowers", "target", "full", "partial" ], "tests": { "total": 113, "kept": 106, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= newFlowers <= 10**(10)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= flowers[i], target <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= flowers[i], target <= 10**(5)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= flowers[i], target <= 10**(5)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= newFlowers <= 10**(10)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= flowers[i], target <= 10**(5)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= flowers[i], target <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Say we choose k gardens to be complete, is there an optimal way of choosing which gardens to plant more flowers to achieve this?", "For a given k, we should greedily fill-up the k gardens with the most flowers planted already. This gives us the most remaining flowers to fill up the other gardens.", "After sorting flowers, we can thus try every possible k and what is left is to find the highest minimum flowers we can obtain by planting the remaining flowers in the other gardens.", "To find the highest minimum in the other gardens, we can use binary search to find the most optimal way of planting." ] }, { "question_id": 2235, "task_id": "add-two-integers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "num1", "num2" ], "tests": { "total": 59, "kept": 59, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 2236, "task_id": "root-equals-sum-of-children", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 72, "kept": 0, "dropped": { "unreadable": 72 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true } ], "unchecked_constraints": [ "The tree consists only of the root, its left child, and its right child.", "-100 <= Node.val <= 100" ] }, { "question_id": 2237, "task_id": "count-positions-on-street-with-required-brightness", "drop": [ "premium" ] }, { "question_id": 2239, "task_id": "find-closest-number-to-zero", "drop": [], "similar": [ "find-k-closest-elements" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 128, "kept": 127, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 71, "end_line": 71, "violates": [ "-10**(5) <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [ "1 <= n <= 1000" ], "public_tests": 2, "hints": [ "Keep track of the number closest to 0 as you iterate through the array.", "Ensure that if multiple numbers are closest to 0, you store the one with the largest value." ] }, { "question_id": 2240, "task_id": "number-of-ways-to-buy-pens-and-pencils", "drop": [], "similar": [ "find-three-consecutive-integers-that-sum-to-a-given-number", "count-integers-with-even-digit-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "total", "cost1", "cost2" ], "tests": { "total": 102, "kept": 101, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 70, "end_line": 70, "violates": [ "1 <= total, cost1, cost2 <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Fix the number of pencils purchased and calculate the number of ways to buy pens.", "Sum up the number of ways to buy pens for each amount of pencils purchased to get the answer." ] }, { "question_id": 2242, "task_id": "maximum-score-of-a-node-sequence", "drop": [], "similar": [ "get-the-maximum-score" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "scores", "edges" ], "tests": { "total": 80, "kept": 77, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= scores[i] <= 10**(8)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= scores[i] <= 10**(8)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= scores[i] <= 10**(8)" ] } ], "unchecked_constraints": [ "There are no duplicate edges." ], "public_tests": 2, "hints": [ "For every node sequence of length 4, there are 3 relevant edges. How can we consider valid triplets of edges?", "Fix the middle 2 nodes connected by an edge in the node sequence. Can you determine the other 2 nodes that will give the highest possible score?", "The other 2 nodes must each be connected to one of the middle nodes. If we only consider nodes with the highest scores, how many should we store to ensure we don\u2019t choose duplicate nodes?", "For each node, we should store the 3 adjacent nodes with the highest scores to ensure we can find a sequence with no duplicate nodes via the method above." ] }, { "question_id": 2243, "task_id": "calculate-digit-sum-of-a-string", "drop": [], "similar": [ "add-digits", "find-triangular-sum-of-an-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 109, "kept": 104, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "2 <= k <= 100" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= s.length <= 100" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= s.length <= 100" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= s.length <= 100" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try simulating the entire process to find the final answer." ] }, { "question_id": 2244, "task_id": "minimum-rounds-to-complete-all-tasks", "drop": [], "similar": [ "climbing-stairs", "odd-string-difference", "minimum-levels-to-gain-more-points" ], "flags": [], "comparison": "exact", "parameter_names": [ "tasks" ], "tests": { "total": 58, "kept": 57, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 34, "end_line": 34, "violates": [ "1 <= tasks[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Which data structure can you use to store the number of tasks of each difficulty level?", "For any particular difficulty level, what can be the optimal strategy to complete the tasks using minimum rounds?", "When can we not complete all tasks of a difficulty level?" ] }, { "question_id": 2245, "task_id": "maximum-trailing-zeros-in-a-cornered-path", "drop": [], "similar": [ "factorial-trailing-zeroes", "bomb-enemy", "abbreviating-the-product-of-a-range" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 84, "kept": 76, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= grid[i][j] <= 1000" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= grid[i][j] <= 1000" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= grid[i][j] <= 1000" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= grid[i][j] <= 1000" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= grid[i][j] <= 1000" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= grid[i][j] <= 1000" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= grid[i][j] <= 1000" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= grid[i][j] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What actually tells us the trailing zeros of the product of a path?", "It is the sum of the exponents of 2 and sum of the exponents of 5 of the prime factorizations of the numbers on that path. The smaller of the two is the answer for that path.", "We can then treat each cell as the elbow point and calculate the largest minimum (sum of 2 exponents, sum of 5 exponents) from the combination of top-left, top-right, bottom-left and bottom-right.", "To do this efficiently, we should use the prefix sum technique." ] }, { "question_id": 2246, "task_id": "longest-path-with-different-adjacent-characters", "drop": [], "similar": [ "diameter-of-binary-tree", "longest-univalue-path", "choose-edges-to-maximize-score-in-a-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "parent", "s" ], "tests": { "total": 49, "kept": 12, "dropped": { "constraint_violation": 37 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "n == parent.length == s.length" ] }, { "line": 8, "end_line": 8, "violates": [ "n == parent.length == s.length" ] }, { "line": 9, "end_line": 9, "violates": [ "n == parent.length == s.length" ] }, { "line": 10, "end_line": 10, "violates": [ "n == parent.length == s.length" ] }, { "line": 11, "end_line": 11, "violates": [ "n == parent.length == s.length" ] }, { "line": 12, "end_line": 12, "violates": [ "n == parent.length == s.length" ] }, { "line": 13, "end_line": 13, "violates": [ "n == parent.length == s.length" ] }, { "line": 14, "end_line": 14, "violates": [ "n == parent.length == s.length" ] }, { "line": 15, "end_line": 15, "violates": [ "n == parent.length == s.length" ] }, { "line": 16, "end_line": 16, "violates": [ "n == parent.length == s.length" ] }, { "line": 18, "end_line": 18, "violates": [ "n == parent.length == s.length" ] }, { "line": 19, "end_line": 19, "violates": [ "n == parent.length == s.length" ] }, { "line": 20, "end_line": 20, "violates": [ "n == parent.length == s.length" ] }, { "line": 21, "end_line": 21, "violates": [ "n == parent.length == s.length" ] }, { "line": 22, "end_line": 22, "violates": [ "n == parent.length == s.length" ] }, { "line": 25, "end_line": 25, "violates": [ "n == parent.length == s.length" ] }, { "line": 26, "end_line": 26, "violates": [ "n == parent.length == s.length" ] }, { "line": 27, "end_line": 27, "violates": [ "n == parent.length == s.length" ] }, { "line": 28, "end_line": 28, "violates": [ "n == parent.length == s.length" ] }, { "line": 30, "end_line": 30, "violates": [ "n == parent.length == s.length" ] }, { "line": 31, "end_line": 31, "violates": [ "n == parent.length == s.length" ] }, { "line": 32, "end_line": 32, "violates": [ "n == parent.length == s.length" ] }, { "line": 33, "end_line": 33, "violates": [ "n == parent.length == s.length" ] }, { "line": 34, "end_line": 34, "violates": [ "n == parent.length == s.length" ] }, { "line": 36, "end_line": 36, "violates": [ "n == parent.length == s.length" ] }, { "line": 38, "end_line": 38, "violates": [ "n == parent.length == s.length" ] }, { "line": 39, "end_line": 39, "violates": [ "n == parent.length == s.length" ] }, { "line": 40, "end_line": 40, "violates": [ "n == parent.length == s.length" ] }, { "line": 42, "end_line": 42, "violates": [ "n == parent.length == s.length" ] }, { "line": 43, "end_line": 43, "violates": [ "n == parent.length == s.length" ] }, { "line": 44, "end_line": 44, "violates": [ "n == parent.length == s.length" ] }, { "line": 45, "end_line": 45, "violates": [ "n == parent.length == s.length" ] }, { "line": 46, "end_line": 46, "violates": [ "n == parent.length == s.length" ] }, { "line": 47, "end_line": 47, "violates": [ "n == parent.length == s.length" ] }, { "line": 48, "end_line": 48, "violates": [ "n == parent.length == s.length" ] }, { "line": 49, "end_line": 49, "violates": [ "n == parent.length == s.length" ] }, { "line": 50, "end_line": 50, "violates": [ "n == parent.length == s.length" ] } ], "unchecked_constraints": [ "0 <= parent[i] <= n - 1 for all i >= 1", "parent represents a valid tree." ], "public_tests": 2, "hints": [ "Do a DFS from the root. At each node, calculate the longest path we can make from two branches of that subtree.", "To do that, we need to find the length of the longest path from each of the node\u2019s children." ] }, { "question_id": 2247, "task_id": "maximum-cost-of-trip-with-k-highways", "drop": [ "premium" ] }, { "question_id": 2248, "task_id": "intersection-of-multiple-arrays", "drop": [], "similar": [ "intersection-of-two-arrays", "intersection-of-two-arrays-ii", "find-smallest-common-element-in-all-rows", "intersection-of-three-sorted-arrays", "find-the-difference-of-two-arrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 93, "kept": 86, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "All the values of nums[i] are unique." ] }, { "line": 6, "end_line": 6, "violates": [ "All the values of nums[i] are unique." ] }, { "line": 11, "end_line": 11, "violates": [ "All the values of nums[i] are unique." ] }, { "line": 34, "end_line": 34, "violates": [ "All the values of nums[i] are unique." ] }, { "line": 73, "end_line": 73, "violates": [ "All the values of nums[i] are unique." ] }, { "line": 91, "end_line": 91, "violates": [ "All the values of nums[i] are unique." ] }, { "line": 93, "end_line": 93, "violates": [ "All the values of nums[i] are unique." ] } ], "unchecked_constraints": [ "1 <= sum(nums[i].length) <= 1000" ], "public_tests": 2, "hints": [ "Keep a count of the number of times each integer occurs in nums.", "Since all integers of nums[i] are distinct, if an integer is present in each array, its count will be equal to the total number of arrays." ] }, { "question_id": 2249, "task_id": "count-lattice-points-inside-a-circle", "drop": [], "similar": [ "queries-on-number-of-points-inside-a-circle" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "circles" ], "tests": { "total": 114, "kept": 82, "dropped": { "constraint_violation": 32 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= ri <= min(xi, yi)" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= ri <= min(xi, yi)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each circle, how can you check whether or not a lattice point lies inside it?", "Since you need to reduce the search space, consider the minimum and maximum possible values of the coordinates of a lattice point contained in any circle." ] }, { "question_id": 2250, "task_id": "count-number-of-rectangles-containing-each-point", "drop": [], "similar": [ "queries-on-number-of-points-inside-a-circle" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "rectangles", "points" ], "tests": { "total": 64, "kept": 61, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "All the rectangles are unique." ] }, { "line": 22, "end_line": 22, "violates": [ "All the rectangles are unique." ] }, { "line": 64, "end_line": 64, "violates": [ "All the rectangles are unique." ] } ], "unchecked_constraints": [ "1 <= li, xj <= 10**(9)", "1 <= hi, yj <= 100" ], "public_tests": 2, "hints": [ "The heights of the rectangles and the y-coordinates of the points are only at most 100, so for each point, we can iterate over the possible heights of the rectangles that contain a given point.", "For a given point and height, can we efficiently count how many rectangles with that height contain our point?", "Sort the rectangles at each height and use binary search." ] }, { "question_id": 2251, "task_id": "number-of-flowers-in-full-bloom", "drop": [], "similar": [ "meeting-rooms-ii", "minimum-interval-to-include-each-query" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "flowers", "people" ], "tests": { "total": 105, "kept": 100, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= starti <= endi <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= starti <= endi <= 10**(9)", "1 <= people[i] <= 10**(9)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= starti <= endi <= 10**(9)", "1 <= people[i] <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= starti <= endi <= 10**(9)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= starti <= endi <= 10**(9)", "1 <= people[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Notice that for any given time t, the number of flowers blooming at time t is equal to the number of flowers that have started blooming minus the number of flowers that have already stopped blooming.", "We can obtain these values efficiently using binary search.", "We can store the starting times in sorted order, which then allows us to binary search to find how many flowers have started blooming for a given time t.", "We do the same for the ending times to find how many flowers have stopped blooming at time t." ] }, { "question_id": 2255, "task_id": "count-prefixes-of-a-given-string", "drop": [], "similar": [ "check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence", "check-if-string-is-a-prefix-of-array", "counting-words-with-a-given-prefix" ], "flags": [], "comparison": "exact", "parameter_names": [ "words", "s" ], "tests": { "total": 146, "kept": 131, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= words[i].length, s.length <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= words[i].length, s.length <= 10" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= words[i].length, s.length <= 10" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= words[i].length, s.length <= 10" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= words[i].length, s.length <= 10" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= words[i].length, s.length <= 10" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= words[i].length, s.length <= 10" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= words[i].length, s.length <= 10" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= words[i].length, s.length <= 10" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= words[i].length, s.length <= 10" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= words[i].length, s.length <= 10" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= words[i].length, s.length <= 10" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= words[i].length, s.length <= 10" ] }, { "line": 135, "end_line": 135, "violates": [ "words[i] and s consist of lowercase English letters only." ] }, { "line": 140, "end_line": 140, "violates": [ "1 <= words[i].length, s.length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each string in words, check if it is a prefix of s. If true, increment the answer by 1." ] }, { "question_id": 2256, "task_id": "minimum-average-difference", "drop": [], "similar": [ "split-array-with-same-average", "number-of-ways-to-split-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 94, "kept": 90, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How can we use precalculation to efficiently calculate the average difference at an index?", "Create a prefix and/or suffix sum array." ] }, { "question_id": 2257, "task_id": "count-unguarded-cells-in-the-grid", "drop": [], "similar": [ "bomb-enemy", "available-captures-for-rook" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n", "guards", "walls" ], "tests": { "total": 83, "kept": 83, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= rowi, rowj < m", "0 <= coli, colj < n", "All the positions in guards and walls are unique." ], "public_tests": 2, "hints": [ "Create a 2D array to represent the grid. Can you mark the tiles that can be seen by a guard?", "Iterate over the guards, and for each of the 4 directions, advance the current tile and mark the tile. When should you stop advancing?" ] }, { "question_id": 2258, "task_id": "escape-the-spreading-fire", "drop": [], "similar": [ "rotting-oranges", "last-day-where-you-can-still-cross", "minimum-weighted-subgraph-with-the-required-paths", "maximum-number-of-points-from-grid-queries" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 85, "kept": 85, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For some tile (x, y), how can we determine when, if ever, the fire will reach it?", "We can use multi-source BFS to find the earliest time the fire will reach each cell.", "Then, starting with a given t minutes of staying in the initial position, we can check if there is a safe path to the safehouse using the obtained information about the fire.", "We can use binary search to efficiently find the maximum t that allows us to reach the safehouse." ] }, { "question_id": 2259, "task_id": "remove-digit-from-number-to-maximize-result", "drop": [], "similar": [ "remove-k-digits", "remove-vowels-from-a-string", "second-largest-digit-in-a-string", "minimum-operations-to-make-a-special-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "number", "digit" ], "tests": { "total": 126, "kept": 96, "dropped": { "constraint_violation": 30 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 11, "end_line": 11, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 19, "end_line": 19, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 31, "end_line": 31, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 35, "end_line": 35, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 36, "end_line": 36, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 39, "end_line": 39, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 41, "end_line": 41, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 43, "end_line": 43, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 45, "end_line": 45, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 47, "end_line": 47, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 48, "end_line": 48, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 49, "end_line": 49, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 52, "end_line": 52, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 54, "end_line": 54, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 57, "end_line": 57, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 58, "end_line": 58, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 66, "end_line": 66, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 73, "end_line": 73, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 74, "end_line": 74, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 80, "end_line": 80, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 81, "end_line": 81, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 85, "end_line": 85, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 87, "end_line": 87, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 89, "end_line": 89, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 90, "end_line": 90, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 91, "end_line": 91, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 120, "end_line": 120, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 123, "end_line": 123, "violates": [ "number consists of digits from '1' to '9'." ] }, { "line": 125, "end_line": 125, "violates": [ "number consists of digits from '1' to '9'." ] } ], "unchecked_constraints": [ "digit is a digit from '1' to '9'.", "digit occurs at least once in number." ], "public_tests": 3, "hints": [ "The maximum length of number is really small.", "Iterate through the digits of number and every time we see digit, try removing it.", "To remove a character at index i, concatenate the substring from index 0 to i - 1 and the substring from index i + 1 to number.length - 1." ] }, { "question_id": 2260, "task_id": "minimum-consecutive-cards-to-pick-up", "drop": [], "similar": [ "longest-substring-without-repeating-characters" ], "flags": [], "comparison": "exact", "parameter_names": [ "cards" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate through the cards and store the location of the last occurrence of each number.", "What data structure could you use to get the last occurrence of a number in O(1) or O(log n)?" ] }, { "question_id": 2261, "task_id": "k-divisible-elements-subarrays", "drop": [], "similar": [ "subarrays-with-k-different-integers", "count-number-of-nice-subarrays", "subarray-with-elements-greater-than-varying-threshold" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k", "p" ], "tests": { "total": 135, "kept": 117, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= nums[i], p <= 200" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= k <= nums.length" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= k <= nums.length" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= k <= nums.length" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i], p <= 200" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i], p <= 200" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= k <= nums.length" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i], p <= 200" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i], p <= 200" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i], p <= 200" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i], p <= 200" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i], p <= 200" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i], p <= 200" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= k <= nums.length" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= nums[i], p <= 200" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= nums[i], p <= 200" ] }, { "line": 129, "end_line": 129, "violates": [ "1 <= nums[i], p <= 200" ] }, { "line": 135, "end_line": 135, "violates": [ "1 <= nums[i], p <= 200" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Enumerate all subarrays and find the ones that satisfy all the conditions.", "Use any suitable method to hash the subarrays to avoid duplicates." ] }, { "question_id": 2262, "task_id": "total-appeal-of-a-string", "drop": [], "similar": [ "count-unique-characters-of-all-substrings-of-a-given-string", "count-vowel-substrings-of-a-string", "vowels-of-all-substrings", "find-the-median-of-the-uniqueness-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 69, "kept": 69, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider the set of substrings that end at a certain index i. Then, consider a specific alphabetic character. How do you count the number of substrings ending at index i that contain that character?", "The number of substrings that contain the alphabetic character is equivalent to 1 plus the index of the last occurrence of the character before index i + 1.", "The total appeal of all substrings ending at index i is the total sum of the number of substrings that contain each alphabetic character.", "To find the total appeal of all substrings, we simply sum up the total appeal for each index." ] }, { "question_id": 2263, "task_id": "make-array-non-decreasing-or-non-increasing", "drop": [ "premium" ] }, { "question_id": 2264, "task_id": "largest-3-same-digit-number-in-string", "drop": [], "similar": [ "largest-odd-number-in-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 133, "kept": 133, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "We can sequentially check if \u201c999\u201d, \u201c888\u201d, \u201c777\u201d, \u2026 , \u201c000\u201d exists in num in that order. The first to be found is the maximum good integer.", "If we cannot find any of the above integers, we return an empty string \u201c\u201d." ] }, { "question_id": 2265, "task_id": "count-nodes-equal-to-average-of-subtree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "maximum-average-subtree", "insufficient-nodes-in-root-to-leaf-paths", "count-nodes-equal-to-sum-of-descendants" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 76, "kept": 0, "dropped": { "unreadable": 76 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 1000].", "0 <= Node.val <= 1000" ] }, { "question_id": 2266, "task_id": "count-number-of-texts", "drop": [], "similar": [ "letter-combinations-of-a-phone-number", "decode-ways" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "pressedKeys" ], "tests": { "total": 38, "kept": 37, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "pressedKeys only consists of digits from '2' - '9'." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For a substring consisting of the same digit, how can we count the number of texts it could have originally represented?", "How can dynamic programming help us calculate the required answer?" ] }, { "question_id": 2267, "task_id": "check-if-there-is-a-valid-parentheses-string-path", "drop": [], "similar": [ "check-if-there-is-a-valid-path-in-a-grid", "check-if-a-parentheses-string-can-be-valid" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 54, "kept": 39, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "n == grid[i].length" ] }, { "line": 16, "end_line": 16, "violates": [ "n == grid[i].length" ] }, { "line": 19, "end_line": 19, "violates": [ "n == grid[i].length" ] }, { "line": 25, "end_line": 25, "violates": [ "n == grid[i].length" ] }, { "line": 27, "end_line": 27, "violates": [ "n == grid[i].length" ] }, { "line": 28, "end_line": 28, "violates": [ "n == grid[i].length" ] }, { "line": 31, "end_line": 31, "violates": [ "n == grid[i].length" ] }, { "line": 33, "end_line": 33, "violates": [ "n == grid[i].length" ] }, { "line": 35, "end_line": 35, "violates": [ "n == grid[i].length" ] }, { "line": 36, "end_line": 36, "violates": [ "n == grid[i].length" ] }, { "line": 37, "end_line": 37, "violates": [ "n == grid[i].length" ] }, { "line": 39, "end_line": 39, "violates": [ "n == grid[i].length" ] }, { "line": 41, "end_line": 41, "violates": [ "n == grid[i].length" ] }, { "line": 43, "end_line": 43, "violates": [ "n == grid[i].length" ] }, { "line": 48, "end_line": 48, "violates": [ "n == grid[i].length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What observations can you make about the number of open brackets and close brackets for any prefix of a valid bracket sequence?", "The number of open brackets must always be greater than or equal to the number of close brackets.", "Could you use dynamic programming?" ] }, { "question_id": 2268, "task_id": "minimum-number-of-keypresses", "drop": [ "premium" ] }, { "question_id": 2269, "task_id": "find-the-k-beauty-of-a-number", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "num", "k" ], "tests": { "total": 90, "kept": 46, "dropped": { "constraint_violation": 44 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= num <= 10**(9)" ] } ], "unchecked_constraints": [ "1 <= k <= num.length (taking num as a string)" ], "public_tests": 2, "hints": [ "We should check all the substrings of num with a length of k and see if it is a divisor of num.", "We can more easily obtain the substrings by converting num into a string and converting back to an integer to check for divisibility." ] }, { "question_id": 2270, "task_id": "number-of-ways-to-split-array", "drop": [], "similar": [ "split-array-largest-sum", "find-pivot-index", "ways-to-split-array-into-three-subarrays", "find-the-middle-index-in-array", "partition-array-into-two-arrays-to-minimize-sum-difference", "minimum-average-difference" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 105, "kept": 101, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "-10**(5) <= nums[i] <= 10**(5)" ] }, { "line": 31, "end_line": 31, "violates": [ "-10**(5) <= nums[i] <= 10**(5)", "-10**(5) <= nums[i] <= 10**(5)" ] }, { "line": 71, "end_line": 71, "violates": [ "-10**(5) <= nums[i] <= 10**(5)", "-10**(5) <= nums[i] <= 10**(5)" ] }, { "line": 93, "end_line": 93, "violates": [ "-10**(5) <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For any index i, how can we find the sum of the first (i+1) elements from the sum of the first i elements?", "If the total sum of the array is known, how can we check if the sum of the first (i+1) elements greater than or equal to the remaining elements?" ] }, { "question_id": 2271, "task_id": "maximum-white-tiles-covered-by-a-carpet", "drop": [], "similar": [ "maximum-number-of-vowels-in-a-substring-of-given-length" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "tiles", "carpetLen" ], "tests": { "total": 111, "kept": 111, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The tiles are non-overlapping." ], "public_tests": 2, "hints": [ "Think about the potential placements of the carpet in an optimal solution.", "Can we use Prefix Sum and Binary Search to determine how many tiles are covered for a given placement?" ] }, { "question_id": 2272, "task_id": "substring-with-largest-variance", "drop": [], "similar": [ "maximum-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 25, "kept": 24, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "s consists of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Think about how to solve the problem if the string had only two distinct characters.", "If we replace all occurrences of the first character by +1 and those of the second character by -1, can we efficiently calculate the largest possible variance of a string with only two distinct characters?", "Now, try finding the optimal answer by taking all possible pairs of characters into consideration." ] }, { "question_id": 2273, "task_id": "find-resultant-array-after-removing-anagrams", "drop": [], "similar": [ "group-anagrams", "valid-anagram" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 86, "kept": 84, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 57, "end_line": 57, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 78, "end_line": 78, "violates": [ "words[i] consists of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Instead of removing each repeating anagram, try to find all the strings in words which will not be present in the final answer.", "For every index i, find the largest index j < i such that words[j] will be present in the final answer.", "Check if words[i] and words[j] are anagrams. If they are, then it can be confirmed that words[i] will not be present in the final answer." ] }, { "question_id": 2274, "task_id": "maximum-consecutive-floors-without-special-floors", "drop": [], "similar": [ "longest-consecutive-sequence", "maximum-gap", "widest-vertical-area-between-two-points-containing-no-points" ], "flags": [], "comparison": "exact", "parameter_names": [ "bottom", "top", "special" ], "tests": { "total": 93, "kept": 92, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 60, "end_line": 60, "violates": [ "1 <= bottom <= special[i] <= top <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Say we have a pair of special floors (x, y) with no other special floors in between. There are x - y - 1 consecutive floors in between them without a special floor.", "Say there are n special floors. After sorting special, we have answer = max(answer, special[i] \u2013 special[i \u2013 1] \u2013 1) for all 0 < i < n.", "However, there are two special cases left to consider: the floors before special[0] and after special[n-1].", "To consider these cases, we have answer = max(answer, special[0] \u2013 bottom, top \u2013 special[n-1])." ] }, { "question_id": 2275, "task_id": "largest-combination-with-bitwise-and-greater-than-zero", "drop": [], "similar": [ "count-number-of-maximum-bitwise-or-subsets" ], "flags": [], "comparison": "exact", "parameter_names": [ "candidates" ], "tests": { "total": 92, "kept": 63, "dropped": { "constraint_violation": 29 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= candidates[i] <= 10**(7)", "1 <= candidates[i] <= 10**(7)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= candidates[i] <= 10**(7)", "1 <= candidates[i] <= 10**(7)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= candidates[i] <= 10**(7)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= candidates[i] <= 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For the bitwise AND to be greater than zero, at least one bit should be 1 for every number in the combination.", "The candidates are 24 bits long, so for every bit position, we can calculate the size of the largest combination such that the bitwise AND will have a 1 at that bit position." ] }, { "question_id": 2277, "task_id": "closest-node-to-path-in-tree", "drop": [ "premium" ] }, { "question_id": 2278, "task_id": "percentage-of-letter-in-string", "drop": [], "similar": [ "sort-characters-by-frequency" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "letter" ], "tests": { "total": 107, "kept": 105, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 76, "end_line": 76, "violates": [ "s consists of lowercase English letters." ] }, { "line": 90, "end_line": 90, "violates": [ "s consists of lowercase English letters." ] } ], "unchecked_constraints": [ "letter is a lowercase English letter." ], "public_tests": 2, "hints": [ "Can we count the number of occurrences of letter in s?", "Recall that the percentage is calculated as (occurrences / total) * 100." ] }, { "question_id": 2279, "task_id": "maximum-bags-with-full-capacity-of-rocks", "drop": [], "similar": [ "capacity-to-ship-packages-within-d-days", "maximum-units-on-a-truck" ], "flags": [], "comparison": "exact", "parameter_names": [ "capacity", "rocks", "additionalRocks" ], "tests": { "total": 103, "kept": 90, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "0 <= rocks[i] <= capacity[i]" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= additionalRocks <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= additionalRocks <= 10**(9)", "1 <= additionalRocks <= 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= rocks[i] <= capacity[i]" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= rocks[i] <= capacity[i]" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= rocks[i] <= capacity[i]" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= additionalRocks <= 10**(9)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= additionalRocks <= 10**(9)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= additionalRocks <= 10**(9)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= additionalRocks <= 10**(9)", "1 <= additionalRocks <= 10**(9)" ] }, { "line": 81, "end_line": 81, "violates": [ "0 <= rocks[i] <= capacity[i]" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= additionalRocks <= 10**(9)" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= rocks[i] <= capacity[i]" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Which bag should you fill completely first?", "Can you think of a greedy solution?" ] }, { "question_id": 2280, "task_id": "minimum-lines-to-represent-a-line-chart", "drop": [], "similar": [ "max-points-on-a-line", "minimum-number-of-lines-to-cover-points" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "stockPrices" ], "tests": { "total": 107, "kept": 100, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "1 <= dayi, pricei <= 10**(9)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= dayi, pricei <= 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= dayi, pricei <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= dayi, pricei <= 10**(9)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= dayi, pricei <= 10**(9)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= dayi, pricei <= 10**(9)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= dayi, pricei <= 10**(9)" ] } ], "unchecked_constraints": [ "All dayi are distinct." ], "public_tests": 2, "hints": [ "When will three adjacent points lie on the same line? How can we generalize this for all points?", "Will calculating the slope of lines connecting adjacent points help us find the answer?" ] }, { "question_id": 2281, "task_id": "sum-of-total-strength-of-wizards", "drop": [], "similar": [ "next-greater-element-i", "sum-of-subarray-minimums", "number-of-visible-people-in-a-queue", "sum-of-subarray-ranges" ], "flags": [], "comparison": "exact", "parameter_names": [ "strength" ], "tests": { "total": 104, "kept": 103, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 61, "end_line": 61, "violates": [ "1 <= strength[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider the contribution of each wizard to the answer.", "Can you efficiently calculate the total contribution to the answer for all subarrays that end at each index?", "Denote the total contribution of all subarrays ending at index i as solve[i]. Can you express solve[i] in terms of solve[m] for some m < i?" ] }, { "question_id": 2282, "task_id": "number-of-people-that-can-be-seen-in-a-grid", "drop": [ "premium" ] }, { "question_id": 2283, "task_id": "check-if-number-has-equal-digit-count-and-digit-value", "drop": [], "similar": [ "self-dividing-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 150, "kept": 137, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 34, "end_line": 34, "violates": [ "1 <= n <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= n <= 10" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= n <= 10" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= n <= 10" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= n <= 10" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= n <= 10" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= n <= 10" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= n <= 10" ] }, { "line": 128, "end_line": 128, "violates": [ "1 <= n <= 10" ] }, { "line": 139, "end_line": 139, "violates": [ "1 <= n <= 10" ] }, { "line": 143, "end_line": 143, "violates": [ "1 <= n <= 10" ] }, { "line": 144, "end_line": 144, "violates": [ "1 <= n <= 10" ] }, { "line": 147, "end_line": 147, "violates": [ "1 <= n <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Count the frequency of each digit in num." ] }, { "question_id": 2284, "task_id": "sender-with-largest-word-count", "drop": [], "similar": [ "top-k-frequent-elements", "top-k-frequent-words" ], "flags": [], "comparison": "exact", "parameter_names": [ "messages", "senders" ], "tests": { "total": 117, "kept": 116, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 55, "end_line": 55, "violates": [ "senders[i] consists of uppercase and lowercase English letters only." ] } ], "unchecked_constraints": [ "All the words in messages[i] are separated by a single space.", "messages[i] does not have leading or trailing spaces." ], "public_tests": 2, "hints": [ "The number of words in a message is equal to the number of spaces + 1.", "Use a hash map to count the total number of words from each sender." ] }, { "question_id": 2285, "task_id": "maximum-total-importance-of-roads", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "roads" ], "tests": { "total": 65, "kept": 65, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There are no duplicate roads." ], "public_tests": 2, "hints": [ "Consider what each city contributes to the total importance of all roads.", "Based on that, how can you sort the cities such that assigning them values in that order will yield the maximum total importance?" ] }, { "question_id": 2287, "task_id": "rearrange-characters-to-make-target-string", "drop": [], "similar": [ "find-words-that-can-be-formed-by-characters", "maximum-number-of-occurrences-of-a-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "target" ], "tests": { "total": 129, "kept": 116, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= s.length <= 100" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= target.length <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= target.length <= 10" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= target.length <= 10" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= target.length <= 10" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= target.length <= 10" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= target.length <= 10" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= s.length <= 100" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= target.length <= 10" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= target.length <= 10" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= target.length <= 10" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= target.length <= 10" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= target.length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Count the frequency of each character in s and target.", "Consider each letter one at a time. If there are x occurrences of a letter in s and y occurrences of the same letter in target, how many copies of this letter can we make?", "We can make floor(x / y) copies of the letter." ] }, { "question_id": 2288, "task_id": "apply-discount-to-prices", "drop": [], "similar": [ "multiply-strings", "apply-discount-every-n-orders" ], "flags": [], "comparison": "exact", "parameter_names": [ "sentence", "discount" ], "tests": { "total": 108, "kept": 98, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "sentence consists of lowercase English letters, digits, ' ', and '$'." ] }, { "line": 17, "end_line": 17, "violates": [ "sentence consists of lowercase English letters, digits, ' ', and '$'." ] }, { "line": 22, "end_line": 22, "violates": [ "sentence consists of lowercase English letters, digits, ' ', and '$'." ] }, { "line": 23, "end_line": 23, "violates": [ "sentence consists of lowercase English letters, digits, ' ', and '$'." ] }, { "line": 32, "end_line": 32, "violates": [ "sentence consists of lowercase English letters, digits, ' ', and '$'." ] }, { "line": 65, "end_line": 65, "violates": [ "sentence consists of lowercase English letters, digits, ' ', and '$'." ] }, { "line": 90, "end_line": 90, "violates": [ "sentence consists of lowercase English letters, digits, ' ', and '$'." ] }, { "line": 93, "end_line": 93, "violates": [ "sentence consists of lowercase English letters, digits, ' ', and '$'." ] }, { "line": 98, "end_line": 98, "violates": [ "sentence consists of lowercase English letters, digits, ' ', and '$'." ] }, { "line": 105, "end_line": 105, "violates": [ "sentence consists of lowercase English letters, digits, ' ', and '$'." ] } ], "unchecked_constraints": [ "sentence does not have leading or trailing spaces.", "All words in sentence are separated by a single space.", "All prices will be positive numbers without leading zeros.", "All prices will have at most 10 digits." ], "public_tests": 2, "hints": [ "Extract each word from the sentence and check if it represents a price.", "For each price, apply the given discount to it and update it." ] }, { "question_id": 2289, "task_id": "steps-to-make-array-non-decreasing", "drop": [], "similar": [ "remove-one-element-to-make-the-array-strictly-increasing" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 129, "kept": 125, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Notice that an element will be removed if and only if there exists a strictly greater element to the left of it in the array.", "For each element, we need to find the number of rounds it will take for it to be removed. The answer is the maximum number of rounds for all elements. Build an array dp to hold this information where the answer is the maximum value of dp.", "Use a stack of the indices. While processing element nums[i], remove from the stack all the indices of elements that are smaller than nums[i]. dp[i] should be set to the maximum of dp[i] + 1 and dp[removed index]." ] }, { "question_id": 2290, "task_id": "minimum-obstacle-removal-to-reach-corner", "drop": [], "similar": [ "shortest-path-in-a-grid-with-obstacles-elimination" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 59, "kept": 57, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "grid[0][0] == grid[m - 1][n - 1] == 0" ] }, { "line": 22, "end_line": 22, "violates": [ "grid[0][0] == grid[m - 1][n - 1] == 0" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Model the grid as a graph where cells are nodes and edges are between adjacent cells. Edges to cells with obstacles have a cost of 1 and all other edges have a cost of 0.", "Could you use 0-1 Breadth-First Search or Dijkstra\u2019s algorithm?" ] }, { "question_id": 2291, "task_id": "maximum-profit-from-trading-stocks", "drop": [ "premium" ] }, { "question_id": 2293, "task_id": "min-max-game", "drop": [], "similar": [ "elimination-game", "find-triangular-sum-of-an-array" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 93, "kept": 89, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [ "nums.length is a power of 2." ], "public_tests": 2, "hints": [ "Simply simulate the algorithm.", "Note that the size of the array decreases exponentially, so the process will terminate after just O(log n) steps." ] }, { "question_id": 2294, "task_id": "partition-array-such-that-maximum-difference-is-k", "drop": [], "similar": [ "longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit", "maximum-beauty-of-an-array-after-applying-operation" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 112, "kept": 110, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 40, "end_line": 40, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 106, "end_line": 106, "violates": [ "0 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Which values in each subsequence matter? The only values that matter are the maximum and minimum values.", "Let the maximum and minimum values of a subsequence be Max and Min. It is optimal to place all values in between Max and Min in the original array in the same subsequence as Max and Min.", "Sort the array." ] }, { "question_id": 2295, "task_id": "replace-elements-in-an-array", "drop": [], "similar": [ "find-all-numbers-disappeared-in-an-array", "maximum-number-of-integers-to-choose-from-a-range-i", "maximum-number-of-integers-to-choose-from-a-range-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "operations" ], "tests": { "total": 76, "kept": 75, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i], operations[i][0], operations[i][1] <= 10**(6)" ] } ], "unchecked_constraints": [ "operations[i][0] will exist in nums when applying the i**(th) operation.", "operations[i][1] will not exist in nums when applying the i**(th) operation." ], "public_tests": 2, "hints": [ "Can you think of a data structure that will allow you to store the position of each number?", "Use that data structure to instantly replace a number with its new value." ] }, { "question_id": 2297, "task_id": "jump-game-viii", "drop": [ "premium" ] }, { "question_id": 2299, "task_id": "strong-password-checker-ii", "drop": [ "too_few_tests" ], "similar": [ "strong-password-checker", "validate-ip-address" ], "flags": [], "comparison": "exact", "parameter_names": [ "password" ], "tests": { "total": 3, "kept": 3, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "password consists of letters, digits, and special characters: \"!@#$%^&*()-+\"." ] }, { "question_id": 2300, "task_id": "successful-pairs-of-spells-and-potions", "drop": [], "similar": [ "most-profit-assigning-work", "longest-subsequence-with-limited-sum", "maximum-matching-of-players-with-trainers" ], "flags": [], "comparison": "exact", "parameter_names": [ "spells", "potions", "success" ], "tests": { "total": 96, "kept": 84, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "1 <= spells[i], potions[i] <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= success <= 10**(10)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= spells[i], potions[i] <= 10**(5)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= spells[i], potions[i] <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= spells[i], potions[i] <= 10**(5)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= spells[i], potions[i] <= 10**(5)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= spells[i], potions[i] <= 10**(5)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= spells[i], potions[i] <= 10**(5)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= spells[i], potions[i] <= 10**(5)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= spells[i], potions[i] <= 10**(5)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= spells[i], potions[i] <= 10**(5)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= spells[i], potions[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Notice that if a spell and potion pair is successful, then the spell and all stronger potions will be successful too.", "Thus, for each spell, we need to find the potion with the least strength that will form a successful pair.", "We can efficiently do this by sorting the potions based on strength and using binary search." ] }, { "question_id": 2301, "task_id": "match-substring-after-replacement", "drop": [], "similar": [ "design-add-and-search-words-data-structure", "number-of-subarrays-that-match-a-pattern-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "sub", "mappings" ], "tests": { "total": 79, "kept": 73, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "oldi != newi" ] }, { "line": 27, "end_line": 27, "violates": [ "s and sub consist of uppercase and lowercase English letters and digits." ] }, { "line": 54, "end_line": 54, "violates": [ "oldi != newi" ] }, { "line": 67, "end_line": 67, "violates": [ "s and sub consist of uppercase and lowercase English letters and digits." ] }, { "line": 78, "end_line": 78, "violates": [ "oldi != newi" ] }, { "line": 79, "end_line": 79, "violates": [ "oldi != newi" ] } ], "unchecked_constraints": [ "oldi and newi are either uppercase or lowercase English letters or digits." ], "public_tests": 3, "hints": [ "Enumerate all substrings of s with the same length as sub, and compare each substring to sub for equality.", "How can you quickly tell if a character of s can result from replacing the corresponding character in sub?" ] }, { "question_id": 2302, "task_id": "count-subarrays-with-score-less-than-k", "drop": [], "similar": [ "maximum-subarray", "subarray-product-less-than-k", "binary-subarrays-with-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 79, "kept": 78, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If we add an element to a list of elements, how will the score change?", "How can we use this to determine the number of subarrays with score less than k in a given range?", "How can we use \u201cTwo Pointers\u201d to generalize the solution, and thus count all possible subarrays?" ] }, { "question_id": 2303, "task_id": "calculate-amount-paid-in-taxes", "drop": [], "similar": [], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "brackets", "income" ], "tests": { "total": 122, "kept": 117, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "1 <= upperi <= 1000", "0 <= income <= 1000" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= percenti <= 100" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= upperi <= 1000", "0 <= income <= 1000" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= upperi <= 1000", "0 <= income <= 1000" ] }, { "line": 105, "end_line": 105, "violates": [ "0 <= percenti <= 100" ] } ], "unchecked_constraints": [ "All the values of upperi are unique.", "The upper bound of the last tax bracket is greater than or equal to income.", "upperi is sorted in ascending order." ], "public_tests": 3, "hints": [ "As you iterate through the tax brackets, keep track of the previous tax bracket\u2019s upper bound in a variable called prev. If there is no previous tax bracket, use 0 instead.", "The amount of money in the ith tax bracket is min(income, upperi) - prev." ] }, { "question_id": 2304, "task_id": "minimum-path-cost-in-a-grid", "drop": [], "similar": [ "unique-paths", "unique-paths-ii", "minimum-path-sum", "dungeon-game", "paint-house" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid", "moveCost" ], "tests": { "total": 28, "kept": 13, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "moveCost.length == m * n" ] }, { "line": 8, "end_line": 8, "violates": [ "moveCost.length == m * n" ] }, { "line": 11, "end_line": 11, "violates": [ "moveCost.length == m * n" ] }, { "line": 12, "end_line": 12, "violates": [ "moveCost.length == m * n" ] }, { "line": 13, "end_line": 13, "violates": [ "moveCost.length == m * n" ] }, { "line": 14, "end_line": 14, "violates": [ "moveCost.length == m * n" ] }, { "line": 16, "end_line": 16, "violates": [ "moveCost.length == m * n" ] }, { "line": 19, "end_line": 19, "violates": [ "moveCost.length == m * n" ] }, { "line": 20, "end_line": 20, "violates": [ "moveCost.length == m * n" ] }, { "line": 21, "end_line": 21, "violates": [ "moveCost.length == m * n", "1 <= moveCost[i][j] <= 100" ] }, { "line": 23, "end_line": 23, "violates": [ "moveCost.length == m * n" ] }, { "line": 24, "end_line": 24, "violates": [ "moveCost.length == m * n" ] }, { "line": 25, "end_line": 25, "violates": [ "moveCost.length == m * n" ] }, { "line": 27, "end_line": 27, "violates": [ "moveCost.length == m * n" ] }, { "line": 29, "end_line": 29, "violates": [ "moveCost.length == m * n" ] } ], "unchecked_constraints": [ "grid consists of distinct integers from 0 to m * n - 1." ], "public_tests": 2, "hints": [ "What is the optimal cost to get to each of the cells in the second row? What about the third row?", "Use dynamic programming to compute the optimal cost to get to each cell." ] }, { "question_id": 2305, "task_id": "fair-distribution-of-cookies", "drop": [], "similar": [ "split-array-largest-sum", "split-array-with-equal-sum", "partition-to-k-equal-sum-subsets", "minimum-xor-sum-of-two-arrays", "the-number-of-good-subsets", "minimum-number-of-work-sessions-to-finish-the-tasks", "partition-array-into-two-arrays-to-minimize-sum-difference", "maximum-rows-covered-by-columns", "distribute-money-to-maximum-children" ], "flags": [], "comparison": "exact", "parameter_names": [ "cookies", "k" ], "tests": { "total": 104, "kept": 97, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "1 <= cookies[i] <= 10**(5)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= cookies[i] <= 10**(5)" ] }, { "line": 41, "end_line": 41, "violates": [ "2 <= cookies.length <= 8" ] }, { "line": 53, "end_line": 53, "violates": [ "2 <= cookies.length <= 8" ] }, { "line": 65, "end_line": 65, "violates": [ "2 <= cookies.length <= 8" ] }, { "line": 82, "end_line": 82, "violates": [ "2 <= cookies.length <= 8" ] }, { "line": 99, "end_line": 99, "violates": [ "2 <= cookies.length <= 8" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We have to give each bag to one of the children. How can we enumerate all of the possibilities?", "Use recursion and keep track of the current number of cookies each child has. Once all the bags have been distributed, find the child with the most cookies." ] }, { "question_id": 2306, "task_id": "naming-a-company", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "ideas" ], "tests": { "total": 45, "kept": 24, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "All the strings in ideas are unique." ] }, { "line": 19, "end_line": 19, "violates": [ "All the strings in ideas are unique." ] }, { "line": 20, "end_line": 20, "violates": [ "All the strings in ideas are unique." ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= ideas[i].length <= 10", "All the strings in ideas are unique." ] }, { "line": 22, "end_line": 22, "violates": [ "All the strings in ideas are unique." ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= ideas[i].length <= 10" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= ideas[i].length <= 10" ] }, { "line": 26, "end_line": 26, "violates": [ "All the strings in ideas are unique." ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= ideas[i].length <= 10", "ideas[i] consists of lowercase English letters.", "All the strings in ideas are unique." ] }, { "line": 29, "end_line": 29, "violates": [ "All the strings in ideas are unique." ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= ideas[i].length <= 10" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= ideas[i].length <= 10", "All the strings in ideas are unique." ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= ideas[i].length <= 10", "ideas[i] consists of lowercase English letters.", "All the strings in ideas are unique." ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= ideas[i].length <= 10" ] }, { "line": 36, "end_line": 36, "violates": [ "ideas[i] consists of lowercase English letters." ] }, { "line": 37, "end_line": 37, "violates": [ "All the strings in ideas are unique." ] }, { "line": 38, "end_line": 38, "violates": [ "All the strings in ideas are unique." ] }, { "line": 39, "end_line": 39, "violates": [ "All the strings in ideas are unique." ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= ideas[i].length <= 10" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= ideas[i].length <= 10", "All the strings in ideas are unique." ] }, { "line": 45, "end_line": 45, "violates": [ "All the strings in ideas are unique." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How can we divide the ideas into groups to make it easier to find valid pairs?", "Group ideas that share the same suffix (all characters except the first) together and notice that a pair of ideas from the same group is invalid. What about pairs of ideas from different groups?", "The first letter of the idea in the first group must not be the first letter of an idea in the second group and vice versa.", "We can efficiently count the valid pairings for an idea if we already know how many ideas starting with a letter x are within a group that does not contain any ideas with starting letter y for all letters x and y." ] }, { "question_id": 2307, "task_id": "check-for-contradictions-in-equations", "drop": [ "premium" ] }, { "question_id": 2309, "task_id": "greatest-english-letter-in-upper-and-lower-case", "drop": [], "similar": [ "count-the-number-of-special-characters-ii", "count-the-number-of-special-characters-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 117, "kept": 115, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= s.length <= 1000" ] }, { "line": 79, "end_line": 79, "violates": [ "s consists of lowercase and uppercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Consider iterating through the string and storing each unique character that occurs in a set.", "From Z to A, check whether both the uppercase and lowercase version occur in the set." ] }, { "question_id": 2310, "task_id": "sum-of-numbers-with-units-digit-k", "drop": [], "similar": [ "digit-count-in-range", "count-integers-with-even-digit-sum", "sum-of-number-and-its-reverse" ], "flags": [], "comparison": "exact", "parameter_names": [ "num", "k" ], "tests": { "total": 114, "kept": 109, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 45, "end_line": 45, "violates": [ "0 <= num <= 3000" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= num <= 3000" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= num <= 3000" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= num <= 3000" ] }, { "line": 102, "end_line": 102, "violates": [ "0 <= num <= 3000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try solving this recursively.", "Create a method that takes an integer x as a parameter. This method returns the minimum possible size of a set where each number has units digit k and the sum of the numbers in the set is x." ] }, { "question_id": 2311, "task_id": "longest-binary-subsequence-less-than-or-equal-to-k", "drop": [], "similar": [ "maximum-binary-string-after-change" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 101, "kept": 92, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Choosing a subsequence from the string is equivalent to deleting all the other digits.", "If you were to remove a digit, which one should you remove to reduce the value of the string?" ] }, { "question_id": 2312, "task_id": "selling-pieces-of-wood", "drop": [], "similar": [ "tiling-a-rectangle-with-the-fewest-squares", "number-of-ways-of-cutting-a-pizza" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n", "prices" ], "tests": { "total": 88, "kept": 84, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "1 <= pricei <= 10**(6)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= wi <= n" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= wi <= n" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= wi <= n" ] } ], "unchecked_constraints": [ "All the shapes of wood (hi, wi) are pairwise distinct." ], "public_tests": 2, "hints": [ "Note down the different actions that can be done on a piece of wood with dimensions m x n. What do you notice?", "If possible, we could sell the m x n piece. We could also cut the piece vertically creating two pieces of size m x n1 and m x n2 where n1 + n2 = n, or horizontally creating two pieces of size m1 x n and m2 x n where m1 + m2 = m.", "Notice that cutting a piece breaks the problem down into smaller subproblems, and selling the piece when available is also a case that terminates the process. Thus, we can use DP to efficiently solve this." ] }, { "question_id": 2315, "task_id": "count-asterisks", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 106, "kept": 104, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "s consists of lowercase English letters, vertical bars '|', and asterisks '*'." ] }, { "line": 69, "end_line": 69, "violates": [ "s consists of lowercase English letters, vertical bars '|', and asterisks '*'." ] } ], "unchecked_constraints": [ "s contains an even number of vertical bars '|'." ], "public_tests": 3, "hints": [ "Iterate through each character, while maintaining whether we are currently between a pair of \u2018|\u2019 or not.", "If we are not in between a pair of \u2018|\u2019 and there is a \u2018*\u2019, increment the answer by 1." ] }, { "question_id": 2316, "task_id": "count-unreachable-pairs-of-nodes-in-an-undirected-graph", "drop": [], "similar": [ "number-of-islands" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 55, "kept": 53, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 44, "end_line": 44, "violates": [ "ai != bi" ] }, { "line": 56, "end_line": 56, "violates": [ "ai != bi" ] } ], "unchecked_constraints": [ "There are no repeated edges." ], "public_tests": 2, "hints": [ "Find the connected components of the graph. To find connected components, you can use Union Find (Disjoint Sets), BFS, or DFS.", "For a node u, the number of nodes that are unreachable from u is the number of nodes that are not in the same connected component as u.", "The number of unreachable nodes from node u will be the same for the number of nodes that are unreachable from node v if nodes u and v belong to the same connected component." ] }, { "question_id": 2317, "task_id": "maximum-xor-after-operations", "drop": [], "similar": [ "maximum-xor-of-two-numbers-in-an-array", "maximum-xor-product", "minimize-or-of-remaining-elements-using-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 117, "kept": 83, "dropped": { "constraint_violation": 34 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 55, "end_line": 55, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 81, "end_line": 81, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 89, "end_line": 89, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 98, "end_line": 98, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 104, "end_line": 104, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 107, "end_line": 107, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 109, "end_line": 109, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 110, "end_line": 110, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 111, "end_line": 111, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 113, "end_line": 113, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 114, "end_line": 114, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 117, "end_line": 117, "violates": [ "0 <= nums[i] <= 10**(8)" ] }, { "line": 118, "end_line": 118, "violates": [ "0 <= nums[i] <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider what it means to be able to choose any x for the operation and which integers could be obtained from a given nums[i].", "The given operation can unset any bit in nums[i].", "The nth bit of the XOR of all the elements is 1 if the nth bit is 1 for an odd number of elements. When can we ensure it is odd?", "Try to set every bit of the result to 1 if possible." ] }, { "question_id": 2318, "task_id": "number-of-distinct-roll-sequences", "drop": [], "similar": [ "dice-roll-simulation", "paint-house-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 21, "kept": 20, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= n <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can you think of a DP solution?", "Consider a state that remembers the last 1 or 2 rolls.", "Do you need to consider the last 3 rolls?" ] }, { "question_id": 2319, "task_id": "check-if-matrix-is-x-matrix", "drop": [], "similar": [ "matrix-diagonal-sum" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 70, "kept": 70, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Assuming a 0-indexed matrix, for a given cell on row i and column j, it is in a diagonal if and only if i == j or i == n - 1 - j.", "We can then iterate through the elements in the matrix to check if all the elements in the diagonals are non-zero and all other elements are zero." ] }, { "question_id": 2320, "task_id": "count-number-of-ways-to-place-houses", "drop": [], "similar": [ "climbing-stairs", "house-robber" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 33, "kept": 33, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try coming up with a DP solution for one side of the street.", "The DP for one side of the street will bear resemblance to the Fibonacci sequence.", "The number of different arrangements on both side of the street is the same." ] }, { "question_id": 2321, "task_id": "maximum-score-of-spliced-array", "drop": [], "similar": [ "maximum-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 87, "kept": 85, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 38, "end_line": 38, "violates": [ "n == nums1.length == nums2.length" ] }, { "line": 67, "end_line": 67, "violates": [ "n == nums1.length == nums2.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think on Dynamic Programming.", "First assume you will be taking the array a and choose some subarray from b", "Suppose the DP is DP(pos, state). pos is the current position you are in. state is one of {0,1,2}, where 0 means taking the array a, 1 means we are taking the subarray b, and 2 means we are again taking the array a. We need to handle the transitions carefully." ] }, { "question_id": 2322, "task_id": "minimum-score-after-removals-on-a-tree", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "nums", "edges" ], "tests": { "total": 55, "kept": 54, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= nums[i] <= 10**(8)" ] } ], "unchecked_constraints": [ "edges represents a valid tree." ], "public_tests": 2, "hints": [ "Consider iterating over the first edge to remove, and then doing some precalculations on the 2 resulting connected components.", "Will calculating the XOR of each subtree help?" ] }, { "question_id": 2323, "task_id": "find-minimum-time-to-finish-all-jobs-ii", "drop": [ "premium" ] }, { "question_id": 2325, "task_id": "decode-the-message", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "key", "message" ], "tests": { "total": 204, "kept": 201, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 78, "end_line": 78, "violates": [ "26 <= key.length <= 2000" ] }, { "line": 121, "end_line": 121, "violates": [ "26 <= key.length <= 2000" ] }, { "line": 125, "end_line": 125, "violates": [ "26 <= key.length <= 2000" ] } ], "unchecked_constraints": [ "key contains every letter in the English alphabet ('a' to 'z') at least once." ], "public_tests": 2, "hints": [ "Iterate through the characters in the key to construct a mapping to the English alphabet.", "Make sure to check that the current character is not already in the mapping (only the first appearance is considered).", "Map the characters in the message according to the constructed mapping." ] }, { "question_id": 2326, "task_id": "spiral-matrix-iv", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "spiral-matrix", "spiral-matrix-ii", "spiral-matrix-iii" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n", "head" ], "tests": { "total": 100, "kept": 0, "dropped": { "unreadable": 100 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true }, { "line": 98, "end_line": 98, "unreadable": true }, { "line": 99, "end_line": 99, "unreadable": true }, { "line": 100, "end_line": 100, "unreadable": true }, { "line": 101, "end_line": 101, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the list is in the range [1, m * n].", "0 <= Node.val <= 1000" ] }, { "question_id": 2327, "task_id": "number-of-people-aware-of-a-secret", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "delay", "forget" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let dp[i][j] be the number of people who have known the secret for exactly j + 1 days, at day i.", "If j > 0, dp[i][j] = dp[i \u2013 1][j \u2013 1].", "dp[i][0] = sum(dp[i \u2013 1][j]) for j in [delay \u2013 1, forget \u2013 2]." ] }, { "question_id": 2328, "task_id": "number-of-increasing-paths-in-a-grid", "drop": [], "similar": [ "longest-increasing-path-in-a-matrix", "all-paths-from-source-to-target", "maximum-strictly-increasing-cells-in-a-matrix" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 88, "kept": 81, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How can you calculate the number of increasing paths that start from a cell (i, j)? Think about dynamic programming.", "Define f(i, j) as the number of increasing paths starting from cell (i, j). Try to find how f(i, j) is related to each of f(i, j+1), f(i, j-1), f(i+1, j) and f(i-1, j)." ] }, { "question_id": 2330, "task_id": "valid-palindrome-iv", "drop": [ "premium" ] }, { "question_id": 2331, "task_id": "evaluate-boolean-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "check-if-two-expression-trees-are-equivalent", "design-an-expression-tree-with-evaluate-function", "minimum-flips-in-binary-tree-to-get-result" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 80, "kept": 0, "dropped": { "unreadable": 80 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 1000].", "0 <= Node.val <= 3", "Every node has either 0 or 2 children.", "Leaf nodes have a value of 0 or 1.", "Non-leaf nodes have a value of 2 or 3." ] }, { "question_id": 2332, "task_id": "the-latest-time-to-catch-a-bus", "drop": [], "similar": [ "minimum-speed-to-arrive-on-time", "maximum-matching-of-players-with-trainers", "time-taken-to-cross-the-door", "time-to-cross-a-bridge", "rearranging-fruits" ], "flags": [], "comparison": "exact", "parameter_names": [ "buses", "passengers", "capacity" ], "tests": { "total": 93, "kept": 54, "dropped": { "constraint_violation": 39 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 5, "end_line": 5, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 7, "end_line": 7, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 11, "end_line": 11, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 15, "end_line": 15, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 21, "end_line": 21, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 29, "end_line": 29, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 33, "end_line": 33, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 38, "end_line": 38, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 40, "end_line": 40, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 48, "end_line": 48, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 49, "end_line": 49, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 51, "end_line": 51, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 53, "end_line": 53, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 54, "end_line": 54, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 56, "end_line": 56, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 68, "end_line": 68, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 72, "end_line": 72, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 79, "end_line": 79, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 81, "end_line": 81, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 82, "end_line": 82, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 83, "end_line": 83, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 89, "end_line": 89, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 91, "end_line": 91, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] }, { "line": 93, "end_line": 93, "violates": [ "2 <= buses[i], passengers[i] <= 10**(9)" ] } ], "unchecked_constraints": [ "Each element in buses is unique.", "Each element in passengers is unique." ], "public_tests": 2, "hints": [ "Sort the buses and passengers arrays.", "Use 2 pointers to traverse buses and passengers with a simulation of passengers getting on a particular bus." ] }, { "question_id": 2333, "task_id": "minimum-sum-of-squared-difference", "drop": [], "similar": [ "minimum-absolute-sum-difference", "partition-array-into-two-arrays-to-minimize-sum-difference" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "k1", "k2" ], "tests": { "total": 116, "kept": 116, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "There is no difference between the purpose of k1 and k2. Adding +1 to one element in nums1 is same as performing -1 to one element in nums2, and vice versa.", "Reduce the sum of squared difference greedily. One operation of k should use the index that has the current maximum difference.", "Binary search the maximum difference for the final result." ] }, { "question_id": 2334, "task_id": "subarray-with-elements-greater-than-varying-threshold", "drop": [], "similar": [ "maximum-subarray-min-product", "smallest-k-length-subsequence-with-occurrences-of-a-letter", "k-divisible-elements-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "threshold" ], "tests": { "total": 116, "kept": 113, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i], threshold <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i], threshold <= 10**(9)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i], threshold <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For all elements to be greater than the threshold/length, the minimum element in the subarray must be greater than the threshold/length.", "For a given index, could you find the largest subarray such that the given index is the minimum element?", "Could you use a monotonic stack to get the next and previous smallest element for every index?" ] }, { "question_id": 2335, "task_id": "minimum-amount-of-time-to-fill-cups", "drop": [], "similar": [ "construct-target-array-with-multiple-sums", "maximum-score-from-removing-stones", "maximum-running-time-of-n-computers", "minimum-cost-to-make-array-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "amount" ], "tests": { "total": 178, "kept": 177, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 159, "end_line": 159, "violates": [ "0 <= amount[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "To minimize the amount of time needed, you want to fill up as many cups as possible in each second. This means that you want to maximize the number of seconds where you are filling up two cups.", "You always want to fill up the two types of water with the most unfilled cups." ] }, { "question_id": 2337, "task_id": "move-pieces-to-obtain-a-string", "drop": [], "similar": [ "valid-parentheses", "swap-adjacent-in-lr-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "start", "target" ], "tests": { "total": 136, "kept": 99, "dropped": { "constraint_violation": 37 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "n == start.length == target.length" ] }, { "line": 31, "end_line": 31, "violates": [ "n == start.length == target.length" ] }, { "line": 32, "end_line": 32, "violates": [ "n == start.length == target.length" ] }, { "line": 33, "end_line": 33, "violates": [ "n == start.length == target.length" ] }, { "line": 38, "end_line": 38, "violates": [ "n == start.length == target.length" ] }, { "line": 42, "end_line": 42, "violates": [ "n == start.length == target.length" ] }, { "line": 46, "end_line": 46, "violates": [ "n == start.length == target.length" ] }, { "line": 50, "end_line": 50, "violates": [ "n == start.length == target.length" ] }, { "line": 53, "end_line": 53, "violates": [ "n == start.length == target.length" ] }, { "line": 54, "end_line": 54, "violates": [ "n == start.length == target.length" ] }, { "line": 57, "end_line": 57, "violates": [ "n == start.length == target.length" ] }, { "line": 58, "end_line": 58, "violates": [ "n == start.length == target.length" ] }, { "line": 60, "end_line": 60, "violates": [ "n == start.length == target.length" ] }, { "line": 61, "end_line": 61, "violates": [ "n == start.length == target.length" ] }, { "line": 65, "end_line": 65, "violates": [ "n == start.length == target.length" ] }, { "line": 68, "end_line": 68, "violates": [ "n == start.length == target.length" ] }, { "line": 69, "end_line": 69, "violates": [ "n == start.length == target.length" ] }, { "line": 70, "end_line": 70, "violates": [ "n == start.length == target.length" ] }, { "line": 71, "end_line": 71, "violates": [ "n == start.length == target.length" ] }, { "line": 72, "end_line": 72, "violates": [ "n == start.length == target.length" ] }, { "line": 73, "end_line": 73, "violates": [ "n == start.length == target.length" ] }, { "line": 74, "end_line": 74, "violates": [ "n == start.length == target.length" ] }, { "line": 75, "end_line": 75, "violates": [ "n == start.length == target.length" ] }, { "line": 79, "end_line": 79, "violates": [ "n == start.length == target.length" ] }, { "line": 82, "end_line": 82, "violates": [ "n == start.length == target.length" ] }, { "line": 83, "end_line": 83, "violates": [ "n == start.length == target.length" ] }, { "line": 88, "end_line": 88, "violates": [ "n == start.length == target.length" ] }, { "line": 93, "end_line": 93, "violates": [ "n == start.length == target.length" ] }, { "line": 94, "end_line": 94, "violates": [ "n == start.length == target.length" ] }, { "line": 98, "end_line": 98, "violates": [ "n == start.length == target.length" ] }, { "line": 108, "end_line": 108, "violates": [ "n == start.length == target.length" ] }, { "line": 114, "end_line": 114, "violates": [ "n == start.length == target.length" ] }, { "line": 117, "end_line": 117, "violates": [ "n == start.length == target.length" ] }, { "line": 119, "end_line": 119, "violates": [ "n == start.length == target.length" ] }, { "line": 123, "end_line": 123, "violates": [ "n == start.length == target.length" ] }, { "line": 133, "end_line": 133, "violates": [ "n == start.length == target.length" ] }, { "line": 135, "end_line": 135, "violates": [ "n == start.length == target.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "After some sequence of moves, can the order of the pieces change?", "Try to match each piece in s with a piece in e." ] }, { "question_id": 2338, "task_id": "count-the-number-of-ideal-arrays", "drop": [], "similar": [ "count-ways-to-make-array-with-product", "count-the-number-of-beautiful-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "maxValue" ], "tests": { "total": 80, "kept": 80, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Notice that an ideal array is non-decreasing.", "Consider an alternative problem: where an ideal array must also be strictly increasing. Can you use DP to solve it?", "Will combinatorics help to get an answer from the alternative problem to the actual problem?" ] }, { "question_id": 2340, "task_id": "minimum-adjacent-swaps-to-make-a-valid-array", "drop": [ "premium" ] }, { "question_id": 2341, "task_id": "maximum-number-of-pairs-in-array", "drop": [], "similar": [ "sort-characters-by-frequency", "top-k-frequent-words", "sort-array-by-increasing-frequency" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 126, "kept": 126, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "What do we need to know to find how many pairs we can make? We need to know the frequency of each integer.", "When will there be a leftover number? When the frequency of an integer is an odd number." ] }, { "question_id": 2342, "task_id": "max-sum-of-a-pair-with-equal-sum-of-digits", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 121, "kept": 115, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What is the largest possible sum of digits a number can have?", "Group the array elements by the sum of their digits, and find the largest two elements of each group." ] }, { "question_id": 2343, "task_id": "query-kth-smallest-trimmed-number", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 94, "kept": 94, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All nums[i].length are equal.", "1 <= trimi <= nums[i].length" ], "public_tests": 2, "hints": [ "Run a simulation to follow the requirement of each query." ] }, { "question_id": 2344, "task_id": "minimum-deletions-to-make-array-divisible", "drop": [], "similar": [ "check-if-array-pairs-are-divisible-by-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "numsDivide" ], "tests": { "total": 158, "kept": 157, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i], numsDivide[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How can we find an integer x that divides all the elements of numsDivide?", "Will finding GCD (Greatest Common Divisor) help here?" ] }, { "question_id": 2345, "task_id": "finding-the-number-of-visible-mountains", "drop": [ "premium" ] }, { "question_id": 2347, "task_id": "best-poker-hand", "drop": [], "similar": [ "categorize-box-according-to-criteria" ], "flags": [], "comparison": "exact", "parameter_names": [ "ranks", "suits" ], "tests": { "total": 100, "kept": 67, "dropped": { "constraint_violation": 33 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 6, "end_line": 6, "violates": [ "'a' <= suits[i] <= 'd'", "'a' <= suits[i] <= 'd'" ] }, { "line": 14, "end_line": 14, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 17, "end_line": 17, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 18, "end_line": 18, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 19, "end_line": 19, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 28, "end_line": 28, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 33, "end_line": 33, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 38, "end_line": 38, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 46, "end_line": 46, "violates": [ "'a' <= suits[i] <= 'd'", "'a' <= suits[i] <= 'd'" ] }, { "line": 50, "end_line": 50, "violates": [ "'a' <= suits[i] <= 'd'", "'a' <= suits[i] <= 'd'" ] }, { "line": 51, "end_line": 51, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 52, "end_line": 52, "violates": [ "'a' <= suits[i] <= 'd'", "'a' <= suits[i] <= 'd'" ] }, { "line": 54, "end_line": 54, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 55, "end_line": 55, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 56, "end_line": 56, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 58, "end_line": 58, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 61, "end_line": 61, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 67, "end_line": 67, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 69, "end_line": 69, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 72, "end_line": 72, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 74, "end_line": 74, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 75, "end_line": 75, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 76, "end_line": 76, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 78, "end_line": 78, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 79, "end_line": 79, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 83, "end_line": 83, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 85, "end_line": 85, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 88, "end_line": 88, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 94, "end_line": 94, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 95, "end_line": 95, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 98, "end_line": 98, "violates": [ "'a' <= suits[i] <= 'd'" ] }, { "line": 101, "end_line": 101, "violates": [ "'a' <= suits[i] <= 'd'" ] } ], "unchecked_constraints": [ "No two cards have the same rank and suit." ], "public_tests": 3, "hints": [ "Sequentially check the conditions 1 through 4, and return the outcome corresponding to the first met condition." ] }, { "question_id": 2348, "task_id": "number-of-zero-filled-subarrays", "drop": [], "similar": [ "arithmetic-slices", "number-of-smooth-descent-periods-of-a-stock", "length-of-the-longest-alphabetical-continuous-substring", "find-consecutive-integers-from-a-data-stream" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each zero, you can calculate the number of zero-filled subarrays that end on that index, which is the number of consecutive zeros behind the current element + 1.", "Maintain the number of consecutive zeros behind the current element, count the number of zero-filled subarrays that end on each index, sum it up to get the answer." ] }, { "question_id": 2350, "task_id": "shortest-impossible-sequence-of-rolls", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "rolls", "k" ], "tests": { "total": 97, "kept": 97, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "How can you find the minimum index such that all sequences of length 1 can be formed from the start until that index?", "Starting from the previous minimum index, what is the next index such that all sequences of length 2 can be formed?", "Can you extend the idea to sequences of length 3 and more?" ] }, { "question_id": 2351, "task_id": "first-letter-to-appear-twice", "drop": [], "similar": [ "two-sum", "first-unique-character-in-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 132, "kept": 129, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 62, "end_line": 62, "violates": [ "2 <= s.length <= 100" ] }, { "line": 73, "end_line": 73, "violates": [ "2 <= s.length <= 100" ] }, { "line": 99, "end_line": 99, "violates": [ "2 <= s.length <= 100" ] } ], "unchecked_constraints": [ "s has at least one repeated letter." ], "public_tests": 2, "hints": [ "Iterate through the string from left to right. Keep track of the elements you have already seen in a set.", "If the current element is already in the set, return that element." ] }, { "question_id": 2352, "task_id": "equal-row-and-column-pairs", "drop": [], "similar": [ "delete-greatest-value-in-each-row" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 64, "kept": 57, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 25, "end_line": 25, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 30, "end_line": 30, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 40, "end_line": 40, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 46, "end_line": 46, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We can use nested loops to compare every row against every column.", "Another loop is necessary to compare the row and column element by element.", "It is also possible to hash the arrays and compare the hashed values instead." ] }, { "question_id": 2354, "task_id": "number-of-excellent-pairs", "drop": [], "similar": [ "two-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 111, "kept": 107, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can you find a different way to describe the second condition?", "The sum of the number of set bits in (num1 OR num2) and (num1 AND num2) is equal to the sum of the number of set bits in num1 and num2." ] }, { "question_id": 2355, "task_id": "maximum-number-of-books-you-can-take", "drop": [ "premium" ] }, { "question_id": 2357, "task_id": "make-array-zero-by-subtracting-equal-amounts", "drop": [], "similar": [ "contains-duplicate" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 116, "kept": 112, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 113, "end_line": 113, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 114, "end_line": 114, "violates": [ "0 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It is always best to set x as the smallest non-zero element in nums.", "Elements with the same value will always take the same number of operations to become 0. Contrarily, elements with different values will always take a different number of operations to become 0.", "The answer is the number of unique non-zero numbers in nums." ] }, { "question_id": 2358, "task_id": "maximum-number-of-groups-entering-a-competition", "drop": [], "similar": [ "maximum-height-by-stacking-cuboids" ], "flags": [], "comparison": "exact", "parameter_names": [ "grades" ], "tests": { "total": 84, "kept": 83, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "1 <= grades[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Would it be easier to place the students into valid groups after sorting them based on their grades in ascending order?", "Notice that, after sorting, we can separate them into groups of sizes 1, 2, 3, and so on.", "If the last group is invalid, we can merge it with the previous group.", "This creates the maximum number of groups because we always greedily form the smallest possible group." ] }, { "question_id": 2359, "task_id": "find-closest-node-to-given-two-nodes", "drop": [], "similar": [], "flags": [ "multiple_answers", "has_images" ], "comparison": "exact", "parameter_names": [ "edges", "node1", "node2" ], "tests": { "total": 101, "kept": 67, "dropped": { "constraint_violation": 34 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "edges[i] != i" ] }, { "line": 13, "end_line": 13, "violates": [ "edges[i] != i" ] }, { "line": 14, "end_line": 14, "violates": [ "edges[i] != i" ] }, { "line": 15, "end_line": 15, "violates": [ "edges[i] != i" ] }, { "line": 21, "end_line": 21, "violates": [ "edges[i] != i" ] }, { "line": 22, "end_line": 22, "violates": [ "edges[i] != i" ] }, { "line": 23, "end_line": 23, "violates": [ "edges[i] != i" ] }, { "line": 24, "end_line": 24, "violates": [ "edges[i] != i" ] }, { "line": 27, "end_line": 27, "violates": [ "edges[i] != i" ] }, { "line": 28, "end_line": 28, "violates": [ "edges[i] != i" ] }, { "line": 29, "end_line": 29, "violates": [ "edges[i] != i" ] }, { "line": 31, "end_line": 31, "violates": [ "edges[i] != i" ] }, { "line": 32, "end_line": 32, "violates": [ "edges[i] != i" ] }, { "line": 33, "end_line": 33, "violates": [ "edges[i] != i" ] }, { "line": 35, "end_line": 35, "violates": [ "edges[i] != i" ] }, { "line": 37, "end_line": 37, "violates": [ "edges[i] != i" ] }, { "line": 40, "end_line": 40, "violates": [ "edges[i] != i" ] }, { "line": 43, "end_line": 43, "violates": [ "edges[i] != i" ] }, { "line": 46, "end_line": 46, "violates": [ "edges[i] != i" ] }, { "line": 48, "end_line": 48, "violates": [ "edges[i] != i" ] }, { "line": 50, "end_line": 50, "violates": [ "edges[i] != i" ] }, { "line": 56, "end_line": 56, "violates": [ "edges[i] != i" ] }, { "line": 57, "end_line": 57, "violates": [ "edges[i] != i" ] }, { "line": 61, "end_line": 61, "violates": [ "edges[i] != i" ] }, { "line": 65, "end_line": 65, "violates": [ "edges[i] != i" ] }, { "line": 67, "end_line": 67, "violates": [ "edges[i] != i" ] }, { "line": 70, "end_line": 70, "violates": [ "edges[i] != i" ] }, { "line": 71, "end_line": 71, "violates": [ "edges[i] != i" ] }, { "line": 75, "end_line": 75, "violates": [ "edges[i] != i" ] }, { "line": 77, "end_line": 77, "violates": [ "edges[i] != i" ] }, { "line": 81, "end_line": 81, "violates": [ "edges[i] != i" ] }, { "line": 83, "end_line": 83, "violates": [ "edges[i] != i" ] }, { "line": 90, "end_line": 90, "violates": [ "edges[i] != i" ] }, { "line": 93, "end_line": 93, "violates": [ "edges[i] != i" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How can you find the shortest distance from one node to all nodes in the graph?", "Use BFS to find the shortest distance from both node1 and node2 to all nodes in the graph. Then iterate over all nodes, and find the node with the minimum max distance." ] }, { "question_id": 2360, "task_id": "longest-cycle-in-a-graph", "drop": [], "similar": [ "strange-printer-ii", "minimum-number-of-operations-to-sort-a-binary-tree-by-level", "shortest-cycle-in-a-graph" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges" ], "tests": { "total": 109, "kept": 70, "dropped": { "constraint_violation": 39 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "edges[i] != i" ] }, { "line": 10, "end_line": 10, "violates": [ "edges[i] != i" ] }, { "line": 12, "end_line": 12, "violates": [ "edges[i] != i" ] }, { "line": 19, "end_line": 19, "violates": [ "edges[i] != i" ] }, { "line": 22, "end_line": 22, "violates": [ "edges[i] != i" ] }, { "line": 24, "end_line": 24, "violates": [ "edges[i] != i" ] }, { "line": 26, "end_line": 26, "violates": [ "edges[i] != i" ] }, { "line": 29, "end_line": 29, "violates": [ "edges[i] != i" ] }, { "line": 30, "end_line": 30, "violates": [ "edges[i] != i" ] }, { "line": 31, "end_line": 31, "violates": [ "edges[i] != i" ] }, { "line": 32, "end_line": 32, "violates": [ "edges[i] != i" ] }, { "line": 33, "end_line": 33, "violates": [ "edges[i] != i" ] }, { "line": 36, "end_line": 36, "violates": [ "edges[i] != i" ] }, { "line": 37, "end_line": 37, "violates": [ "edges[i] != i" ] }, { "line": 39, "end_line": 39, "violates": [ "edges[i] != i" ] }, { "line": 42, "end_line": 42, "violates": [ "edges[i] != i" ] }, { "line": 44, "end_line": 44, "violates": [ "edges[i] != i" ] }, { "line": 45, "end_line": 45, "violates": [ "edges[i] != i" ] }, { "line": 47, "end_line": 47, "violates": [ "edges[i] != i" ] }, { "line": 49, "end_line": 49, "violates": [ "edges[i] != i" ] }, { "line": 51, "end_line": 51, "violates": [ "edges[i] != i" ] }, { "line": 54, "end_line": 54, "violates": [ "edges[i] != i" ] }, { "line": 56, "end_line": 56, "violates": [ "edges[i] != i" ] }, { "line": 65, "end_line": 65, "violates": [ "edges[i] != i" ] }, { "line": 66, "end_line": 66, "violates": [ "edges[i] != i" ] }, { "line": 67, "end_line": 67, "violates": [ "edges[i] != i" ] }, { "line": 68, "end_line": 68, "violates": [ "edges[i] != i" ] }, { "line": 77, "end_line": 77, "violates": [ "edges[i] != i" ] }, { "line": 80, "end_line": 80, "violates": [ "edges[i] != i" ] }, { "line": 87, "end_line": 87, "violates": [ "edges[i] != i" ] }, { "line": 90, "end_line": 90, "violates": [ "edges[i] != i" ] }, { "line": 95, "end_line": 95, "violates": [ "edges[i] != i" ] }, { "line": 96, "end_line": 96, "violates": [ "edges[i] != i" ] }, { "line": 99, "end_line": 99, "violates": [ "edges[i] != i" ] }, { "line": 101, "end_line": 101, "violates": [ "edges[i] != i" ] }, { "line": 102, "end_line": 102, "violates": [ "edges[i] != i" ] }, { "line": 103, "end_line": 103, "violates": [ "edges[i] != i" ] }, { "line": 108, "end_line": 108, "violates": [ "edges[i] != i" ] }, { "line": 109, "end_line": 109, "violates": [ "edges[i] != i" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How many cycles can each node at most be part of?", "Each node can be part of at most one cycle. Start from each node and find the cycle that it is part of if there is any. Save the already visited nodes to not repeat visiting the same cycle multiple times." ] }, { "question_id": 2361, "task_id": "minimum-costs-using-the-train-line", "drop": [ "premium" ] }, { "question_id": 2363, "task_id": "merge-similar-items", "drop": [], "similar": [ "merge-two-2d-arrays-by-summing-values" ], "flags": [], "comparison": "exact", "parameter_names": [ "items1", "items2" ], "tests": { "total": 100, "kept": 100, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= valuei, weighti <= 1000", "Each valuei in items1 is unique.", "Each valuei in items2 is unique.", "items1[i].length == items2[i].length == 2" ], "public_tests": 3, "hints": [ "Map the weights using the corresponding values as keys.", "Make sure your output is sorted in ascending order by value." ] }, { "question_id": 2364, "task_id": "count-number-of-bad-pairs", "drop": [], "similar": [ "k-diff-pairs-in-an-array", "subarray-sums-divisible-by-k", "count-nice-pairs-in-an-array", "count-number-of-pairs-with-absolute-difference-k", "count-equal-and-divisible-pairs-in-an-array", "number-of-pairs-satisfying-inequality" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 132, "kept": 123, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Would it be easier to count the number of pairs that are not bad pairs?", "Notice that (j - i != nums[j] - nums[i]) is the same as (nums[i] - i != nums[j] - j).", "Keep a counter of nums[i] - i. To be efficient, use a HashMap." ] }, { "question_id": 2365, "task_id": "task-scheduler-ii", "drop": [], "similar": [ "task-scheduler", "maximize-distance-to-closest-person", "check-if-all-1s-are-at-least-length-k-places-away" ], "flags": [], "comparison": "exact", "parameter_names": [ "tasks", "space" ], "tests": { "total": 102, "kept": 94, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= space <= tasks.length" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= space <= tasks.length" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= space <= tasks.length" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= space <= tasks.length" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= space <= tasks.length" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= space <= tasks.length" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= space <= tasks.length" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= space <= tasks.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try taking breaks as late as possible, such that tasks are still spaced appropriately.", "Whenever considering whether to complete the next task, if it is not the first task of its type, check how many days ago the previous task was completed and add an appropriate number of breaks." ] }, { "question_id": 2366, "task_id": "minimum-replacements-to-sort-the-array", "drop": [], "similar": [ "minimum-operations-to-make-the-array-increasing" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 107, "kept": 107, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It is optimal to never make an operation to the last element of the array.", "You can iterate from the second last element to the first. If the current value is greater than the previous bound, we want to break it into pieces so that the smaller one is as large as possible but not larger than the previous one." ] }, { "question_id": 2367, "task_id": "number-of-arithmetic-triplets", "drop": [], "similar": [ "two-sum", "3sum", "number-of-unequal-triplets-in-array", "maximum-value-of-an-ordered-triplet-i", "minimum-sum-of-mountain-triplets-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "diff" ], "tests": { "total": 104, "kept": 104, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums is strictly increasing." ], "public_tests": 2, "hints": [ "Are the constraints small enough for brute force?", "We can use three loops, each iterating through the array to go through every possible triplet. Be sure to not count duplicates." ] }, { "question_id": 2368, "task_id": "reachable-nodes-with-restrictions", "drop": [], "similar": [ "open-the-lock", "minimum-jumps-to-reach-home" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "restricted" ], "tests": { "total": 71, "kept": 60, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "edges.length == n - 1" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= restricted[i] < n" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= restricted[i] < n" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= restricted[i] < n" ] }, { "line": 46, "end_line": 46, "violates": [ "edges.length == n - 1", "1 <= restricted[i] < n" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= restricted[i] < n" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= restricted[i] < n" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= restricted[i] < n" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= restricted[i] < n" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= restricted.length < n", "1 <= restricted[i] < n" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= restricted[i] < n" ] } ], "unchecked_constraints": [ "edges represents a valid tree." ], "public_tests": 2, "hints": [ "Can we find all the reachable nodes in a single traversal?", "Traverse the graph from node 0 while avoiding the nodes in restricted and do not revisit nodes that have been visited.", "Keep count of how many nodes are visited in total." ] }, { "question_id": 2369, "task_id": "check-if-there-is-a-valid-partition-for-the-array", "drop": [], "similar": [ "count-the-number-of-good-partitions" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 134, "kept": 134, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How can you reduce the problem to checking if there is a valid partition for a smaller array?", "Use dynamic programming to reduce the problem until you have an empty array." ] }, { "question_id": 2370, "task_id": "longest-ideal-subsequence", "drop": [], "similar": [ "longest-increasing-subsequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 85, "kept": 84, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 46, "end_line": 46, "violates": [ "s consists of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How can you calculate the longest ideal subsequence that ends at a specific index i?", "Can you calculate it for all positions i? How can you use previously calculated answers to calculate the answer for the next position?" ] }, { "question_id": 2371, "task_id": "minimize-maximum-value-in-a-grid", "drop": [ "premium" ] }, { "question_id": 2373, "task_id": "largest-local-values-in-a-matrix", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 56, "kept": 50, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 7, "end_line": 7, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= grid[i][j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use nested loops to run through all possible 3 x 3 windows in the matrix.", "For each 3 x 3 window, iterate through the values to get the maximum value within the window." ] }, { "question_id": 2374, "task_id": "node-with-highest-edge-score", "drop": [], "similar": [ "two-sum", "sort-characters-by-frequency", "sort-array-by-increasing-frequency" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges" ], "tests": { "total": 26, "kept": 11, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "edges[i] != i" ] }, { "line": 5, "end_line": 5, "violates": [ "edges[i] != i" ] }, { "line": 6, "end_line": 6, "violates": [ "edges[i] != i" ] }, { "line": 8, "end_line": 8, "violates": [ "edges[i] != i" ] }, { "line": 11, "end_line": 11, "violates": [ "edges[i] != i" ] }, { "line": 12, "end_line": 12, "violates": [ "edges[i] != i" ] }, { "line": 13, "end_line": 13, "violates": [ "edges[i] != i" ] }, { "line": 14, "end_line": 14, "violates": [ "edges[i] != i" ] }, { "line": 16, "end_line": 16, "violates": [ "edges[i] != i", "edges[i] != i" ] }, { "line": 17, "end_line": 17, "violates": [ "edges[i] != i" ] }, { "line": 20, "end_line": 20, "violates": [ "edges[i] != i" ] }, { "line": 22, "end_line": 22, "violates": [ "edges[i] != i", "edges[i] != i" ] }, { "line": 23, "end_line": 23, "violates": [ "edges[i] != i" ] }, { "line": 26, "end_line": 26, "violates": [ "edges[i] != i" ] }, { "line": 27, "end_line": 27, "violates": [ "edges[i] != i" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Create an array arr where arr[i] is the edge score for node i.", "How does the edge score for node edges[i] change? It increases by i.", "The edge score may not fit within a standard 32-bit integer." ] }, { "question_id": 2375, "task_id": "construct-smallest-number-from-di-string", "drop": [], "similar": [ "di-string-match" ], "flags": [], "comparison": "exact", "parameter_names": [ "pattern" ], "tests": { "total": 116, "kept": 69, "dropped": { "constraint_violation": 47 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= pattern.length <= 8" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= pattern.length <= 8" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "With the constraints, could we generate every possible string?", "Yes we can. Now we just need to check if the string meets all the conditions." ] }, { "question_id": 2376, "task_id": "count-special-integers", "drop": [], "similar": [ "count-numbers-with-unique-digits", "k-th-smallest-in-lexicographical-order" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 57, "kept": 53, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= n <= 2 * 10**(9)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= n <= 2 * 10**(9)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= n <= 2 * 10**(9)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= n <= 2 * 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try to think of dynamic programming.", "Use the idea of digit dynamic programming to build the numbers, in addition to a bitmask that will tell which digits you have used so far on the number that you are building." ] }, { "question_id": 2378, "task_id": "choose-edges-to-maximize-score-in-a-tree", "drop": [ "premium" ] }, { "question_id": 2379, "task_id": "minimum-recolors-to-get-k-consecutive-black-blocks", "drop": [], "similar": [ "max-consecutive-ones-iii", "maximum-points-you-can-obtain-from-cards", "maximum-number-of-vowels-in-a-substring-of-given-length" ], "flags": [], "comparison": "exact", "parameter_names": [ "blocks", "k" ], "tests": { "total": 101, "kept": 101, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate through all possible consecutive substrings of k characters.", "Find the number of changes for each substring to make all blocks black, and return the minimum of these." ] }, { "question_id": 2380, "task_id": "time-needed-to-rearrange-a-binary-string", "drop": [], "similar": [ "minimum-swaps-to-group-all-1s-together", "minimum-swaps-to-group-all-1s-together-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 127, "kept": 127, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try replicating the steps from the problem statement.", "Perform the replacements simultaneously, and return the number of times the process repeats." ] }, { "question_id": 2381, "task_id": "shifting-letters-ii", "drop": [], "similar": [ "the-skyline-problem", "range-sum-query-mutable", "range-addition", "shifting-letters", "maximum-population-year", "describe-the-painting", "shift-distance-between-two-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "shifts" ], "tests": { "total": 94, "kept": 90, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 46, "end_line": 46, "violates": [ "s consists of lowercase English letters." ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= starti <= endi < s.length" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= starti <= endi < s.length" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= starti <= endi < s.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Instead of shifting every character in each shift, could you keep track of which characters are shifted and by how much across all shifts?", "Try marking the start and ends of each shift, then perform a prefix sum of the shifts." ], "similar_to_test": [ "3361 shift-distance-between-two-strings" ] }, { "question_id": 2382, "task_id": "maximum-segment-sum-after-removals", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "removeQueries" ], "tests": { "total": 90, "kept": 86, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "n == nums.length == removeQueries.length", "0 <= removeQueries[i] < n" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a sorted data structure to collect removal points and store the segments.", "Use a heap or priority queue to store segment sums and their corresponding boundaries.", "Make sure to remove invalid segments from the heap." ] }, { "question_id": 2383, "task_id": "minimum-hours-of-training-to-win-a-competition", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "initialEnergy", "initialExperience", "energy", "experience" ], "tests": { "total": 169, "kept": 167, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 65, "end_line": 65, "violates": [ "1 <= initialEnergy, initialExperience, energy[i], experience[i] <= 100" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= initialEnergy, initialExperience, energy[i], experience[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Find the minimum number of training hours needed for the energy and experience separately, and sum the results.", "Try to increase the energy and experience until you find how much is enough to win the competition." ] }, { "question_id": 2384, "task_id": "largest-palindromic-number", "drop": [], "similar": [ "longest-palindrome" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 50, "kept": 50, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "In order to form a valid palindrome, other than the middle digit in an odd-length palindrome, every digit needs to exist on both sides.", "A longer palindrome implies a larger valued palindrome. For palindromes of the same length, the larger digits should occur first.", "We can count the occurrences of each digit and build the palindrome starting from the ends. Starting from the larger digits, if there are still at least 2 occurrences of a digit, we can place these digits on each side.", "Make sure to consider the special case for the center digit (if any) and zeroes. There should not be leading zeroes." ] }, { "question_id": 2385, "task_id": "amount-of-time-for-binary-tree-to-be-infected", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "maximum-depth-of-binary-tree", "shortest-path-to-get-food", "all-nodes-distance-k-in-binary-tree", "count-the-number-of-infection-sequences" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "start" ], "tests": { "total": 70, "kept": 0, "dropped": { "unreadable": 70 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(5)].", "1 <= Node.val <= 10**(5)", "Each node has a unique value.", "A node with a value of start exists in the tree." ] }, { "question_id": 2386, "task_id": "find-the-k-sum-of-an-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 105, "kept": 97, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= k <= min(2000, 2**(n))" ] }, { "line": 37, "end_line": 37, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 65, "end_line": 65, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 73, "end_line": 73, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 77, "end_line": 77, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Start from the largest sum possible, and keep finding the next largest sum until you reach the kth sum.", "Starting from a sum, what are the two next largest sums that you can obtain from it?" ] }, { "question_id": 2387, "task_id": "median-of-a-row-wise-sorted-matrix", "drop": [ "premium" ] }, { "question_id": 2389, "task_id": "longest-subsequence-with-limited-sum", "drop": [], "similar": [ "how-many-numbers-are-smaller-than-the-current-number", "successful-pairs-of-spells-and-potions" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 108, "kept": 98, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i], queries[i] <= 10**(6)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i], queries[i] <= 10**(6)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i], queries[i] <= 10**(6)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i], queries[i] <= 10**(6)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i], queries[i] <= 10**(6)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i], queries[i] <= 10**(6)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i], queries[i] <= 10**(6)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i], queries[i] <= 10**(6)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i], queries[i] <= 10**(6)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= nums[i], queries[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Solve each query independently.", "When solving a query, which elements of nums should you choose to make the subsequence as long as possible?", "Choose the smallest elements in nums that add up to a sum less than the query." ] }, { "question_id": 2390, "task_id": "removing-stars-from-a-string", "drop": [], "similar": [ "backspace-string-compare", "remove-all-adjacent-duplicates-in-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 65, "kept": 65, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The operation above can be performed on s.", "s consists of lowercase English letters and stars *." ], "public_tests": 2, "hints": [ "What data structure could we use to efficiently perform these removals?", "Use a stack to store the characters. Pop one character off the stack at each star. Otherwise, we push the character onto the stack." ] }, { "question_id": 2391, "task_id": "minimum-amount-of-time-to-collect-garbage", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "garbage", "travel" ], "tests": { "total": 107, "kept": 81, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "2 <= garbage.length <= 10**(5)" ] }, { "line": 7, "end_line": 7, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 12, "end_line": 12, "violates": [ "travel.length == garbage.length - 1" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= garbage[i].length <= 10", "travel.length == garbage.length - 1" ] }, { "line": 41, "end_line": 41, "violates": [ "travel.length == garbage.length - 1" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 77, "end_line": 77, "violates": [ "travel.length == garbage.length - 1" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= garbage[i].length <= 10", "travel.length == garbage.length - 1" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= garbage[i].length <= 10" ] }, { "line": 103, "end_line": 103, "violates": [ "travel.length == garbage.length - 1" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= garbage[i].length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Where can we save time? By not visiting all the houses.", "For each type of garbage, find the house with the highest index that has at least 1 unit of this type of garbage." ] }, { "question_id": 2392, "task_id": "build-a-matrix-with-conditions", "drop": [], "similar": [ "course-schedule", "course-schedule-ii", "find-eventual-safe-states", "loud-and-rich" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "k", "rowConditions", "colConditions" ], "tests": { "total": 85, "kept": 83, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "abovei != belowi", "lefti != righti" ] }, { "line": 79, "end_line": 79, "violates": [ "lefti != righti" ] } ], "unchecked_constraints": [ "rowConditions[i].length == colConditions[i].length == 2" ], "public_tests": 2, "hints": [ "Can you think of the problem in terms of graphs?", "What algorithm allows you to find the order of nodes in a graph?" ] }, { "question_id": 2393, "task_id": "count-strictly-increasing-subarrays", "drop": [ "premium" ] }, { "question_id": 2395, "task_id": "find-subarrays-with-equal-sum", "drop": [], "similar": [ "two-sum", "partition-equal-subset-sum", "find-two-non-overlapping-sub-arrays-each-with-target-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 119, "kept": 119, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a counter to keep track of the subarray sums.", "Use a hashset to check if any two sums are equal." ] }, { "question_id": 2396, "task_id": "strictly-palindromic-number", "drop": [], "similar": [ "palindrome-number", "stone-game" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 57, "kept": 56, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "4 <= n <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider the representation of the given number in the base n - 2.", "The number n in base (n - 2) is always 12, which is not palindromic." ] }, { "question_id": 2397, "task_id": "maximum-rows-covered-by-columns", "drop": [], "similar": [ "matchsticks-to-square", "partition-to-k-equal-sum-subsets", "find-the-shortest-superstring", "smallest-sufficient-team", "fair-distribution-of-cookies" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "matrix", "numSelect" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try a brute-force approach.", "Iterate through all possible sets of exactly cols columns.", "For each valid set, check how many rows are covered, and return the maximum." ] }, { "question_id": 2398, "task_id": "maximum-number-of-robots-within-budget", "drop": [], "similar": [ "sliding-window-maximum", "kth-smallest-product-of-two-sorted-arrays", "maximum-number-of-tasks-you-can-assign", "minimized-maximum-of-products-distributed-to-any-store", "minimum-time-to-complete-trips" ], "flags": [], "comparison": "exact", "parameter_names": [ "chargeTimes", "runningCosts", "budget" ], "tests": { "total": 108, "kept": 107, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= chargeTimes[i], runningCosts[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use binary search to convert the problem into checking if we can find a specific number of consecutive robots within the budget.", "Maintain a sliding window of the consecutive robots being considered.", "Use either a map, deque, or heap to find the maximum charge times in the window efficiently." ] }, { "question_id": 2399, "task_id": "check-distances-between-same-letters", "drop": [], "similar": [ "two-sum", "shortest-distance-to-a-character" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "distance" ], "tests": { "total": 93, "kept": 87, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "distance.length == 26" ] }, { "line": 33, "end_line": 33, "violates": [ "distance.length == 26" ] }, { "line": 39, "end_line": 39, "violates": [ "distance.length == 26" ] }, { "line": 61, "end_line": 61, "violates": [ "distance.length == 26" ] }, { "line": 79, "end_line": 79, "violates": [ "distance.length == 26" ] }, { "line": 90, "end_line": 90, "violates": [ "distance.length == 26" ] } ], "unchecked_constraints": [ "Each letter appears in s exactly twice." ], "public_tests": 2, "hints": [ "Create an integer array of size 26 to keep track of the first occurrence of each letter.", "The number of letters between indices i and j is j - i - 1." ] }, { "question_id": 2400, "task_id": "number-of-ways-to-reach-a-position-after-exactly-k-steps", "drop": [], "similar": [ "unique-paths", "climbing-stairs", "reach-a-number", "reaching-points", "number-of-ways-to-stay-in-the-same-place-after-some-steps" ], "flags": [], "comparison": "exact", "parameter_names": [ "startPos", "endPos", "k" ], "tests": { "total": 39, "kept": 21, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 4, "end_line": 4, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= startPos, endPos, k <= 1000" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= startPos, endPos, k <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How many steps to the left and to the right do you need to make exactly?", "Does the order of the steps matter?", "Use combinatorics to find the number of ways to order the steps." ] }, { "question_id": 2401, "task_id": "longest-nice-subarray", "drop": [], "similar": [ "longest-substring-without-repeating-characters", "bitwise-and-of-numbers-range", "bitwise-ors-of-subarrays", "fruit-into-baskets", "max-consecutive-ones-iii", "get-equal-substrings-within-budget", "frequency-of-the-most-frequent-element", "longest-substring-of-all-vowels-in-order", "maximize-the-confusion-of-an-exam", "maximum-sum-of-distinct-subarrays-with-length-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 115, "kept": 83, "dropped": { "constraint_violation": 32 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What is the maximum possible length of a nice subarray?", "If two numbers have bitwise AND equal to zero, they do not have any common set bit. A number x <= 10^9 only has 30 bits, hence the length of the longest nice subarray cannot exceed 30." ] }, { "question_id": 2402, "task_id": "meeting-rooms-iii", "drop": [], "similar": [ "meeting-rooms", "meeting-rooms-ii", "maximum-number-of-events-that-can-be-attended", "find-servers-that-handled-most-number-of-requests", "maximum-number-of-events-that-can-be-attended-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "meetings" ], "tests": { "total": 92, "kept": 90, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "0 <= starti < endi <= 5 * 10**(5)" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= starti < endi <= 5 * 10**(5)" ] } ], "unchecked_constraints": [ "All the values of starti are unique." ], "public_tests": 2, "hints": [ "Sort meetings based on start times.", "Use two min heaps, the first one keeps track of the numbers of all the rooms that are free. The second heap keeps track of the end times of all the meetings that are happening and the room that they are in.", "Keep track of the number of times each room is used in an array.", "With each meeting, check if there are any free rooms. If there are, then use the room with the smallest number. Otherwise, assign the meeting to the room whose meeting will end the soonest." ] }, { "question_id": 2403, "task_id": "minimum-time-to-kill-all-monsters", "drop": [ "premium" ] }, { "question_id": 2404, "task_id": "most-frequent-even-element", "drop": [], "similar": [ "majority-element", "majority-element-ii", "top-k-frequent-elements", "sort-characters-by-frequency" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 110, "kept": 107, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 64, "end_line": 64, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Could you count the frequency of each even element in the array?", "Would a hashmap help?" ] }, { "question_id": 2405, "task_id": "optimal-partition-of-string", "drop": [], "similar": [ "longest-substring-without-repeating-characters", "longest-substring-with-at-least-k-repeating-characters", "partition-labels", "partition-array-into-disjoint-intervals", "maximum-sum-of-distinct-subarrays-with-length-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 103, "kept": 103, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to come up with a greedy approach.", "From left to right, extend every substring in the partition as much as possible." ] }, { "question_id": 2406, "task_id": "divide-intervals-into-minimum-number-of-groups", "drop": [], "similar": [ "merge-intervals", "minimum-number-of-frogs-croaking", "average-height-of-buildings-in-each-segment" ], "flags": [], "comparison": "exact", "parameter_names": [ "intervals" ], "tests": { "total": 97, "kept": 94, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 54, "end_line": 54, "violates": [ "1 <= lefti <= righti <= 10**(6)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= lefti <= righti <= 10**(6)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= lefti <= righti <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can you find a different way to describe the question?", "The minimum number of groups we need is equivalent to the maximum number of intervals that overlap at some point. How can you find that?" ] }, { "question_id": 2407, "task_id": "longest-increasing-subsequence-ii", "drop": [], "similar": [ "longest-increasing-subsequence", "number-of-longest-increasing-subsequence", "longest-continuous-increasing-subsequence", "longest-substring-of-one-repeating-character", "booking-concert-tickets-in-groups", "longest-subsequence-with-decreasing-adjacent-difference" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 110, "kept": 106, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i], k <= 10**(5)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i], k <= 10**(5)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i], k <= 10**(5)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i], k <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "We can use dynamic programming. Let dp[i][val] be the answer using only the first i + 1 elements, and the last element in the subsequence is equal to val.", "The only value that might change between dp[i - 1] and dp[i] are dp[i - 1][val] and dp[i][val].", "Try using dp[i - 1] and the fact that the second last element in the subsequence has to fall within a range to calculate dp[i][val].", "We can use a segment tree to find the maximum value in dp[i - 1] within a certain range." ], "similar_to_test": [ "3409 longest-subsequence-with-decreasing-adjacent-difference" ] }, { "question_id": 2409, "task_id": "count-days-spent-together", "drop": [], "similar": [ "number-of-days-between-two-dates", "minimum-number-of-operations-to-convert-time" ], "flags": [], "comparison": "exact", "parameter_names": [ "arriveAlice", "leaveAlice", "arriveBob", "leaveBob" ], "tests": { "total": 116, "kept": 116, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All dates are provided in the format \"MM-DD\".", "Alice and Bob's arrival dates are earlier than or equal to their leaving dates.", "The given dates are valid dates of a non-leap year." ], "public_tests": 2, "hints": [ "For a given day, determine if Alice or Bob or both are in Rome.", "Brute force all 365 days for both Alice and Bob." ] }, { "question_id": 2410, "task_id": "maximum-matching-of-players-with-trainers", "drop": [], "similar": [ "most-profit-assigning-work", "long-pressed-name", "interval-list-intersections", "largest-merge-of-two-strings", "maximum-number-of-tasks-you-can-assign", "successful-pairs-of-spells-and-potions", "the-latest-time-to-catch-a-bus", "maximize-greatness-of-an-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "players", "trainers" ], "tests": { "total": 120, "kept": 119, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 93, "end_line": 93, "violates": [ "1 <= players[i], trainers[j] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort both the arrays.", "Construct the matching greedily." ] }, { "question_id": 2411, "task_id": "smallest-subarrays-with-maximum-bitwise-or", "drop": [], "similar": [ "merge-k-sorted-lists", "bitwise-ors-of-subarrays", "longest-subarray-with-maximum-bitwise-and" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 102, "kept": 95, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= nums[i] <= 10**(9)", "0 <= nums[i] <= 10**(9)" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= nums[i] <= 10**(9)", "0 <= nums[i] <= 10**(9)" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider trying to solve the problem for each bit position separately.", "For each bit position, find the position of the next number that has a 1 in that position, if any.", "Take the maximum distance to such a number, including the current number.", "Iterate backwards to achieve a linear complexity." ] }, { "question_id": 2412, "task_id": "minimum-money-required-before-transactions", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "transactions" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Split transactions that have cashback greater or equal to cost apart from transactions that have cashback less than cost. You will always earn money in the first scenario.", "For transactions that have cashback greater or equal to cost, sort them by cost in descending order.", "For transactions that have cashback less than cost, sort them by cashback in ascending order." ] }, { "question_id": 2413, "task_id": "smallest-even-multiple", "drop": [], "similar": [ "greatest-common-divisor-of-strings", "three-divisors", "find-greatest-common-divisor-of-array", "convert-the-temperature", "minimum-cuts-to-divide-a-circle" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "A guaranteed way to find a multiple of 2 and n is to multiply them together. When is this the answer, and when is there a smaller answer?", "There is a smaller answer when n is even." ] }, { "question_id": 2414, "task_id": "length-of-the-longest-alphabetical-continuous-substring", "drop": [], "similar": [ "longest-consecutive-sequence", "arithmetic-slices", "max-consecutive-ones", "maximum-number-of-vowels-in-a-substring-of-given-length", "number-of-zero-filled-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 115, "kept": 114, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 107, "end_line": 107, "violates": [ "s consists of only English lowercase letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What is the longest possible continuous substring?", "The size of the longest possible continuous substring is at most 26, so we can just brute force the answer." ] }, { "question_id": 2415, "task_id": "reverse-odd-levels-of-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "invert-binary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 2**(14)].", "0 <= Node.val <= 10**(5)", "root is a perfect binary tree." ] }, { "question_id": 2416, "task_id": "sum-of-prefix-scores-of-strings", "drop": [], "similar": [ "design-add-and-search-words-data-structure", "maximum-xor-of-two-numbers-in-an-array", "map-sum-pairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What data structure will allow you to efficiently keep track of the score of each prefix?", "Use a Trie. Insert all the words into it, and keep a counter at each node that will tell you how many times we have visited each prefix." ] }, { "question_id": 2417, "task_id": "closest-fair-integer", "drop": [ "premium" ] }, { "question_id": 2418, "task_id": "sort-the-people", "drop": [], "similar": [ "sort-array-by-increasing-frequency", "sort-the-students-by-their-kth-score" ], "flags": [], "comparison": "exact", "parameter_names": [ "names", "heights" ], "tests": { "total": 120, "kept": 119, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 44, "end_line": 44, "violates": [ "All the values of heights are distinct." ] } ], "unchecked_constraints": [ "names[i] consists of lower and upper case English letters." ], "public_tests": 2, "hints": [ "Find the tallest person and swap with the first person, then find the second tallest person and swap with the second person, etc. Repeat until you fix all n people." ] }, { "question_id": 2419, "task_id": "longest-subarray-with-maximum-bitwise-and", "drop": [], "similar": [ "number-of-different-integers-in-a-string", "remove-colored-pieces-if-both-neighbors-are-the-same-color", "count-number-of-maximum-bitwise-or-subsets", "smallest-subarrays-with-maximum-bitwise-or" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 42, "kept": 38, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Notice that the bitwise AND of two different numbers will always be strictly less than the maximum of those two numbers.", "What does that tell us about the nature of the subarray that we should choose?" ] }, { "question_id": 2420, "task_id": "find-all-good-indices", "drop": [], "similar": [ "find-good-days-to-rob-the-bank", "abbreviating-the-product-of-a-range", "count-the-number-of-k-big-indices" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 101, "kept": 101, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate over all indices i. How do you quickly check the two conditions?", "Precompute for each index whether the conditions are satisfied on the left and the right of the index. You can do that with two iterations, from left to right and right to left." ] }, { "question_id": 2421, "task_id": "number-of-good-paths", "drop": [], "similar": [ "checking-existence-of-edge-length-limited-paths", "checking-existence-of-edge-length-limited-paths-ii", "longest-nice-substring", "count-good-triplets-in-an-array", "count-pairs-of-similar-strings" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "vals", "edges" ], "tests": { "total": 82, "kept": 80, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "edges.length == n - 1" ] }, { "line": 59, "end_line": 59, "violates": [ "edges.length == n - 1" ] } ], "unchecked_constraints": [ "edges represents a valid tree." ], "public_tests": 3, "hints": [ "Can you process nodes from smallest to largest value?", "Try to build the graph from nodes with the smallest value to the largest value.", "May union find help?" ] }, { "question_id": 2422, "task_id": "merge-operations-to-turn-array-into-a-palindrome", "drop": [ "premium" ] }, { "question_id": 2423, "task_id": "remove-letter-to-equalize-frequency", "drop": [], "similar": [ "maximum-equal-frequency", "minimum-deletions-to-make-character-frequencies-unique" ], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 74, "kept": 73, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 59, "end_line": 59, "violates": [ "2 <= word.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Brute force all letters that could be removed.", "Use a frequency array of size 26." ] }, { "question_id": 2425, "task_id": "bitwise-xor-of-all-pairings", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 102, "kept": 96, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 42, "end_line": 42, "violates": [ "0 <= nums1[i], nums2[j] <= 10**(9)" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= nums1[i], nums2[j] <= 10**(9)" ] }, { "line": 73, "end_line": 73, "violates": [ "0 <= nums1[i], nums2[j] <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= nums1[i], nums2[j] <= 10**(9)" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= nums1[i], nums2[j] <= 10**(9)" ] }, { "line": 96, "end_line": 96, "violates": [ "0 <= nums1[i], nums2[j] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Think how the count of each individual integer affects the final answer.", "If the length of nums1 is m and the length of nums2 is n, then each number in nums1 is repeated n times and each number in nums2 is repeated m times." ] }, { "question_id": 2426, "task_id": "number-of-pairs-satisfying-inequality", "drop": [], "similar": [ "k-diff-pairs-in-an-array", "count-nice-pairs-in-an-array", "count-number-of-bad-pairs", "maximum-balanced-subsequence-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "diff" ], "tests": { "total": 99, "kept": 91, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "-10**(4) <= diff <= 10**(4)" ] }, { "line": 20, "end_line": 20, "violates": [ "-10**(4) <= diff <= 10**(4)" ] }, { "line": 26, "end_line": 26, "violates": [ "-10**(4) <= diff <= 10**(4)" ] }, { "line": 27, "end_line": 27, "violates": [ "-10**(4) <= diff <= 10**(4)" ] }, { "line": 43, "end_line": 43, "violates": [ "-10**(4) <= diff <= 10**(4)" ] }, { "line": 69, "end_line": 69, "violates": [ "-10**(4) <= diff <= 10**(4)" ] }, { "line": 79, "end_line": 79, "violates": [ "-10**(4) <= diff <= 10**(4)" ] }, { "line": 100, "end_line": 100, "violates": [ "-10**(4) <= diff <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try rearranging the equation.", "Once the equation is rearranged properly, think how a segment tree or a Fenwick tree can be used to solve the rearranged equation.", "Iterate through the array backwards." ] }, { "question_id": 2427, "task_id": "number-of-common-factors", "drop": [], "similar": [ "count-primes" ], "flags": [], "comparison": "exact", "parameter_names": [ "a", "b" ], "tests": { "total": 107, "kept": 99, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= a, b <= 1000" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= a, b <= 1000" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= a, b <= 1000" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= a, b <= 1000" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= a, b <= 1000" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= a, b <= 1000" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= a, b <= 1000" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= a, b <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each integer in range [1,1000], check if it\u2019s divisible by both A and B." ] }, { "question_id": 2428, "task_id": "maximum-sum-of-an-hourglass", "drop": [], "similar": [ "matrix-block-sum" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 65, "kept": 63, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "0 <= grid[i][j] <= 10**(6)" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= grid[i][j] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Each 3x3 submatrix has exactly one hourglass.", "Find the sum of each hourglass in the matrix and return the largest of these values." ] }, { "question_id": 2429, "task_id": "minimize-xor", "drop": [], "similar": [ "maximum-xor-of-two-numbers-in-an-array", "maximum-xor-with-an-element-from-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "num1", "num2" ], "tests": { "total": 85, "kept": 60, "dropped": { "constraint_violation": 25 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= num1, num2 <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= num1, num2 <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "To arrive at a small xor, try to turn off some bits from num1", "If there are still left bits to set, try to set them from the least significant bit" ] }, { "question_id": 2430, "task_id": "maximum-deletions-on-a-string", "drop": [], "similar": [ "shortest-palindrome", "longest-happy-prefix", "remove-all-occurrences-of-a-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 103, "kept": 103, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "We can use dynamic programming to find the answer. Create a 0-indexed dp array where dp[i] represents the maximum number of moves needed to remove the first i + 1 letters from s.", "What should we do if there is an i where it is impossible to remove the first i + 1 letters?", "Use a sentinel value such as -1 to show that it is impossible.", "How can we quickly determine if two substrings of s are equal? We can use hashing." ] }, { "question_id": 2431, "task_id": "maximize-total-tastiness-of-purchased-fruits", "drop": [ "premium" ] }, { "question_id": 2432, "task_id": "the-employee-that-worked-on-the-longest-task", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "logs" ], "tests": { "total": 99, "kept": 96, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "1 <= leaveTimei <= 500" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= leaveTimei <= 500" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= leaveTimei <= 500" ] } ], "unchecked_constraints": [ "leaveTimei are sorted in a strictly increasing order." ], "public_tests": 3, "hints": [ "Find the time of the longest task", "Store each employee\u2019s longest task time in a hash table", "For employees that have the same longest task time, we only need the employee with the smallest ID" ] }, { "question_id": 2433, "task_id": "find-the-original-array-of-prefix-xor", "drop": [], "similar": [ "single-number-iii", "count-triplets-that-can-form-two-arrays-of-equal-xor", "decode-xored-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "pref" ], "tests": { "total": 98, "kept": 78, "dropped": { "constraint_violation": 20 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 16, "end_line": 16, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 87, "end_line": 87, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= pref[i] <= 10**(6)" ] }, { "line": 96, "end_line": 96, "violates": [ "0 <= pref[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider the following equation: x ^ a = b. How can you find x?", "Notice that arr[i] ^ pref[i-1] = pref[i]. This is the same as the previous equation." ] }, { "question_id": 2434, "task_id": "using-a-robot-to-print-the-lexicographically-smallest-string", "drop": [], "similar": [ "find-permutation" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 61, "kept": 61, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If there are some character \u201ca\u201d \u2019 s in the string, they can be written on paper before anything else.", "Every character in the string before the last \u201ca\u201d should be written in reversed order.", "After the robot writes every \u201ca\u201d on paper, the same holds for other characters \u201cb\u201d, \u201dc\u201d, \u2026etc." ] }, { "question_id": 2435, "task_id": "paths-in-matrix-whose-sum-is-divisible-by-k", "drop": [], "similar": [ "unique-paths", "unique-paths-ii", "minimum-path-sum", "dungeon-game", "cherry-pickup", "shortest-path-in-binary-matrix", "minimum-cost-homecoming-of-a-robot-in-a-grid", "check-if-there-is-a-path-with-equal-number-of-0s-and-1s" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid", "k" ], "tests": { "total": 74, "kept": 70, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= k <= 50" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= k <= 50" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= k <= 50" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= grid[i][j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The actual numbers in grid do not matter. What matters are the remainders you get when you divide the numbers by k.", "We can use dynamic programming to solve this problem. What can we use as states?", "Let dp[i][j][value] represent the number of paths where the sum of the elements on the path has a remainder of value when divided by k." ] }, { "question_id": 2436, "task_id": "minimum-split-into-subarrays-with-gcd-greater-than-one", "drop": [ "premium" ] }, { "question_id": 2437, "task_id": "number-of-valid-clock-times", "drop": [], "similar": [ "largest-time-for-given-digits", "latest-time-by-replacing-hidden-digits" ], "flags": [], "comparison": "exact", "parameter_names": [ "time" ], "tests": { "total": 114, "kept": 114, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "time is a valid string of length 5 in the format \"hh:mm\".", "\"00\" <= hh <= \"23\"", "\"00\" <= mm <= \"59\"", "Some of the digits might be replaced with '?' and need to be replaced with digits from 0 to 9." ], "public_tests": 3, "hints": [ "Brute force all possible clock times.", "Checking if a clock time is valid can be done with Regex." ] }, { "question_id": 2438, "task_id": "range-product-queries-of-powers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "queries" ], "tests": { "total": 90, "kept": 80, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= n <= 10**(9)" ] } ], "unchecked_constraints": [ "0 <= starti <= endi < powers.length" ], "public_tests": 2, "hints": [ "The powers array can be created using the binary representation of n.", "Once powers is formed, the products can be taken using brute force." ] }, { "question_id": 2439, "task_id": "minimize-maximum-of-array", "drop": [], "similar": [ "maximum-candies-allocated-to-k-children", "minimum-speed-to-arrive-on-time", "minimum-time-to-complete-trips" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 114, "kept": 112, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 42, "end_line": 42, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try a binary search approach.", "Perform a binary search over the minimum value that can be achieved for the maximum number of the array.", "In each binary search iteration, iterate through the array backwards, greedily decreasing the current element until it is within the limit." ] }, { "question_id": 2440, "task_id": "create-components-with-same-value", "drop": [], "similar": [ "equal-tree-partition", "maximum-number-of-k-divisible-components" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums", "edges" ], "tests": { "total": 49, "kept": 44, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "edges.length == n - 1" ] }, { "line": 33, "end_line": 33, "violates": [ "edges.length == n - 1" ] }, { "line": 37, "end_line": 37, "violates": [ "edges.length == n - 1" ] }, { "line": 42, "end_line": 42, "violates": [ "edges.length == n - 1" ] }, { "line": 50, "end_line": 50, "violates": [ "edges.length == n - 1", "0 <= edges[i][0], edges[i][1] <= n - 1" ] } ], "unchecked_constraints": [ "edges represents a valid tree." ], "public_tests": 2, "hints": [ "Consider all divisors of the sum of values." ] }, { "question_id": 2441, "task_id": "largest-positive-integer-that-exists-with-its-negative", "drop": [], "similar": [ "two-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 116, "kept": 112, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "nums[i] != 0" ] }, { "line": 59, "end_line": 59, "violates": [ "nums[i] != 0" ] }, { "line": 71, "end_line": 71, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 115, "end_line": 115, "violates": [ "nums[i] != 0" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "What data structure can help you to determine if an element exists?", "Would a hash table help?" ] }, { "question_id": 2442, "task_id": "count-number-of-distinct-integers-after-reverse-operations", "drop": [], "similar": [ "reverse-integer" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 103, "kept": 97, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What data structure allows us to insert numbers and find the number of distinct numbers in it?", "Try using a set, insert all the numbers and their reverse into it, and return its size." ] }, { "question_id": 2443, "task_id": "sum-of-number-and-its-reverse", "drop": [], "similar": [ "sum-of-numbers-with-units-digit-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 177, "kept": 159, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 107, "end_line": 107, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 122, "end_line": 122, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 139, "end_line": 139, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 140, "end_line": 140, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 143, "end_line": 143, "violates": [ "0 <= num <= 10**(5)" ] }, { "line": 146, "end_line": 146, "violates": [ "0 <= num <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The constraints are small enough that we can check every number.", "To reverse a number, first convert it to a string. Then, create a new string that is the reverse of the first one. Finally, convert the new string back into a number." ] }, { "question_id": 2444, "task_id": "count-subarrays-with-fixed-bounds", "drop": [], "similar": [ "count-number-of-nice-subarrays", "longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit", "find-the-number-of-subarrays-where-boundary-elements-are-maximum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "minK", "maxK" ], "tests": { "total": 116, "kept": 115, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= nums[i], minK, maxK <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can you solve the problem if all the numbers in the array were between minK and maxK inclusive?", "Think of the inclusion-exclusion principle.", "Divide the array into multiple subarrays such that each number in each subarray is between minK and maxK inclusive, solve the previous problem for each subarray, and sum all the answers." ] }, { "question_id": 2445, "task_id": "number-of-nodes-with-value-one", "drop": [ "premium" ] }, { "question_id": 2446, "task_id": "determine-if-two-events-have-conflict", "drop": [], "similar": [ "merge-intervals", "non-overlapping-intervals", "my-calendar-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "event1", "event2" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "startTime1 <= endTime1", "startTime2 <= endTime2", "All the event times follow the HH:MM format." ], "public_tests": 3, "hints": [ "Parse time format to some integer interval first", "How would you determine if two intervals overlap?" ] }, { "question_id": 2447, "task_id": "number-of-subarrays-with-gcd-equal-to-k", "drop": [], "similar": [ "find-greatest-common-divisor-of-array", "number-of-subarrays-with-lcm-equal-to-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 124, "kept": 123, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i], k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The constraints on nums.length are small. It is possible to check every subarray.", "To calculate GCD, you can use a built-in function or the Euclidean Algorithm." ] }, { "question_id": 2448, "task_id": "minimum-cost-to-make-array-equal", "drop": [], "similar": [ "minimum-moves-to-equal-array-elements-ii", "maximum-product-of-the-length-of-two-palindromic-substrings", "minimum-amount-of-time-to-fill-cups", "minimum-operations-to-make-all-array-elements-equal", "minimum-cost-to-make-array-equalindromic" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "cost" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Test cases are generated in a way that the output doesn't exceed 2**(53)-1" ], "public_tests": 2, "hints": [ "Changing the elements into one of the numbers already existing in the array nums is optimal.", "Try finding the cost of changing the array into each element, and return the minimum value." ] }, { "question_id": 2449, "task_id": "minimum-number-of-operations-to-make-arrays-similar", "drop": [], "similar": [ "minimum-operations-to-make-array-equal", "minimum-operations-to-make-array-equal-ii", "rearranging-fruits" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 107, "kept": 103, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= nums[i], target[i] <= 10**(6)" ] }, { "line": 19, "end_line": 19, "violates": [ "n == nums.length == target.length" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i], target[i] <= 10**(6)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i], target[i] <= 10**(6)" ] } ], "unchecked_constraints": [ "It is possible to make nums similar to target." ], "public_tests": 3, "hints": [ "Solve for even and odd numbers separately.", "Greedily match smallest even element from nums to smallest even element from target, then similarly next smallest element and so on.", "Similarly, match odd elements too." ] }, { "question_id": 2450, "task_id": "number-of-distinct-binary-strings-after-applying-operations", "drop": [ "premium" ] }, { "question_id": 2451, "task_id": "odd-string-difference", "drop": [], "similar": [ "minimum-rounds-to-complete-all-tasks" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 80, "kept": 75, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "n == words[i].length" ] }, { "line": 30, "end_line": 30, "violates": [ "n == words[i].length", "2 <= n <= 20" ] }, { "line": 56, "end_line": 56, "violates": [ "2 <= n <= 20" ] }, { "line": 63, "end_line": 63, "violates": [ "n == words[i].length", "words[i] consists of lowercase English letters." ] }, { "line": 68, "end_line": 68, "violates": [ "n == words[i].length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Find the difference integer array for each string.", "Compare them to find the odd one out." ] }, { "question_id": 2452, "task_id": "words-within-two-edits-of-dictionary", "drop": [], "similar": [ "word-ladder" ], "flags": [], "comparison": "exact", "parameter_names": [ "queries", "dictionary" ], "tests": { "total": 114, "kept": 73, "dropped": { "constraint_violation": 41 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 19, "end_line": 19, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 20, "end_line": 20, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 23, "end_line": 23, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 24, "end_line": 24, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 25, "end_line": 25, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 26, "end_line": 26, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 27, "end_line": 27, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 33, "end_line": 33, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 36, "end_line": 36, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 40, "end_line": 40, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 41, "end_line": 41, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 43, "end_line": 43, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 46, "end_line": 46, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 47, "end_line": 47, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 51, "end_line": 51, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 54, "end_line": 54, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 55, "end_line": 55, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 56, "end_line": 56, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 58, "end_line": 58, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 60, "end_line": 60, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 61, "end_line": 61, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 63, "end_line": 63, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 64, "end_line": 64, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 65, "end_line": 65, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 70, "end_line": 70, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 71, "end_line": 71, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 74, "end_line": 74, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 75, "end_line": 75, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 77, "end_line": 77, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 79, "end_line": 79, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 86, "end_line": 86, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 92, "end_line": 92, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 94, "end_line": 94, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 102, "end_line": 102, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 103, "end_line": 103, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 104, "end_line": 104, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 108, "end_line": 108, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 110, "end_line": 110, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 112, "end_line": 112, "violates": [ "n == queries[i].length == dictionary[j].length" ] }, { "line": 115, "end_line": 115, "violates": [ "n == queries[i].length == dictionary[j].length" ] } ], "unchecked_constraints": [ "All queries[i] and dictionary[j] are composed of lowercase English letters." ], "public_tests": 2, "hints": [ "Try brute-forcing the problem.", "For each word in queries, try comparing to each word in dictionary.", "If there is a maximum of two edit differences, the word should be present in answer." ] }, { "question_id": 2453, "task_id": "destroy-sequential-targets", "drop": [], "similar": [ "arithmetic-slices-ii-subsequence", "pairs-of-songs-with-total-durations-divisible-by-60", "longest-arithmetic-subsequence", "longest-arithmetic-subsequence-of-given-difference" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "space" ], "tests": { "total": 127, "kept": 124, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Keep track of nums[i] modulo k.", "Iterate over nums in sorted order." ] }, { "question_id": 2454, "task_id": "next-greater-element-iv", "drop": [], "similar": [ "next-greater-element-i", "replace-elements-with-greatest-element-on-right-side", "apply-operations-to-maximize-score" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 224, "kept": 224, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Move forward in nums and store the value in a non-increasing stack for the first greater value.", "Move the value in the stack to an ordered data structure for the second greater value.", "Move value from the ordered data structure for the answer." ] }, { "question_id": 2455, "task_id": "average-value-of-even-numbers-that-are-divisible-by-three", "drop": [], "similar": [ "binary-prefix-divisible-by-5" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 124, "kept": 112, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 125, "end_line": 125, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What is the property of a number if it is divisible by both 2 and 3 at the same time?", "It is equivalent to finding all the numbers that are divisible by 6." ] }, { "question_id": 2456, "task_id": "most-popular-video-creator", "drop": [], "similar": [ "design-video-sharing-platform", "design-a-food-rating-system" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "creators", "ids", "views" ], "tests": { "total": 102, "kept": 60, "dropped": { "constraint_violation": 42 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= creators[i].length, ids[i].length <= 5", "creators[i] and ids[i] consist only of lowercase English letters." ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= creators[i].length, ids[i].length <= 5", "creators[i] and ids[i] consist only of lowercase English letters." ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 41, "end_line": 41, "violates": [ "creators[i] and ids[i] consist only of lowercase English letters." ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 48, "end_line": 48, "violates": [ "creators[i] and ids[i] consist only of lowercase English letters." ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= creators[i].length, ids[i].length <= 5", "creators[i] and ids[i] consist only of lowercase English letters." ] }, { "line": 77, "end_line": 77, "violates": [ "creators[i] and ids[i] consist only of lowercase English letters." ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= creators[i].length, ids[i].length <= 5", "creators[i] and ids[i] consist only of lowercase English letters." ] }, { "line": 80, "end_line": 80, "violates": [ "creators[i] and ids[i] consist only of lowercase English letters." ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= creators[i].length, ids[i].length <= 5", "creators[i] and ids[i] consist only of lowercase English letters." ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= creators[i].length, ids[i].length <= 5" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a hash table to store and categorize videos based on their creator.", "For each creator, iterate through all their videos and use three variables to keep track of their popularity, their most popular video, and the id of their most popular video." ] }, { "question_id": 2457, "task_id": "minimum-addition-to-make-integer-beautiful", "drop": [], "similar": [ "happy-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "target" ], "tests": { "total": 103, "kept": 66, "dropped": { "constraint_violation": 37 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= n <= 10**(12)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= n <= 10**(12)" ] } ], "unchecked_constraints": [ "The input will be generated such that it is always possible to make n beautiful." ], "public_tests": 3, "hints": [ "Think about each digit independently.", "Turn the rightmost non-zero digit to zero until the digit sum is greater than target." ] }, { "question_id": 2458, "task_id": "height-of-binary-tree-after-subtree-removal-queries", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "maximum-depth-of-binary-tree" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "root", "queries" ], "tests": { "total": 41, "kept": 0, "dropped": { "unreadable": 41 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is n.", "2 <= n <= 10**(5)", "1 <= Node.val <= n", "All the values in the tree are unique.", "1 <= m <= min(n, 10**(4))", "1 <= queries[i] <= n", "queries[i] != root.val" ] }, { "question_id": 2459, "task_id": "sort-array-by-moving-items-to-empty-space", "drop": [ "premium" ] }, { "question_id": 2460, "task_id": "apply-operations-to-an-array", "drop": [], "similar": [ "remove-duplicates-from-sorted-array", "move-zeroes" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 123, "kept": 123, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate over the array and simulate the described process." ] }, { "question_id": 2461, "task_id": "maximum-sum-of-distinct-subarrays-with-length-k", "drop": [], "similar": [ "max-consecutive-ones-iii", "longest-nice-subarray", "optimal-partition-of-string", "count-the-number-of-good-subarrays", "maximum-good-subarray-sum", "find-the-power-of-k-size-subarrays-i", "find-the-power-of-k-size-subarrays-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 102, "kept": 99, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Which elements change when moving from the subarray of size k that ends at index i to the subarray of size k that ends at index i + 1?", "Only two elements change, the element at i + 1 is added into the subarray, and the element at i - k + 1 gets removed from the subarray.", "Iterate through each subarray of size k and keep track of the sum of the subarray and the frequency of each element." ], "similar_to_test": [ "3254 find-the-power-of-k-size-subarrays-i", "3255 find-the-power-of-k-size-subarrays-ii" ] }, { "question_id": 2462, "task_id": "total-cost-to-hire-k-workers", "drop": [], "similar": [ "meeting-rooms-ii", "time-to-cross-a-bridge" ], "flags": [], "comparison": "exact", "parameter_names": [ "costs", "k", "candidates" ], "tests": { "total": 99, "kept": 97, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 72, "end_line": 72, "violates": [ "1 <= costs[i] <= 10**(5)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= costs[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Maintain two minheaps: one for the left and one for the right.", "Compare the top element from two heaps and remove the appropriate one.", "Add a new element to the heap and maintain its size as k." ] }, { "question_id": 2463, "task_id": "minimum-total-distance-traveled", "drop": [], "similar": [ "capacity-to-ship-packages-within-d-days", "number-of-ways-to-earn-points" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "robot", "factory" ], "tests": { "total": 100, "kept": 90, "dropped": { "non_finite": 10 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 28, "end_line": 28, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 30, "end_line": 30, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 31, "end_line": 31, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 36, "end_line": 36, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 49, "end_line": 49, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 54, "end_line": 54, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 60, "end_line": 60, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 62, "end_line": 62, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 76, "end_line": 76, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] } ], "unchecked_constraints": [ "-10**(9) <= robot[i], positionj <= 10**(9)", "0 <= limitj <= robot.length", "The input will be generated such that it is always possible to repair every robot." ], "public_tests": 2, "hints": [ "Sort robots and factories by their positions.", "After sorting, notice that each factory should repair some subsegment of robots.", "Find the minimum total distance to repair first i robots with first j factories." ] }, { "question_id": 2464, "task_id": "minimum-subarrays-in-a-valid-split", "drop": [ "premium" ] }, { "question_id": 2465, "task_id": "number-of-distinct-averages", "drop": [], "similar": [ "two-sum", "finding-pairs-with-a-certain-sum", "minimum-average-of-smallest-and-largest-elements" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 113, "kept": 107, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "nums.length is even." ] }, { "line": 34, "end_line": 34, "violates": [ "nums.length is even." ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= nums[i] <= 100" ] }, { "line": 79, "end_line": 79, "violates": [ "nums.length is even." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try sorting the array.", "Store the averages being calculated, and find the distinct ones." ] }, { "question_id": 2466, "task_id": "count-ways-to-build-good-strings", "drop": [], "similar": [ "climbing-stairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "low", "high", "zero", "one" ], "tests": { "total": 45, "kept": 40, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= zero, one <= low" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= zero, one <= low" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= zero, one <= low" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= zero, one <= low" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= zero, one <= low" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Calculate the number of good strings with length less or equal to some constant x.", "Apply dynamic programming using the group size of consecutive zeros and ones." ] }, { "question_id": 2467, "task_id": "most-profitable-path-in-a-tree", "drop": [], "similar": [ "snakes-and-ladders", "time-taken-to-mark-all-nodes" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges", "bob", "amount" ], "tests": { "total": 50, "kept": 39, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "amount.length == n" ] }, { "line": 16, "end_line": 16, "violates": [ "amount.length == n" ] }, { "line": 21, "end_line": 21, "violates": [ "amount.length == n" ] }, { "line": 25, "end_line": 25, "violates": [ "amount.length == n" ] }, { "line": 26, "end_line": 26, "violates": [ "amount.length == n" ] }, { "line": 27, "end_line": 27, "violates": [ "amount.length == n" ] }, { "line": 29, "end_line": 29, "violates": [ "amount.length == n" ] }, { "line": 32, "end_line": 32, "violates": [ "amount.length == n" ] }, { "line": 35, "end_line": 35, "violates": [ "amount.length == n" ] }, { "line": 43, "end_line": 43, "violates": [ "amount.length == n" ] }, { "line": 46, "end_line": 46, "violates": [ "amount.length == n" ] } ], "unchecked_constraints": [ "edges represents a valid tree.", "amount[i] is an even integer in the range [-10**(4), 10**(4)]." ], "public_tests": 2, "hints": [ "Bob travels along a fixed path (from node \u201cbob\u201d to node 0).", "Calculate Alice\u2019s distance to each node via DFS.", "We can calculate Alice\u2019s score along a path ending at some node easily using Hints 1 and 2." ] }, { "question_id": 2468, "task_id": "split-message-based-on-limit", "drop": [], "similar": [ "text-justification", "search-a-2d-matrix", "sentence-screen-fitting" ], "flags": [], "comparison": "exact", "parameter_names": [ "message", "limit" ], "tests": { "total": 81, "kept": 69, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "message consists only of lowercase English letters and ' '." ] }, { "line": 24, "end_line": 24, "violates": [ "message consists only of lowercase English letters and ' '." ] }, { "line": 28, "end_line": 28, "violates": [ "message consists only of lowercase English letters and ' '." ] }, { "line": 40, "end_line": 40, "violates": [ "message consists only of lowercase English letters and ' '." ] }, { "line": 42, "end_line": 42, "violates": [ "message consists only of lowercase English letters and ' '." ] }, { "line": 47, "end_line": 47, "violates": [ "message consists only of lowercase English letters and ' '." ] }, { "line": 48, "end_line": 48, "violates": [ "message consists only of lowercase English letters and ' '." ] }, { "line": 49, "end_line": 49, "violates": [ "message consists only of lowercase English letters and ' '." ] }, { "line": 53, "end_line": 53, "violates": [ "message consists only of lowercase English letters and ' '." ] }, { "line": 67, "end_line": 67, "violates": [ "message consists only of lowercase English letters and ' '." ] }, { "line": 74, "end_line": 74, "violates": [ "message consists only of lowercase English letters and ' '." ] }, { "line": 81, "end_line": 81, "violates": [ "message consists only of lowercase English letters and ' '." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Could you solve the problem if you knew how many digits the total number of parts has?", "Try all possible lengths of the total number of parts, and see if the string can be split such that the total number of parts has that length.", "Binary search can be used for each part length to find the precise number of parts needed." ] }, { "question_id": 2469, "task_id": "convert-the-temperature", "drop": [], "similar": [ "smallest-even-multiple" ], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "celsius" ], "tests": { "total": 39, "kept": 38, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "0 <= celsius <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Implement formulas that are given in the statement." ] }, { "question_id": 2470, "task_id": "number-of-subarrays-with-lcm-equal-to-k", "drop": [], "similar": [ "number-of-subarrays-with-gcd-equal-to-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 128, "kept": 105, "dropped": { "constraint_violation": 23 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= nums[i], k <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The constraints on nums.length are small. It is possible to check every subarray.", "To calculate LCM, you can use a built-in function or the formula lcm(a, b) = a * b / gcd(a, b).", "As you calculate the LCM of more numbers, it can only become greater. Once it becomes greater than k, you know that any larger subarrays containing all the current elements will not work." ] }, { "question_id": 2471, "task_id": "minimum-number-of-operations-to-sort-a-binary-tree-by-level", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-level-order-traversal", "longest-cycle-in-a-graph" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 96, "kept": 0, "dropped": { "unreadable": 96 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true }, { "line": 67, "end_line": 67, "unreadable": true }, { "line": 68, "end_line": 68, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 70, "end_line": 70, "unreadable": true }, { "line": 71, "end_line": 71, "unreadable": true }, { "line": 72, "end_line": 72, "unreadable": true }, { "line": 73, "end_line": 73, "unreadable": true }, { "line": 74, "end_line": 74, "unreadable": true }, { "line": 75, "end_line": 75, "unreadable": true }, { "line": 76, "end_line": 76, "unreadable": true }, { "line": 77, "end_line": 77, "unreadable": true }, { "line": 78, "end_line": 78, "unreadable": true }, { "line": 79, "end_line": 79, "unreadable": true }, { "line": 80, "end_line": 80, "unreadable": true }, { "line": 81, "end_line": 81, "unreadable": true }, { "line": 82, "end_line": 82, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true }, { "line": 84, "end_line": 84, "unreadable": true }, { "line": 85, "end_line": 85, "unreadable": true }, { "line": 86, "end_line": 86, "unreadable": true }, { "line": 87, "end_line": 87, "unreadable": true }, { "line": 88, "end_line": 88, "unreadable": true }, { "line": 89, "end_line": 89, "unreadable": true }, { "line": 90, "end_line": 90, "unreadable": true }, { "line": 91, "end_line": 91, "unreadable": true }, { "line": 92, "end_line": 92, "unreadable": true }, { "line": 93, "end_line": 93, "unreadable": true }, { "line": 94, "end_line": 94, "unreadable": true }, { "line": 95, "end_line": 95, "unreadable": true }, { "line": 96, "end_line": 96, "unreadable": true }, { "line": 97, "end_line": 97, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(5)].", "1 <= Node.val <= 10**(5)", "All the values of the tree are unique." ] }, { "question_id": 2472, "task_id": "maximum-number-of-non-overlapping-palindrome-substrings", "drop": [], "similar": [ "longest-palindromic-substring", "palindrome-partitioning", "palindrome-partitioning-ii", "palindrome-partitioning-iii", "maximum-number-of-non-overlapping-substrings", "palindrome-partitioning-iv" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 109, "kept": 108, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= k <= s.length <= 2000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to use dynamic programming to solve the problem.", "let dp[i] be the answer for the prefix s[0\u2026i].", "The final answer to the problem will be dp[n-1]. How do you compute this dp?" ] }, { "question_id": 2473, "task_id": "minimum-cost-to-buy-apples", "drop": [ "premium" ] }, { "question_id": 2475, "task_id": "number-of-unequal-triplets-in-array", "drop": [], "similar": [ "count-good-triplets", "count-square-sum-triples", "number-of-arithmetic-triplets" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 74, "kept": 72, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The constraints are very small. Can we try every triplet?", "Yes, we can. Use three loops to iterate through all the possible triplets, ensuring the condition i < j < k holds." ] }, { "question_id": 2476, "task_id": "closest-nodes-queries-in-a-binary-search-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "closest-binary-search-tree-value", "closest-binary-search-tree-value-ii", "search-in-a-binary-search-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "queries" ], "tests": { "total": 65, "kept": 0, "dropped": { "unreadable": 65 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true }, { "line": 47, "end_line": 47, "unreadable": true }, { "line": 48, "end_line": 48, "unreadable": true }, { "line": 49, "end_line": 49, "unreadable": true }, { "line": 50, "end_line": 50, "unreadable": true }, { "line": 51, "end_line": 51, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 53, "end_line": 53, "unreadable": true }, { "line": 54, "end_line": 54, "unreadable": true }, { "line": 55, "end_line": 55, "unreadable": true }, { "line": 56, "end_line": 56, "unreadable": true }, { "line": 57, "end_line": 57, "unreadable": true }, { "line": 58, "end_line": 58, "unreadable": true }, { "line": 59, "end_line": 59, "unreadable": true }, { "line": 60, "end_line": 60, "unreadable": true }, { "line": 61, "end_line": 61, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 63, "end_line": 63, "unreadable": true }, { "line": 64, "end_line": 64, "unreadable": true }, { "line": 65, "end_line": 65, "unreadable": true }, { "line": 66, "end_line": 66, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is in the range [2, 10**(5)].", "1 <= Node.val <= 10**(6)" ] }, { "question_id": 2477, "task_id": "minimum-fuel-cost-to-report-to-the-capital", "drop": [], "similar": [ "binary-tree-postorder-traversal" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "roads", "seats" ], "tests": { "total": 65, "kept": 65, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "roads represents a valid tree." ], "public_tests": 3, "hints": [ "Can you record the size of each subtree?", "If n people meet on the same node, what is the minimum number of cars needed?" ] }, { "question_id": 2478, "task_id": "number-of-beautiful-partitions", "drop": [], "similar": [ "restore-the-array", "number-of-ways-to-separate-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k", "minLength" ], "tests": { "total": 117, "kept": 117, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try using a greedy approach where you take as many digits as possible from the left of the string for each partition.", "You can also use a dynamic programming approach, let an array dp where dp[i] is the solution of the problem for the prefix of the string ending at index i, the answer of the problem will be dp[n-1]. What are the transitions of this dp?" ] }, { "question_id": 2479, "task_id": "maximum-xor-of-two-non-overlapping-subtrees", "drop": [ "premium" ] }, { "question_id": 2481, "task_id": "minimum-cuts-to-divide-a-circle", "drop": [], "similar": [ "smallest-even-multiple", "count-total-number-of-colored-cells" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 44, "kept": 44, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Think about odd and even values separately.", "When will we not have to cut the circle at all?" ] }, { "question_id": 2482, "task_id": "difference-between-ones-and-zeros-in-row-and-column", "drop": [], "similar": [ "01-matrix", "special-positions-in-a-binary-matrix", "remove-all-ones-with-row-and-column-flips", "first-completely-painted-row-or-column" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 67, "kept": 67, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "You need to reuse information about a row or a column many times. Try storing it to avoid computing it multiple times.", "Use an array to store the number of 1\u2019s in each row and another array to store the number of 1\u2019s in each column. Once you know the number of 1\u2019s in each row or column, you can also easily calculate the number of 0\u2019s." ] }, { "question_id": 2483, "task_id": "minimum-penalty-for-a-shop", "drop": [], "similar": [ "grid-game", "minimum-amount-of-damage-dealt-to-bob" ], "flags": [], "comparison": "exact", "parameter_names": [ "customers" ], "tests": { "total": 152, "kept": 152, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "At any index, the penalty is the sum of prefix count of \u2018N\u2019 and suffix count of \u2018Y\u2019.", "Enumerate all indices and find the minimum such value." ], "similar_to_test": [ "3273 minimum-amount-of-damage-dealt-to-bob" ] }, { "question_id": 2484, "task_id": "count-palindromic-subsequences", "drop": [], "similar": [ "arithmetic-slices-ii-subsequence", "count-different-palindromic-subsequences", "unique-length-3-palindromic-subsequences" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 149, "kept": 149, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "There are 100 possibilities for the first two characters of the palindrome.", "Iterate over all characters, letting the current character be the center of the palindrome." ] }, { "question_id": 2485, "task_id": "find-the-pivot-integer", "drop": [], "similar": [ "bulb-switcher" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 52, "kept": 52, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can you use brute force to check every number from 1 to n if any of them is the pivot integer?", "If you know the sum of [1: pivot], how can you efficiently calculate the sum of the other parts?" ] }, { "question_id": 2486, "task_id": "append-characters-to-string-to-make-subsequence", "drop": [], "similar": [ "is-subsequence", "minimum-operations-to-make-a-subsequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 153, "kept": 146, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= s.length, t.length <= 10**(5)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= s.length, t.length <= 10**(5)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= s.length, t.length <= 10**(5)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= s.length, t.length <= 10**(5)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= s.length, t.length <= 10**(5)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= s.length, t.length <= 10**(5)" ] }, { "line": 139, "end_line": 139, "violates": [ "1 <= s.length, t.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the longest prefix of t that is a subsequence of s.", "Use two variables to keep track of your location in s and t. If the characters match, increment both variables. Otherwise, only increment the variable for s.", "The remaining characters in t must be appended to the end of s." ] }, { "question_id": 2487, "task_id": "remove-nodes-from-linked-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "reverse-linked-list", "delete-node-in-a-linked-list", "next-greater-element-i", "delete-nodes-from-linked-list-present-in-array" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of the nodes in the given list is in the range [1, 10**(5)].", "1 <= Node.val <= 10**(5)" ] }, { "question_id": 2488, "task_id": "count-subarrays-with-median-k", "drop": [], "similar": [ "number-of-subarrays-with-bounded-maximum", "number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold", "sum-of-imbalance-numbers-of-all-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 79, "kept": 67, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "1 <= nums[i], k <= n" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i], k <= n" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i], k <= n" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i], k <= n" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i], k <= n" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums[i], k <= n" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i], k <= n" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i], k <= n" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i], k <= n" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i], k <= n" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i], k <= n" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i], k <= n" ] } ], "unchecked_constraints": [ "The integers in nums are distinct." ], "public_tests": 2, "hints": [ "Consider changing the numbers that are strictly greater than k in the array to 1, the numbers that are strictly smaller than k to -1, and k to 0.", "After the change, what property does a subarray with median k have in the new array?", "An array with median k should have a sum equal to either 0 or 1 in the new array and should contain the element k. How do you count such subarrays?" ] }, { "question_id": 2489, "task_id": "number-of-substrings-with-fixed-ratio", "drop": [ "premium" ] }, { "question_id": 2490, "task_id": "circular-sentence", "drop": [], "similar": [ "defuse-the-bomb" ], "flags": [], "comparison": "exact", "parameter_names": [ "sentence" ], "tests": { "total": 220, "kept": 219, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 176, "end_line": 176, "violates": [ "sentence consist of only lowercase and uppercase English letters and spaces." ] } ], "unchecked_constraints": [ "The words in sentence are separated by a single space.", "There are no leading or trailing spaces." ], "public_tests": 3, "hints": [ "Check the character before the empty space and the character after the empty space.", "Check the first character and the last character of the sentence." ] }, { "question_id": 2491, "task_id": "divide-players-into-teams-of-equal-skill", "drop": [], "similar": [ "minimum-moves-to-equal-array-elements", "max-number-of-k-sum-pairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "skill" ], "tests": { "total": 122, "kept": 121, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 122, "end_line": 122, "violates": [ "skill.length is even." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try sorting the skill array.", "It is always optimal to pair the weakest available player with the strongest available player." ] }, { "question_id": 2492, "task_id": "minimum-score-of-a-path-between-two-cities", "drop": [], "similar": [ "checking-existence-of-edge-length-limited-paths", "checking-existence-of-edge-length-limited-paths-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "roads" ], "tests": { "total": 65, "kept": 65, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There are no repeated edges.", "There is at least one path between 1 and n." ], "public_tests": 2, "hints": [ "Can you solve the problem if the whole graph is connected?", "Notice that if the graph is connected, you can always use any edge of the graph in your path.", "How to solve the general problem in a similar way? Remove all the nodes that are not connected to 1 and n, then apply the previous solution in the new graph." ] }, { "question_id": 2493, "task_id": "divide-nodes-into-the-maximum-number-of-groups", "drop": [], "similar": [ "binary-tree-level-order-traversal", "is-graph-bipartite", "shortest-cycle-in-a-graph" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 83, "kept": 83, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There is at most one edge between any pair of vertices." ], "public_tests": 2, "hints": [ "If the graph is not bipartite, it is not possible to group the nodes.", "Notice that we can solve the problem for each connected component independently, and the final answer will be just the sum of the maximum number of groups in each component.", "Finally, to solve the problem for each connected component, we can notice that if for some node v we fix its position to be in the leftmost group, then we can also evaluate the position of every other node. That position is the depth of the node in a bfs tree after rooting at node v." ] }, { "question_id": 2495, "task_id": "number-of-subarrays-having-even-product", "drop": [ "premium" ] }, { "question_id": 2496, "task_id": "maximum-value-of-a-string-in-an-array", "drop": [], "similar": [ "maximum-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "strs" ], "tests": { "total": 109, "kept": 98, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "1 <= strs[i].length <= 9" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= strs[i].length <= 9" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= strs[i].length <= 9" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= strs[i].length <= 9" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= strs[i].length <= 9" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= strs[i].length <= 9" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= strs[i].length <= 9" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= strs[i].length <= 9" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= strs[i].length <= 9" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= strs[i].length <= 9" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= strs[i].length <= 9" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For strings comprising only of digits, convert them into integers.", "For all other strings, calculate their length." ] }, { "question_id": 2497, "task_id": "maximum-star-sum-of-a-graph", "drop": [], "similar": [ "number-of-ways-to-reconstruct-a-tree", "find-center-of-star-graph" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "vals", "edges", "k" ], "tests": { "total": 107, "kept": 101, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "0 <= k <= n - 1", "0 <= k <= n - 1" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= k <= n - 1" ] }, { "line": 55, "end_line": 55, "violates": [ "0 <= k <= n - 1", "0 <= k <= n - 1" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= k <= n - 1" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= k <= n - 1" ] }, { "line": 102, "end_line": 102, "violates": [ "0 <= k <= n - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "A star graph doesn\u2019t necessarily include all of its neighbors.", "For each node, sort its neighbors in descending order and take k max valued neighbors." ] }, { "question_id": 2498, "task_id": "frog-jump-ii", "drop": [], "similar": [ "climbing-stairs", "koko-eating-bananas" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "stones" ], "tests": { "total": 106, "kept": 103, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "0 <= stones[i] <= 10**(9)" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= stones[i] <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= stones[i] <= 10**(9)" ] } ], "unchecked_constraints": [ "stones is sorted in a strictly increasing order." ], "public_tests": 2, "hints": [ "One of the optimal strategies will be to jump to every stone.", "Skipping just one stone in every forward jump and jumping to those skipped stones in backward jump can minimize the maximum jump." ] }, { "question_id": 2499, "task_id": "minimum-total-cost-to-make-arrays-unequal", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 118, "kept": 106, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= nums1[i], nums2[i] <= n" ] }, { "line": 3, "end_line": 3, "violates": [ "1 <= nums1[i], nums2[i] <= n" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= nums1[i], nums2[i] <= n" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums1[i], nums2[i] <= n" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= nums1[i], nums2[i] <= n" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums1[i], nums2[i] <= n" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums1[i], nums2[i] <= n" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums1[i], nums2[i] <= n" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums1[i], nums2[i] <= n" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums1[i], nums2[i] <= n" ] }, { "line": 97, "end_line": 97, "violates": [ "n == nums1.length == nums2.length" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums1[i], nums2[i] <= n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "How can we check which indices of nums1 will be considered for swapping? How to minimize the number of such operations?", "It can be seen that greedily swapping values of indices where nums1[i] == nums2[i] is the most optimal choice. How many values cannot be swapped this way?", "Find which indices we will swap these remaining values with, and if there are enough such indices." ] }, { "question_id": 2500, "task_id": "delete-greatest-value-in-each-row", "drop": [], "similar": [ "equal-row-and-column-pairs" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 93, "kept": 87, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= grid[i][j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate from the first to the last row and if there exist some unmarked cells, take a maximum from them and mark that cell as visited.", "Add a maximum of newly marked cells to answer and repeat that operation until the whole matrix becomes marked." ] }, { "question_id": 2501, "task_id": "longest-square-streak-in-an-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 132, "kept": 24, "dropped": { "constraint_violation": 108 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 5, "end_line": 5, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 11, "end_line": 11, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 13, "end_line": 13, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 14, "end_line": 14, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 16, "end_line": 16, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 20, "end_line": 20, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 21, "end_line": 21, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 22, "end_line": 22, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 23, "end_line": 23, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 24, "end_line": 24, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 25, "end_line": 25, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 26, "end_line": 26, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 27, "end_line": 27, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 28, "end_line": 28, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 29, "end_line": 29, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 31, "end_line": 31, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 32, "end_line": 32, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 33, "end_line": 33, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 35, "end_line": 35, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 36, "end_line": 36, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 37, "end_line": 37, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 39, "end_line": 39, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 40, "end_line": 40, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 41, "end_line": 41, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 43, "end_line": 43, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 44, "end_line": 44, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 45, "end_line": 45, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 46, "end_line": 46, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 47, "end_line": 47, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 48, "end_line": 48, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 49, "end_line": 49, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 50, "end_line": 50, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 51, "end_line": 51, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 52, "end_line": 52, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 54, "end_line": 54, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 55, "end_line": 55, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 56, "end_line": 56, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 57, "end_line": 57, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 58, "end_line": 58, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 59, "end_line": 59, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 61, "end_line": 61, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 62, "end_line": 62, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 63, "end_line": 63, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 64, "end_line": 64, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 65, "end_line": 65, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 66, "end_line": 66, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 67, "end_line": 67, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 68, "end_line": 68, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 69, "end_line": 69, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 70, "end_line": 70, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 71, "end_line": 71, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 72, "end_line": 72, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 73, "end_line": 73, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 76, "end_line": 76, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 77, "end_line": 77, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 78, "end_line": 78, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 79, "end_line": 79, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 80, "end_line": 80, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 81, "end_line": 81, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 82, "end_line": 82, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 83, "end_line": 83, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 84, "end_line": 84, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 85, "end_line": 85, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 92, "end_line": 92, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 93, "end_line": 93, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 94, "end_line": 94, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 95, "end_line": 95, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 96, "end_line": 96, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 97, "end_line": 97, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 98, "end_line": 98, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 99, "end_line": 99, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 100, "end_line": 100, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 101, "end_line": 101, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 102, "end_line": 102, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 103, "end_line": 103, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 104, "end_line": 104, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 105, "end_line": 105, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 106, "end_line": 106, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 107, "end_line": 107, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 109, "end_line": 109, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 110, "end_line": 110, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 111, "end_line": 111, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 112, "end_line": 112, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 113, "end_line": 113, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 114, "end_line": 114, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 115, "end_line": 115, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 116, "end_line": 116, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 117, "end_line": 117, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 118, "end_line": 118, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 119, "end_line": 119, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 120, "end_line": 120, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 121, "end_line": 121, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 122, "end_line": 122, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 123, "end_line": 123, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 124, "end_line": 124, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 125, "end_line": 125, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 126, "end_line": 126, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 127, "end_line": 127, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 128, "end_line": 128, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 129, "end_line": 129, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 130, "end_line": 130, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 131, "end_line": 131, "violates": [ "2 <= nums[i] <= 10**(5)", "2 <= nums[i] <= 10**(5)" ] }, { "line": 132, "end_line": 132, "violates": [ "2 <= nums[i] <= 10**(5)" ] }, { "line": 133, "end_line": 133, "violates": [ "2 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "With the constraints, the length of the longest square streak possible is 5.", "Store the elements of nums in a set to quickly check if it exists." ] }, { "question_id": 2503, "task_id": "maximum-number-of-points-from-grid-queries", "drop": [], "similar": [ "trapping-rain-water-ii", "escape-the-spreading-fire" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid", "queries" ], "tests": { "total": 103, "kept": 95, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "2 <= m, n <= 1000", "4 <= m * n <= 10**(5)", "1 <= grid[i][j], queries[i] <= 10**(6)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= grid[i][j], queries[i] <= 10**(6)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= grid[i][j], queries[i] <= 10**(6)" ] }, { "line": 63, "end_line": 63, "violates": [ "2 <= m, n <= 1000" ] }, { "line": 82, "end_line": 82, "violates": [ "2 <= m, n <= 1000" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= grid[i][j], queries[i] <= 10**(6)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= grid[i][j], queries[i] <= 10**(6)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= grid[i][j], queries[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The queries are all given to you beforehand so you can answer them in any order you want.", "Sort the queries knowing their original order to be able to build the answer array.", "Run a BFS on the graph and answer the queries in increasing order." ] }, { "question_id": 2505, "task_id": "bitwise-or-of-all-subsequence-sums", "drop": [ "premium" ] }, { "question_id": 2506, "task_id": "count-pairs-of-similar-strings", "drop": [], "similar": [ "sort-characters-by-frequency", "count-the-number-of-consistent-strings", "number-of-good-paths" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 101, "kept": 100, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 55, "end_line": 55, "violates": [ "1 <= words.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "How can you check if two strings are similar?", "Use a hashSet to store the character of each string." ] }, { "question_id": 2507, "task_id": "smallest-value-after-replacing-with-sum-of-prime-factors", "drop": [], "similar": [ "happy-number", "2-keys-keyboard", "count-ways-to-make-array-with-product", "distinct-prime-factors-of-product-of-array", "minimum-division-operations-to-make-array-non-decreasing" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 45, "kept": 40, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "2 <= n <= 10**(5)" ] }, { "line": 34, "end_line": 34, "violates": [ "2 <= n <= 10**(5)" ] }, { "line": 40, "end_line": 40, "violates": [ "2 <= n <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "2 <= n <= 10**(5)" ] }, { "line": 45, "end_line": 45, "violates": [ "2 <= n <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Every time you replace n, it will become smaller until it is a prime number, where it will keep the same value each time you replace it.", "n decreases logarithmically, allowing you to simulate the process.", "To find the prime factors, iterate through all numbers less than n from least to greatest and find the maximum number of times each number divides n." ], "similar_to_test": [ "3326 minimum-division-operations-to-make-array-non-decreasing" ] }, { "question_id": 2508, "task_id": "add-edges-to-make-degrees-of-all-nodes-even", "drop": [], "similar": [ "minimum-degree-of-a-connected-trio-in-a-graph" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 82, "kept": 82, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There are no repeated edges." ], "public_tests": 3, "hints": [ "Notice that each edge that we add changes the degree of exactly 2 nodes.", "The number of nodes with an odd degree in the original graph should be either 0, 2, or 4. Try to work on each of these cases." ] }, { "question_id": 2509, "task_id": "cycle-length-queries-in-a-tree", "drop": [], "similar": [ "populating-next-right-pointers-in-each-node", "lowest-common-ancestor-of-a-binary-tree", "path-in-zigzag-labelled-binary-tree" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "queries" ], "tests": { "total": 70, "kept": 51, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "ai != bi" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= ai, bi <= 2**(n) - 1" ] }, { "line": 18, "end_line": 18, "violates": [ "ai != bi" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= ai, bi <= 2**(n) - 1", "ai != bi" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= ai, bi <= 2**(n) - 1" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= ai, bi <= 2**(n) - 1" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= ai, bi <= 2**(n) - 1" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= ai, bi <= 2**(n) - 1" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= ai, bi <= 2**(n) - 1" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= ai, bi <= 2**(n) - 1" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= ai, bi <= 2**(n) - 1" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= ai, bi <= 2**(n) - 1" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= ai, bi <= 2**(n) - 1" ] }, { "line": 49, "end_line": 49, "violates": [ "ai != bi" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= ai, bi <= 2**(n) - 1" ] }, { "line": 52, "end_line": 52, "violates": [ "ai != bi" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= ai, bi <= 2**(n) - 1" ] }, { "line": 60, "end_line": 60, "violates": [ "ai != bi" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= ai, bi <= 2**(n) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Find the distance between nodes \u201ca\u201d and \u201cb\u201d.", "distance(a, b) = depth(a) + depth(b) - 2 * depth(LCA(a, b)). Where depth(a) denotes depth from root to node \u201ca\u201d and LCA(a, b) denotes the lowest common ancestor of nodes \u201ca\u201d and \u201cb\u201d.", "To find LCA(a, b), iterate over all ancestors of node \u201ca\u201d and check if it is the ancestor of node \u201cb\u201d too. If so, take the one with maximum depth." ] }, { "question_id": 2510, "task_id": "check-if-there-is-a-path-with-equal-number-of-0s-and-1s", "drop": [ "premium" ] }, { "question_id": 2511, "task_id": "maximum-enemy-forts-that-can-be-captured", "drop": [], "similar": [ "max-consecutive-ones", "max-consecutive-ones-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "forts" ], "tests": { "total": 100, "kept": 100, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each fort under your command, check if you can move the army from here.", "If yes, find the closest empty positions satisfying all criteria.", "How can two-pointers be used to solve this problem optimally?" ] }, { "question_id": 2512, "task_id": "reward-top-k-students", "drop": [], "similar": [ "queue-reconstruction-by-height", "k-highest-ranked-items-within-a-price-range" ], "flags": [], "comparison": "exact", "parameter_names": [ "positive_feedback", "negative_feedback", "report", "student_id", "k" ], "tests": { "total": 82, "kept": 81, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 80, "end_line": 80, "violates": [ "report[i] consists of lowercase English letters and spaces ' '." ] } ], "unchecked_constraints": [ "Both positive_feedback[i] and negative_feedback[j] consists of lowercase English letters.", "No word is present in both positive_feedback and negative_feedback.", "There is a single space between consecutive words of report[i]." ], "public_tests": 2, "hints": [ "Hash the positive and negative feedback words separately.", "Calculate the points for each student\u2019s feedback.", "Sort the students accordingly to find the top k among them." ] }, { "question_id": 2513, "task_id": "minimize-the-maximum-of-two-arrays", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "divisor1", "divisor2", "uniqueCnt1", "uniqueCnt2" ], "tests": { "total": 108, "kept": 101, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "2 <= divisor1, divisor2 <= 10**(5)" ] }, { "line": 44, "end_line": 44, "violates": [ "2 <= uniqueCnt1 + uniqueCnt2 <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "2 <= divisor1, divisor2 <= 10**(5)" ] }, { "line": 65, "end_line": 65, "violates": [ "2 <= divisor1, divisor2 <= 10**(5)" ] }, { "line": 79, "end_line": 79, "violates": [ "2 <= divisor1, divisor2 <= 10**(5)" ] }, { "line": 97, "end_line": 97, "violates": [ "2 <= divisor1, divisor2 <= 10**(5)" ] }, { "line": 98, "end_line": 98, "violates": [ "2 <= divisor1, divisor2 <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use binary search to find smallest maximum element.", "Add numbers divisible by x in nums2 and vice versa." ] }, { "question_id": 2515, "task_id": "shortest-distance-to-target-string-in-a-circular-array", "drop": [], "similar": [ "defuse-the-bomb" ], "flags": [], "comparison": "exact", "parameter_names": [ "words", "target", "startIndex" ], "tests": { "total": 247, "kept": 242, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 66, "end_line": 66, "violates": [ "words[i] and target consist of only lowercase English letters." ] }, { "line": 156, "end_line": 156, "violates": [ "words[i] and target consist of only lowercase English letters." ] }, { "line": 160, "end_line": 160, "violates": [ "words[i] and target consist of only lowercase English letters." ] }, { "line": 201, "end_line": 201, "violates": [ "words[i] and target consist of only lowercase English letters." ] }, { "line": 248, "end_line": 248, "violates": [ "words[i] and target consist of only lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "You have two options, either move straight to the left or move straight to the right.", "Find the first target word and record the distance.", "Choose the one with the minimum distance." ] }, { "question_id": 2516, "task_id": "take-k-of-each-character-from-left-and-right", "drop": [], "similar": [ "merge-sorted-array", "reorder-list", "defuse-the-bomb" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 129, "kept": 128, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= s.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Start by counting the frequency of each character and checking if it is possible.", "If you take x characters from the left side, what is the minimum number of characters you need to take from the right side? Find this for all values of x in the range 0 \u2264 x \u2264 s.length.", "Use a two-pointers approach to avoid computing the same information multiple times." ] }, { "question_id": 2517, "task_id": "maximum-tastiness-of-candy-basket", "drop": [], "similar": [ "container-with-most-water", "sliding-window-maximum" ], "flags": [], "comparison": "exact", "parameter_names": [ "price", "k" ], "tests": { "total": 81, "kept": 80, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 40, "end_line": 40, "violates": [ "1 <= price[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The answer is binary searchable.", "For some x, we can use a greedy strategy to check if it is possible to pick k distinct candies with tastiness being at least x.", "Sort prices and iterate from left to right. For some price[i] check if the price difference between the last taken candy and price[i] is at least x. If so, add the candy i to the basket.", "So, a candy basket with tastiness x can be achieved if the basket size is bigger than or equal to k." ] }, { "question_id": 2518, "task_id": "number-of-great-partitions", "drop": [], "similar": [ "palindrome-partitioning-ii", "partition-equal-subset-sum", "find-the-punishment-number-of-an-integer", "count-partitions-with-max-min-difference-at-most-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 101, "kept": 71, "dropped": { "constraint_violation": 30 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums.length, k <= 1000", "1 <= nums.length, k <= 1000" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums.length, k <= 1000" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums.length, k <= 1000", "1 <= nums.length, k <= 1000" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums.length, k <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If the sum of the array is smaller than 2*k, then it is impossible to find a great partition.", "Solve the reverse problem, that is, find the number of partitions where the sum of elements of at least one of the two groups is smaller than k." ] }, { "question_id": 2519, "task_id": "count-the-number-of-k-big-indices", "drop": [ "premium" ] }, { "question_id": 2520, "task_id": "count-the-digits-that-divide-a-number", "drop": [], "similar": [ "happy-number", "self-dividing-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 73, "kept": 63, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= num <= 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= num <= 10**(9)" ] } ], "unchecked_constraints": [ "num does not contain 0 as one of its digits." ], "public_tests": 3, "hints": [ "Use mod by 10 to retrieve the least significant digit of the number", "Divide the number by 10, then round it down so that the second least significant digit becomes the least significant digit of the number", "Use your language\u2019s mod operator to see if a number is a divisor of another." ] }, { "question_id": 2521, "task_id": "distinct-prime-factors-of-product-of-array", "drop": [], "similar": [ "2-keys-keyboard", "largest-component-size-by-common-factor", "closest-divisors", "smallest-value-after-replacing-with-sum-of-prime-factors", "count-the-number-of-square-free-subsets" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 115, "kept": 83, "dropped": { "constraint_violation": 32 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 30, "end_line": 30, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 35, "end_line": 35, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 37, "end_line": 37, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 45, "end_line": 45, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 49, "end_line": 49, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 50, "end_line": 50, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 52, "end_line": 52, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 53, "end_line": 53, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 54, "end_line": 54, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 57, "end_line": 57, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 60, "end_line": 60, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 65, "end_line": 65, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 66, "end_line": 66, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 69, "end_line": 69, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 75, "end_line": 75, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 76, "end_line": 76, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 83, "end_line": 83, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 91, "end_line": 91, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 92, "end_line": 92, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 93, "end_line": 93, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 94, "end_line": 94, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 95, "end_line": 95, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 98, "end_line": 98, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 100, "end_line": 100, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 101, "end_line": 101, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 102, "end_line": 102, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 106, "end_line": 106, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 107, "end_line": 107, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 113, "end_line": 113, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 115, "end_line": 115, "violates": [ "2 <= nums[i] <= 1000" ] }, { "line": 116, "end_line": 116, "violates": [ "2 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Do not multiply all the numbers together, as the product is too big to store.", "Think about how each individual number's prime factors contribute to the prime factors of the product of the entire array.", "Find the prime factors of each element in nums, and store all of them in a set to avoid duplicates." ] }, { "question_id": 2522, "task_id": "partition-string-into-substrings-with-values-at-most-k", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s[i] is a digit from '1' to '9'." ], "public_tests": 2, "hints": [] }, { "question_id": 2523, "task_id": "closest-prime-numbers-in-range", "drop": [], "similar": [ "count-ways-to-make-array-with-product" ], "flags": [], "comparison": "exact", "parameter_names": [ "left", "right" ], "tests": { "total": 95, "kept": 87, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= left <= right <= 10**(6)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= left <= right <= 10**(6)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= left <= right <= 10**(6)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= left <= right <= 10**(6)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= left <= right <= 10**(6)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= left <= right <= 10**(6)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= left <= right <= 10**(6)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= left <= right <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use Sieve of Eratosthenes to mark numbers that are primes.", "Iterate from right to left and find pair with the minimum distance between marked numbers." ] }, { "question_id": 2525, "task_id": "categorize-box-according-to-criteria", "drop": [], "similar": [ "fizz-buzz", "find-winner-on-a-tic-tac-toe-game", "best-poker-hand" ], "flags": [], "comparison": "exact", "parameter_names": [ "length", "width", "height", "mass" ], "tests": { "total": 114, "kept": 103, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "1 <= mass <= 10**(3)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= mass <= 10**(3)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= mass <= 10**(3)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= mass <= 10**(3)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= length, width, height <= 10**(5)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= mass <= 10**(3)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= mass <= 10**(3)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= mass <= 10**(3)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= mass <= 10**(3)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= mass <= 10**(3)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= mass <= 10**(3)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use conditional statements to find the right category of the box." ] }, { "question_id": 2527, "task_id": "find-xor-beauty-of-array", "drop": [], "similar": [ "decode-xored-permutation" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 97, "kept": 80, "dropped": { "constraint_violation": 17 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to simplify the given expression.", "Try constructing the answer bit by bit." ] }, { "question_id": 2528, "task_id": "maximize-the-minimum-powered-city", "drop": [], "similar": [ "maximum-number-of-tasks-you-can-assign" ], "flags": [], "comparison": "exact", "parameter_names": [ "stations", "r", "k" ], "tests": { "total": 118, "kept": 118, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Pre calculate the number of stations on each city using Line Sweep.", "Use binary search to maximize the minimum." ] }, { "question_id": 2529, "task_id": "maximum-count-of-positive-integer-and-negative-integer", "drop": [], "similar": [ "binary-search", "count-negative-numbers-in-a-sorted-matrix" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums is sorted in a non-decreasing order." ], "public_tests": 3, "hints": [ "Count how many positive integers and negative integers are in the array.", "Since the array is sorted, can we use the binary search?" ] }, { "question_id": 2530, "task_id": "maximal-score-after-applying-k-operations", "drop": [], "similar": [ "sliding-window-maximum", "remove-stones-to-minimize-the-total" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 89, "kept": 89, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It is always optimal to select the greatest element in the array.", "Use a heap to query for the maximum in O(log n) time." ] }, { "question_id": 2531, "task_id": "make-number-of-distinct-characters-equal", "drop": [], "similar": [ "bulls-and-cows", "buddy-strings", "minimum-swaps-to-make-strings-equal", "check-if-one-string-swap-can-make-strings-equal", "check-if-all-characters-have-equal-number-of-occurrences" ], "flags": [], "comparison": "exact", "parameter_names": [ "word1", "word2" ], "tests": { "total": 119, "kept": 119, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Create a frequency array of the letters of each string.", "There are 26*26 possible pairs of letters to swap. Can we try them all?", "Iterate over all possible pairs of letters and check if swapping them will yield two strings that have the same number of distinct characters. Use the frequency array for the check." ] }, { "question_id": 2532, "task_id": "time-to-cross-a-bridge", "drop": [], "similar": [ "the-latest-time-to-catch-a-bus", "total-cost-to-hire-k-workers" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "k", "time" ], "tests": { "total": 100, "kept": 97, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= lefti, picki, righti, puti <= 1000" ] }, { "line": 55, "end_line": 55, "violates": [ "time.length == k" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= lefti, picki, righti, puti <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try simulating this process.", "We can use a priority queue to query over the least efficient worker." ] }, { "question_id": 2533, "task_id": "number-of-good-binary-strings", "drop": [ "premium" ] }, { "question_id": 2534, "task_id": "time-taken-to-cross-the-door", "drop": [ "premium" ] }, { "question_id": 2535, "task_id": "difference-between-element-sum-and-digit-sum-of-an-array", "drop": [], "similar": [ "add-digits", "minimum-sum-of-four-digit-number-after-splitting-digits" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 99, "kept": 60, "dropped": { "constraint_violation": 39 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= nums[i] <= 2000", "1 <= nums[i] <= 2000" ] }, { "line": 3, "end_line": 3, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= nums[i] <= 2000", "1 <= nums[i] <= 2000" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 2000" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 2000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a simple for loop to iterate each number.", "How you can get the digit for each number?" ] }, { "question_id": 2536, "task_id": "increment-submatrices-by-one", "drop": [], "similar": [ "range-sum-query-2d-mutable", "count-positions-on-street-with-required-brightness" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "queries" ], "tests": { "total": 73, "kept": 73, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "0 <= row1i <= row2i < n", "0 <= col1i <= col2i < n" ], "public_tests": 2, "hints": [ "Imagine each row as a separate array. Instead of updating the whole submatrix together, we can use prefix sum to update each row separately.", "For each query, iterate over the rows i in the range [row1, row2] and add 1 to prefix sum S[i][col1], and subtract 1 from S[i][col2 + 1].", "After doing this operation for all the queries, update each row separately with S[i][j] = S[i][j] + S[i][j - 1]." ] }, { "question_id": 2537, "task_id": "count-the-number-of-good-subarrays", "drop": [], "similar": [ "count-number-of-homogenous-substrings", "maximum-sum-of-distinct-subarrays-with-length-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 116, "kept": 116, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For a fixed index l, try to find the minimum value of index r, such that the subarray is not good", "When a number is added to a subarray, it increases the number of pairs by its previous appearances.", "When a number is removed from the subarray, it decreases the number of pairs by its remaining appearances.", "Maintain 2-pointers l and r such that we can keep in account the number of equal pairs." ] }, { "question_id": 2538, "task_id": "difference-between-maximum-and-minimum-price-sum", "drop": [], "similar": [ "binary-tree-maximum-path-sum" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "price" ], "tests": { "total": 58, "kept": 55, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "price.length == n" ] }, { "line": 36, "end_line": 36, "violates": [ "price.length == n", "1 <= price[i] <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "price.length == n" ] } ], "unchecked_constraints": [ "edges represents a valid tree." ], "public_tests": 2, "hints": [ "The minimum price sum is always the price of a rooted node.", "Let\u2019s root the tree at vertex 0 and find the answer from this perspective.", "In the optimal answer maximum price is the sum of the prices of nodes on the path from \u201cu\u201d to \u201cv\u201d where either \u201cu\u201d or \u201cv\u201d is the parent of the second one or neither is a parent of the second one.", "The first case is easy to find. For the second case, notice that in the optimal path, \u201cu\u201d and \u201cv\u201d are both leaves. Then we can use dynamic programming to find such a path.", "Let DP(v,1) denote \u201cthe maximum price sum from node v to leaf, where v is a parent of that leaf\u201d and let DP(v,0) denote \u201cthe maximum price sum from node v to leaf, where v is a parent of that leaf - price[leaf]\u201d. Then the answer is maximum of DP(u,0) + DP(v,1) + price[parent] where u, v are directly connected to vertex \u201cparent\u201d." ] }, { "question_id": 2540, "task_id": "minimum-common-value", "drop": [], "similar": [ "intersection-of-two-arrays", "intersection-of-two-arrays-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 103, "kept": 102, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 98, "end_line": 98, "violates": [ "1 <= nums1[i], nums2[j] <= 10**(9)" ] } ], "unchecked_constraints": [ "Both nums1 and nums2 are sorted in non-decreasing order." ], "public_tests": 2, "hints": [ "Try to use a set.", "Otherwise, try to use a two-pointer approach." ] }, { "question_id": 2541, "task_id": "minimum-operations-to-make-array-equal-ii", "drop": [], "similar": [ "minimum-operations-to-make-array-equal", "minimum-number-of-operations-to-make-arrays-similar" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "k" ], "tests": { "total": 109, "kept": 101, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "0 <= k <= 10**(5)" ] }, { "line": 22, "end_line": 22, "violates": [ "0 <= k <= 10**(5)" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= k <= 10**(5)" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= nums1[i], nums2[j] <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= k <= 10**(5)" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= k <= 10**(5)" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= k <= 10**(5)" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= nums1[i], nums2[j] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What are the cases for which we cannot make nums1 == nums2?", "For minimum moves, if nums1[i] < nums2[i], then we should never decrement nums1[i]. If nums1[i] > nums2[i], then we should never increment nums1[i]." ] }, { "question_id": 2542, "task_id": "maximum-subsequence-score", "drop": [], "similar": [ "ipo", "minimum-cost-to-hire-k-workers" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "k" ], "tests": { "total": 114, "kept": 114, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How can we use sorting here?", "Try sorting the two arrays based on second array.", "Loop through nums2 and compute the max product given the minimum is nums2[i]. Update the answer accordingly." ] }, { "question_id": 2543, "task_id": "check-if-point-is-reachable", "drop": [], "similar": [ "reaching-points", "check-if-the-rectangle-corner-is-reachable" ], "flags": [], "comparison": "exact", "parameter_names": [ "targetX", "targetY" ], "tests": { "total": 86, "kept": 85, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 65, "end_line": 65, "violates": [ "1 <= targetX, targetY <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let\u2019s go in reverse order, from (targetX, targetY) to (1, 1). So, now we can move from (x, y) to (x+y, y), (x, y+x), (x/2, y) if x is even, and (x, y/2) if y is even.", "When is it optimal to use the third and fourth operations?", "Think how GCD of (x, y) is affected if we apply the first two operations.", "How can we check if we can reach (1, 1) using the GCD value calculate above?" ] }, { "question_id": 2544, "task_id": "alternating-digit-sum", "drop": [], "similar": [ "add-digits", "minimum-sum-of-four-digit-number-after-splitting-digits", "separate-the-digits-in-an-array", "compute-alternating-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 57, "kept": 36, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= n <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= n <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The first step is to loop over the digits. We can convert the integer into a string, an array of digits, or just loop over its digits.", "Keep a variable sign that initially equals 1 and a variable answer that initially equals 0.", "Each time you loop over a digit i, add sign * i to answer, then multiply sign by -1." ] }, { "question_id": 2545, "task_id": "sort-the-students-by-their-kth-score", "drop": [], "similar": [ "erect-the-fence", "custom-sort-string", "sort-the-people", "sort-threats-by-severity-and-exploitability" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "score", "k" ], "tests": { "total": 83, "kept": 80, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 48, "end_line": 48, "violates": [ "1 <= score[i][j] <= 10**(5)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= score[i][j] <= 10**(5)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= score[i][j] <= 10**(5)" ] } ], "unchecked_constraints": [ "score consists of distinct integers." ], "public_tests": 2, "hints": [ "Find the row with the highest score in the kth exam and swap it with the first row.", "After fixing the first row, perform the same operation for the rest of the rows, and the matrix's rows will get sorted one by one." ] }, { "question_id": 2546, "task_id": "apply-bitwise-operations-to-make-strings-equal", "drop": [], "similar": [ "minimum-one-bit-operations-to-make-integers-zero" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "target" ], "tests": { "total": 95, "kept": 95, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Think of when it is impossible to convert the string to the target.", "If exactly one of the strings is having all 0\u2019s, then it is impossible. And it is possible in all other cases. Why is that true?" ] }, { "question_id": 2547, "task_id": "minimum-cost-to-split-an-array", "drop": [], "similar": [ "coin-change", "split-array-largest-sum", "divide-an-array-into-subarrays-with-minimum-cost-ii", "minimum-sum-of-values-by-dividing-array", "minimum-cost-to-divide-array-into-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 122, "kept": 106, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 5, "end_line": 5, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 8, "end_line": 8, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 9, "end_line": 9, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 12, "end_line": 12, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 14, "end_line": 14, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 16, "end_line": 16, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 103, "end_line": 103, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 111, "end_line": 111, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 114, "end_line": 114, "violates": [ "0 <= nums[i] < nums.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let's denote dp[r] = minimum cost to partition the first r elements of nums. What would be the transitions of such dynamic programming?", "dp[r] = min(dp[l] + importance(nums[l..r])) over all 0 <= l < r. This already gives us an O(n^3) approach, as importance can be calculated in linear time, and there are a total of O(n^2) transitions.", "Can you think of a way to compute multiple importance values of related subarrays faster?", "importance(nums[l-1..r]) is either importance(nums[l..r]) if a new unique element is added, importance(nums[l..r]) + 1 if an old element that appeared at least twice is added, or importance(nums[l..r]) + 2, if a previously unique element is duplicated. This allows us to compute importance(nums[l..r]) for all 0 <= l < r in O(n) by keeping a frequency table and decreasing l from r-1 down to 0." ], "similar_to_test": [ "3500 minimum-cost-to-divide-array-into-subarrays" ] }, { "question_id": 2548, "task_id": "maximum-price-to-fill-a-bag", "drop": [ "premium" ] }, { "question_id": 2549, "task_id": "count-distinct-numbers-on-board", "drop": [], "similar": [ "count-of-matches-in-tournament" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 50, "kept": 50, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For n > 2, n % (n - 1) == 1 thus n - 1 will be added on the board the next day.", "As the operations are performed for so long time, all the numbers lesser than n except 1 will be added to the board.", "What will happen if n == 1?" ] }, { "question_id": 2551, "task_id": "put-marbles-in-bags", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "weights", "k" ], "tests": { "total": 87, "kept": 87, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Each bag will contain a subarray, and only the endpoints of these subarrays matter.", "Each subarray only contributes two numbers to the sum. Use this property to choose the subarrays optimally.", "Try to use a priority queue." ] }, { "question_id": 2552, "task_id": "count-increasing-quadruplets", "drop": [], "similar": [ "increasing-triplet-subsequence", "count-special-quadruplets", "count-good-triplets-in-an-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 90, "kept": 84, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= nums.length" ] } ], "unchecked_constraints": [ "All the integers of nums are unique. nums is a permutation." ], "public_tests": 2, "hints": [ "Can you loop over all possible (j, k) and find the answer?", "We can pre-compute all possible (i, j) and (k, l) and store them in 2 matrices.", "The answer will the sum of prefix[j][k] * suffix[k][j]." ] }, { "question_id": 2553, "task_id": "separate-the-digits-in-an-array", "drop": [], "similar": [ "count-integers-with-even-digit-sum", "alternating-digit-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 110, "kept": 53, "dropped": { "constraint_violation": 57 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Convert each number into a list and append that list to the answer.", "You can convert the integer into a string to do that easily." ] }, { "question_id": 2554, "task_id": "maximum-number-of-integers-to-choose-from-a-range-i", "drop": [], "similar": [ "first-missing-positive", "find-all-numbers-disappeared-in-an-array", "append-k-integers-with-minimal-sum", "replace-elements-in-an-array", "maximum-number-of-integers-to-choose-from-a-range-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "banned", "n", "maxSum" ], "tests": { "total": 101, "kept": 97, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= banned.length <= 10**(4)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= banned.length <= 10**(4)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= banned.length <= 10**(4)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= banned.length <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Keep the banned numbers that are less than or equal to n in a set.", "Loop over the numbers from 1 to n and if the number is not banned, use it.", "Keep adding numbers while they are not banned, and their sum is less than or equal to k." ] }, { "question_id": 2555, "task_id": "maximize-win-from-two-segments", "drop": [], "similar": [ "best-time-to-buy-and-sell-stock-iii", "two-best-non-overlapping-events" ], "flags": [], "comparison": "exact", "parameter_names": [ "prizePositions", "k" ], "tests": { "total": 98, "kept": 98, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try solving the problem for one interval.", "Using the solution with one interval, how can you combine that with a second interval?" ] }, { "question_id": 2556, "task_id": "disconnect-path-in-a-binary-matrix-by-at-most-one-flip", "drop": [], "similar": [ "number-of-submatrices-that-sum-to-target", "minimum-cost-to-make-at-least-one-valid-path-in-a-grid", "minimum-number-of-days-to-disconnect-island", "minimum-weighted-subgraph-with-the-required-paths" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 81, "kept": 81, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We can consider the grid a graph with edges between adjacent cells.", "If you can find two non-intersecting paths from (0, 0) to (m - 1, n - 1) then the answer is false. Otherwise, it is always true." ] }, { "question_id": 2557, "task_id": "maximum-number-of-integers-to-choose-from-a-range-ii", "drop": [ "premium" ], "similar_to_test": [ "3464 maximize-the-distance-between-points-on-a-square" ] }, { "question_id": 2558, "task_id": "take-gifts-from-the-richest-pile", "drop": [], "similar": [ "remove-stones-to-minimize-the-total" ], "flags": [], "comparison": "exact", "parameter_names": [ "gifts", "k" ], "tests": { "total": 108, "kept": 107, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 78, "end_line": 78, "violates": [ "1 <= gifts[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How can you keep track of the largest gifts in the array", "What is an efficient way to find the square root of a number?", "Can you keep adding up the values of the gifts while ensuring they are in a certain order?", "Can we use a priority queue or heap here?" ] }, { "question_id": 2559, "task_id": "count-vowel-strings-in-ranges", "drop": [], "similar": [ "jump-game-vii" ], "flags": [], "comparison": "exact", "parameter_names": [ "words", "queries" ], "tests": { "total": 97, "kept": 94, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 62, "end_line": 62, "violates": [ "0 <= li <= ri < words.length" ] }, { "line": 65, "end_line": 65, "violates": [ "words[i] consists only of lowercase English letters." ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= li <= ri < words.length" ] } ], "unchecked_constraints": [ "sum(words[i].length) <= 3 * 10**(5)" ], "public_tests": 2, "hints": [ "Precompute the prefix sum of strings that start and end with vowels.", "Use unordered_set to store vowels.", "Check if the first and last characters of the string are present in the vowels set.", "Subtract prefix sum for range [l-1, r] to find the number of strings starting and ending with vowels." ] }, { "question_id": 2560, "task_id": "house-robber-iv", "drop": [], "similar": [ "container-with-most-water", "house-robber" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 105, "kept": 98, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= k <= (nums.length + 1)/2" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= k <= (nums.length + 1)/2" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= k <= (nums.length + 1)/2" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= k <= (nums.length + 1)/2" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= k <= (nums.length + 1)/2" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use binary search to find the minimum value of a non-contiguous subsequence of a given size k?", "Initialize the search range with the minimum and maximum elements of the input array.", "Use a check function to determine if it is possible to select k non-consecutive elements that are less than or equal to the current \"guess\" value.", "Adjust the search range based on the outcome of the check function, until the range converges and the minimum value is found." ] }, { "question_id": 2561, "task_id": "rearranging-fruits", "drop": [], "similar": [ "the-latest-time-to-catch-a-bus", "minimum-number-of-operations-to-make-arrays-similar" ], "flags": [], "comparison": "exact", "parameter_names": [ "basket1", "basket2" ], "tests": { "total": 109, "kept": 108, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 77, "end_line": 77, "violates": [ "basket1.length == basket2.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Create two frequency maps for both arrays, and find the minimum element among all elements of both arrays.", "Check if the sum of frequencies of an element in both arrays is odd, if so return -1", "Store the elements that need to be swapped in a vector, and sort it.", "Can we reduce swapping cost with the help of minimum element?", "Calculate the minimum cost of swapping." ] }, { "question_id": 2562, "task_id": "find-the-array-concatenation-value", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 120, "kept": 75, "dropped": { "constraint_violation": 45 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 10**(4)", "1 <= nums[i] <= 10**(4)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 10**(4)", "1 <= nums[i] <= 10**(4)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 10**(4)", "1 <= nums[i] <= 10**(4)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= nums[i] <= 10**(4)", "1 <= nums[i] <= 10**(4)" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider simulating the process to calculate the answer", "iterate until the array becomes empty. In each iteration, concatenate the first element to the last element and add their concatenation value to the answer.", "Don\u2019t forget to handle cases when one element is left in the end, not two elements." ] }, { "question_id": 2563, "task_id": "count-the-number-of-fair-pairs", "drop": [], "similar": [ "count-of-range-sum", "finding-pairs-with-a-certain-sum", "count-number-of-pairs-with-absolute-difference-k", "count-pairs-whose-sum-is-less-than-target" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "lower", "upper" ], "tests": { "total": 89, "kept": 83, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "-10**(9) <= lower <= upper <= 10**(9)" ] }, { "line": 26, "end_line": 26, "violates": [ "-10**(9) <= lower <= upper <= 10**(9)" ] }, { "line": 31, "end_line": 31, "violates": [ "-10**(9) <= lower <= upper <= 10**(9)" ] }, { "line": 54, "end_line": 54, "violates": [ "-10**(9) <= lower <= upper <= 10**(9)" ] }, { "line": 61, "end_line": 61, "violates": [ "-10**(9) <= lower <= upper <= 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "-10**(9) <= lower <= upper <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the array in ascending order.", "For each number in the array, keep track of the smallest and largest numbers in the array that can form a fair pair with this number.", "As you move to larger number, both boundaries move down." ] }, { "question_id": 2564, "task_id": "substring-xor-queries", "drop": [], "similar": [ "string-matching-in-an-array" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "s", "queries" ], "tests": { "total": 100, "kept": 100, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "You do not need to consider substrings having lengths greater than 30.", "Pre-process all substrings with lengths not greater than 30, and add the best endpoints to a dictionary." ] }, { "question_id": 2565, "task_id": "subsequence-with-the-minimum-score", "drop": [], "similar": [ "longest-common-subsequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 130, "kept": 129, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "s and t consist of only lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Maintain two pointers: i and j. We need to perform a similar operation: while t[0:i] + t[j:n] is not a subsequence of the string s, increase j.", "We can check the condition greedily. Create the array leftmost[i] which denotes minimum index k, such that in prefix s[0:k] exists subsequence t[0:i]. Similarly, we define rightmost[i].", "If leftmost[i] < rightmost[j] then t[0:i] + t[j:n] is the subsequence of s." ] }, { "question_id": 2566, "task_id": "maximum-difference-by-remapping-a-digit", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 111, "kept": 36, "dropped": { "constraint_violation": 75 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 7, "end_line": 7, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= num <= 10**(8)" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= num <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to remap the first non-nine digit to 9 to obtain the maximum number.", "Try to remap the first non-zero digit to 0 to obtain the minimum number." ] }, { "question_id": 2567, "task_id": "minimum-score-by-changing-two-elements", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 82, "kept": 81, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Changing the minimum or maximum values will only minimize the score.", "Think about what all possible pairs of minimum and maximum values can be changed to form the minimum score." ] }, { "question_id": 2568, "task_id": "minimum-impossible-or", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 108, "kept": 99, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Think about forming numbers in the powers of 2 using their bit representation.", "The minimum power of 2 not present in the array will be the first number that could not be expressed using the given operation." ] }, { "question_id": 2569, "task_id": "handling-sum-queries-after-update", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "queries" ], "tests": { "total": 70, "kept": 70, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums1.length = nums2.length", "queries[i].length = 3", "0 <= l <= r <= nums1.length - 1" ], "public_tests": 2, "hints": [ "Use the Lazy Segment Tree to process the queries quickly." ] }, { "question_id": 2570, "task_id": "merge-two-2d-arrays-by-summing-values", "drop": [], "similar": [ "merge-two-sorted-lists", "meeting-scheduler", "merge-similar-items" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 93, "kept": 93, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Both arrays contain unique ids.", "Both arrays are in strictly ascending order by id." ], "public_tests": 2, "hints": [ "Use a dictionary/hash map to keep track of the indices and their sum values." ] }, { "question_id": 2571, "task_id": "minimum-operations-to-reduce-an-integer-to-0", "drop": [], "similar": [ "plus-one" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 60, "kept": 55, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= n <= 10**(5)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= n <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= n <= 10**(5)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= n <= 10**(5)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= n <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we set/unset the bits in binary representation?", "If there are multiple adjacent ones, how can we optimally add and subtract in 2 operations such that all ones get unset?", "Bonus: Try to solve the problem with higher constraints: n \u2264 10^18." ] }, { "question_id": 2572, "task_id": "count-the-number-of-square-free-subsets", "drop": [], "similar": [ "distinct-prime-factors-of-product-of-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 103, "kept": 57, "dropped": { "constraint_violation": 46 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 7, "end_line": 7, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 30" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "There are 10 primes before number 30.", "Label primes from {2, 3, \u2026 29} with {0,1, \u2026 9} and let DP(i, mask) denote the number of subsets before index: i with the subset of taken primes: mask.", "If the mask and prime factorization of nums[i] have a common prime, then it is impossible to add to the current subset, otherwise, it is possible." ] }, { "question_id": 2573, "task_id": "find-the-string-with-lcp", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "lcp" ], "tests": { "total": 75, "kept": 70, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "0 <= lcp[i][j] <= n" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= lcp[i][j] <= n" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= lcp[i][j] <= n" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= lcp[i][j] <= n" ] }, { "line": 73, "end_line": 73, "violates": [ "0 <= lcp[i][j] <= n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use the LCP array to determine which groups of elements must be equal.", "Match the smallest letter to the group that contains the smallest unassigned index.", "Build the LCP matrix of the resulting string then check if it is equal to the target LCP." ] }, { "question_id": 2574, "task_id": "left-and-right-sum-differences", "drop": [], "similar": [ "find-pivot-index", "find-the-middle-index-in-array", "find-the-distinct-difference-array", "find-the-n-th-value-after-k-seconds" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 131, "kept": 121, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each index i, maintain two variables leftSum and rightSum.", "Iterate on the range j: [0 \u2026 i - 1] and add nums[j] to the leftSum and similarly iterate on the range j: [i + 1 \u2026 nums.length - 1] and add nums[j] to the rightSum." ] }, { "question_id": 2575, "task_id": "find-the-divisibility-array-of-a-string", "drop": [ "too_few_tests" ], "similar": [ "subarray-sums-divisible-by-k", "make-sum-divisible-by-p" ], "flags": [], "comparison": "exact", "parameter_names": [ "word", "m" ], "tests": { "total": 6, "kept": 6, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 2576, "task_id": "find-the-maximum-number-of-marked-indices", "drop": [], "similar": [ "minimum-array-length-after-pair-removals" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 119, "kept": 115, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think about how to check that performing k operations is possible.", "To perform k operations, it\u2019s optimal to use the smallest k elements and the largest k elements and think about how to match them.", "It\u2019s optimal to match the ith smallest number with the k-i + 1 largest number.", "Now we need to binary search on the answer and find the greatest possible valid k." ] }, { "question_id": 2577, "task_id": "minimum-time-to-visit-a-cell-in-a-grid", "drop": [], "similar": [ "find-minimum-time-to-reach-last-room-i", "find-minimum-time-to-reach-last-room-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 114, "kept": 113, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 100, "end_line": 100, "violates": [ "0 <= grid[i][j] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try using some algorithm that can find the shortest paths on a graph.", "Consider the case where you have to go back and forth between two cells of the matrix to unlock some other cells." ], "similar_to_test": [ "3341 find-minimum-time-to-reach-last-room-i", "3342 find-minimum-time-to-reach-last-room-ii" ] }, { "question_id": 2578, "task_id": "split-with-minimum-sum", "drop": [], "similar": [ "partition-equal-subset-sum", "minimum-cost-to-move-chips-to-the-same-position", "partition-array-into-two-arrays-to-minimize-sum-difference", "minimum-sum-of-values-by-dividing-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 98, "kept": 21, "dropped": { "constraint_violation": 77 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 11, "end_line": 11, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 13, "end_line": 13, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 14, "end_line": 14, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 18, "end_line": 18, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 20, "end_line": 20, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 22, "end_line": 22, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 25, "end_line": 25, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 28, "end_line": 28, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 29, "end_line": 29, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 30, "end_line": 30, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 31, "end_line": 31, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 32, "end_line": 32, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 33, "end_line": 33, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 34, "end_line": 34, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 35, "end_line": 35, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 36, "end_line": 36, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 37, "end_line": 37, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 38, "end_line": 38, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 40, "end_line": 40, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 42, "end_line": 42, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 45, "end_line": 45, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 48, "end_line": 48, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 49, "end_line": 49, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 51, "end_line": 51, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 53, "end_line": 53, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 54, "end_line": 54, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 56, "end_line": 56, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 58, "end_line": 58, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 61, "end_line": 61, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 62, "end_line": 62, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 65, "end_line": 65, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 67, "end_line": 67, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 68, "end_line": 68, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 72, "end_line": 72, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 73, "end_line": 73, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 79, "end_line": 79, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 80, "end_line": 80, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 81, "end_line": 81, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 82, "end_line": 82, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 83, "end_line": 83, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 88, "end_line": 88, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 89, "end_line": 89, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 90, "end_line": 90, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 91, "end_line": 91, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 92, "end_line": 92, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 93, "end_line": 93, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 94, "end_line": 94, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 95, "end_line": 95, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 96, "end_line": 96, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 97, "end_line": 97, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 98, "end_line": 98, "violates": [ "10 <= num <= 10**(9)" ] }, { "line": 99, "end_line": 99, "violates": [ "10 <= num <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the digits of num in non decreasing order.", "Assign digits to num1 and num2 alternatively." ] }, { "question_id": 2579, "task_id": "count-total-number-of-colored-cells", "drop": [], "similar": [ "minimum-cuts-to-divide-a-circle" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 37, "kept": 37, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Derive a mathematical relation between total number of colored cells and the time elapsed in minutes." ] }, { "question_id": 2581, "task_id": "count-number-of-possible-root-nodes", "drop": [], "similar": [ "closest-node-to-path-in-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges", "guesses", "k" ], "tests": { "total": 70, "kept": 69, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "0 <= k <= guesses.length" ] } ], "unchecked_constraints": [ "0 <= ai, bi, uj, vj <= n - 1", "uj != vj", "edges represents a valid tree.", "guesses[j] is an edge of the tree.", "guesses is unique." ], "public_tests": 2, "hints": [ "How can we check if any node can be the root?", "Can we use this information to check its neighboring nodes?", "When we traverse from current node to a neighboring node, how will we update our answer?" ] }, { "question_id": 2582, "task_id": "pass-the-pillow", "drop": [], "similar": [ "find-the-student-that-will-replace-the-chalk" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "time" ], "tests": { "total": 94, "kept": 83, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= time <= 1000" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= time <= 1000" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= time <= 1000" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= time <= 1000" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= time <= 1000" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= time <= 1000" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= time <= 1000" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= time <= 1000" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= time <= 1000" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= time <= 1000" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= time <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Maintain two integer variables, direction and i, where direction denotes the current direction in which the pillow should pass, and i denotes an index of the person holding the pillow.", "While time is positive, update the current index with the current direction. If the index reaches the end of the line, multiply direction by - 1." ] }, { "question_id": 2583, "task_id": "kth-largest-sum-in-a-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "binary-tree-preorder-traversal", "maximum-level-sum-of-a-binary-tree", "find-the-level-of-tree-with-minimum-sum" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "k" ], "tests": { "total": 45, "kept": 0, "dropped": { "unreadable": 45 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unreadable": true }, { "line": 3, "end_line": 3, "unreadable": true }, { "line": 4, "end_line": 4, "unreadable": true }, { "line": 5, "end_line": 5, "unreadable": true }, { "line": 6, "end_line": 6, "unreadable": true }, { "line": 7, "end_line": 7, "unreadable": true }, { "line": 8, "end_line": 8, "unreadable": true }, { "line": 9, "end_line": 9, "unreadable": true }, { "line": 10, "end_line": 10, "unreadable": true }, { "line": 11, "end_line": 11, "unreadable": true }, { "line": 12, "end_line": 12, "unreadable": true }, { "line": 13, "end_line": 13, "unreadable": true }, { "line": 14, "end_line": 14, "unreadable": true }, { "line": 15, "end_line": 15, "unreadable": true }, { "line": 16, "end_line": 16, "unreadable": true }, { "line": 17, "end_line": 17, "unreadable": true }, { "line": 18, "end_line": 18, "unreadable": true }, { "line": 19, "end_line": 19, "unreadable": true }, { "line": 20, "end_line": 20, "unreadable": true }, { "line": 21, "end_line": 21, "unreadable": true }, { "line": 22, "end_line": 22, "unreadable": true }, { "line": 23, "end_line": 23, "unreadable": true }, { "line": 24, "end_line": 24, "unreadable": true }, { "line": 25, "end_line": 25, "unreadable": true }, { "line": 26, "end_line": 26, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 28, "end_line": 28, "unreadable": true }, { "line": 29, "end_line": 29, "unreadable": true }, { "line": 30, "end_line": 30, "unreadable": true }, { "line": 31, "end_line": 31, "unreadable": true }, { "line": 32, "end_line": 32, "unreadable": true }, { "line": 33, "end_line": 33, "unreadable": true }, { "line": 34, "end_line": 34, "unreadable": true }, { "line": 35, "end_line": 35, "unreadable": true }, { "line": 36, "end_line": 36, "unreadable": true }, { "line": 37, "end_line": 37, "unreadable": true }, { "line": 38, "end_line": 38, "unreadable": true }, { "line": 39, "end_line": 39, "unreadable": true }, { "line": 40, "end_line": 40, "unreadable": true }, { "line": 41, "end_line": 41, "unreadable": true }, { "line": 42, "end_line": 42, "unreadable": true }, { "line": 43, "end_line": 43, "unreadable": true }, { "line": 44, "end_line": 44, "unreadable": true }, { "line": 45, "end_line": 45, "unreadable": true }, { "line": 46, "end_line": 46, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the tree is n.", "2 <= n <= 10**(5)", "1 <= Node.val <= 10**(6)", "1 <= k <= n" ] }, { "question_id": 2584, "task_id": "split-the-array-to-make-coprime-products", "drop": [], "similar": [ "replace-non-coprime-numbers-in-array" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 107, "kept": 103, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Two numbers with GCD equal to 1 have no common prime divisor.", "Find the prime factorization of the left and right sides and check if they share a prime divisor." ] }, { "question_id": 2585, "task_id": "number-of-ways-to-earn-points", "drop": [], "similar": [ "coin-change-ii", "minimum-total-distance-traveled" ], "flags": [], "comparison": "exact", "parameter_names": [ "target", "types" ], "tests": { "total": 117, "kept": 79, "dropped": { "constraint_violation": 38 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= counti, marksi <= 50" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= counti, marksi <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use Dynamic Programming", "Let ways[i][points] be the number of ways to score a given number of points after solving some questions of the first i types.", "ways[i][points] is equal to the sum of ways[i-1][points - solved * marks[i] over 0 <= solved <= count_i" ] }, { "question_id": 2586, "task_id": "count-the-number-of-vowel-strings-in-range", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "words", "left", "right" ], "tests": { "total": 99, "kept": 69, "dropped": { "constraint_violation": 30 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= left <= right < words.length" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= words[i].length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "consider iterating over all strings from left to right and use an if condition to check if the first character and last character are vowels." ] }, { "question_id": 2587, "task_id": "rearrange-array-to-maximize-prefix-score", "drop": [], "similar": [ "two-city-scheduling" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 105, "kept": 101, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "-10**(6) <= nums[i] <= 10**(6)" ] }, { "line": 62, "end_line": 62, "violates": [ "-10**(6) <= nums[i] <= 10**(6)" ] }, { "line": 80, "end_line": 80, "violates": [ "-10**(6) <= nums[i] <= 10**(6)" ] }, { "line": 91, "end_line": 91, "violates": [ "-10**(6) <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The best order of the array is in decreasing order.", "Sort the array in decreasing order and count the number of positive values in the prefix sum array." ] }, { "question_id": 2588, "task_id": "count-the-number-of-beautiful-subarrays", "drop": [], "similar": [ "maximum-xor-for-each-query", "count-the-number-of-ideal-arrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 121, "kept": 116, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "A subarray is beautiful if its xor is equal to zero.", "Compute the prefix xor for every index, then the xor of subarray [left, right] is equal to zero if prefix_xor[left] ^ perfix_xor[right] == 0", "Iterate from left to right and maintain a hash table to count the number of indices equal to the current prefix xor." ] }, { "question_id": 2589, "task_id": "minimum-time-to-complete-all-tasks", "drop": [], "similar": [ "single-threaded-cpu" ], "flags": [], "comparison": "exact", "parameter_names": [ "tasks" ], "tests": { "total": 112, "kept": 94, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= durationi <= endi - starti + 1" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= durationi <= endi - starti + 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the tasks in ascending order of end time", "Since there are only up to 2000 time points to consider, you can check them one by one", "It is always beneficial to run the task as late as possible so that later tasks can run simultaneously." ] }, { "question_id": 2591, "task_id": "distribute-money-to-maximum-children", "drop": [], "similar": [ "distribute-candies-to-people", "fair-distribution-of-cookies", "calculate-money-in-leetcode-bank" ], "flags": [], "comparison": "exact", "parameter_names": [ "money", "children" ], "tests": { "total": 47, "kept": 41, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= money <= 200" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= money <= 200" ] }, { "line": 30, "end_line": 30, "violates": [ "2 <= children <= 30" ] }, { "line": 35, "end_line": 35, "violates": [ "2 <= children <= 30" ] }, { "line": 38, "end_line": 38, "violates": [ "2 <= children <= 30" ] }, { "line": 43, "end_line": 43, "violates": [ "2 <= children <= 30" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we distribute the money according to the rules if we give 'k' children exactly 8 dollars?", "Brute force to find the largest possible value of k, or return -1 if there doesn\u2019t exist any such k." ] }, { "question_id": 2592, "task_id": "maximize-greatness-of-an-array", "drop": [], "similar": [ "3sum-smaller", "maximum-matching-of-players-with-trainers" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 86, "kept": 85, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 83, "end_line": 83, "violates": [ "0 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use sorting and two pointers here?", "Assign every element the next bigger unused element as many times as possible." ] }, { "question_id": 2593, "task_id": "find-score-of-an-array-after-marking-all-elements", "drop": [], "similar": [ "sort-integers-by-the-power-value" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 112, "kept": 111, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try simulating the process of marking the elements and their adjacent.", "If there is an element that was already marked, then you skip it." ] }, { "question_id": 2594, "task_id": "minimum-time-to-repair-cars", "drop": [], "similar": [ "sort-transformed-array", "koko-eating-bananas" ], "flags": [], "comparison": "exact", "parameter_names": [ "ranks", "cars" ], "tests": { "total": 92, "kept": 82, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= ranks[i] <= 100" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= ranks[i] <= 100" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= ranks[i] <= 100" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= ranks[i] <= 100" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= ranks[i] <= 100" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= ranks[i] <= 100" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= ranks[i] <= 100" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= ranks[i] <= 100" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= ranks[i] <= 100" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= ranks[i] <= 100", "1 <= cars <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For a predefined fixed time, can all the cars be repaired?", "Try using binary search on the answer." ] }, { "question_id": 2595, "task_id": "number-of-even-and-odd-bits", "drop": [], "similar": [ "find-numbers-with-even-number-of-digits" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 62, "kept": 53, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= n <= 1000" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= n <= 1000" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= n <= 1000" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= n <= 1000" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= n <= 1000" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= n <= 1000" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= n <= 1000" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= n <= 1000" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= n <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Maintain two integer variables, even and odd, to count the number of even and odd indices in the binary representation of integer n.", "Divide n by 2 while n is positive, and if n modulo 2 is 1, add 1 to its corresponding variable." ] }, { "question_id": 2596, "task_id": "check-knight-tour-configuration", "drop": [], "similar": [ "minimum-knight-moves", "maximum-number-of-moves-to-kill-all-pawns" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 54, "kept": 50, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "3 <= n <= 7" ] }, { "line": 20, "end_line": 20, "violates": [ "3 <= n <= 7" ] }, { "line": 30, "end_line": 30, "violates": [ "3 <= n <= 7" ] }, { "line": 35, "end_line": 35, "violates": [ "3 <= n <= 7" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It is enough to check if each move of the knight is valid.", "Try all cases of the knight's movements to check if a move is valid." ], "similar_to_test": [ "3283 maximum-number-of-moves-to-kill-all-pawns" ] }, { "question_id": 2597, "task_id": "the-number-of-beautiful-subsets", "drop": [], "similar": [ "construct-the-lexicographically-largest-valid-sequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 74, "kept": 66, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i], k <= 1000", "1 <= nums[i], k <= 1000" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i], k <= 1000" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i], k <= 1000", "1 <= nums[i], k <= 1000" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i], k <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the array nums and create another array cnt of size nums[i].", "Use backtracking to generate all the beautiful subsets. If cnt[nums[i] - k] is positive, then it is impossible to add nums[i] in the subset, and we just move to the next index. Otherwise, it is also possible to add nums[i] in the subset, in this case, increase cnt[nums[i]], and move to the next index.", "Bonus: Can you solve the problem in O(n log n)?" ] }, { "question_id": 2598, "task_id": "smallest-missing-non-negative-integer-after-operations", "drop": [], "similar": [ "first-missing-positive" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "value" ], "tests": { "total": 125, "kept": 114, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= nums.length, value <= 10**(5)", "1 <= nums.length, value <= 10**(5)" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= nums.length, value <= 10**(5)", "1 <= nums.length, value <= 10**(5)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums.length, value <= 10**(5)", "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums.length, value <= 10**(5)", "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums.length, value <= 10**(5)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums.length, value <= 10**(5)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums.length, value <= 10**(5)", "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums.length, value <= 10**(5)", "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums.length, value <= 10**(5)", "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 120, "end_line": 120, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 124, "end_line": 124, "violates": [ "1 <= nums.length, value <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Think about using modular arithmetic.", "if x = nums[i] (mod value), then we can make nums[i] equal to x after some number of operations", "How does finding the frequency of (nums[i] mod value) help?" ] }, { "question_id": 2599, "task_id": "make-the-prefix-sum-non-negative", "drop": [ "premium" ] }, { "question_id": 2600, "task_id": "k-items-with-the-maximum-sum", "drop": [], "similar": [ "maximum-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "numOnes", "numZeros", "numNegOnes", "k" ], "tests": { "total": 105, "kept": 104, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 96, "end_line": 96, "violates": [ "0 <= numOnes, numZeros, numNegOnes <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It is always optimal to take items with the number 1 written on them as much as possible.", "If k > numOnes, after taking all items with the number 1, it is always optimal to take items with the number 0 written on them as much as possible.", "If k > numOnes + numZeroes we are forced to take k - numOnes - numZeroes -1s." ] }, { "question_id": 2601, "task_id": "prime-subtraction-operation", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 157, "kept": 157, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Think about if we have many primes to subtract from nums[i]. Which prime is more optimal?", "The most optimal prime to subtract from nums[i] is the one that makes nums[i] the smallest as possible and greater than nums[i-1]." ] }, { "question_id": 2602, "task_id": "minimum-operations-to-make-all-array-elements-equal", "drop": [], "similar": [ "minimum-moves-to-equal-array-elements-ii", "minimum-cost-to-make-array-equal", "sum-of-distances" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 107, "kept": 95, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i], queries[i] <= 10**(9)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i], queries[i] <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i], queries[i] <= 10**(9)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i], queries[i] <= 10**(9)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i], queries[i] <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i], queries[i] <= 10**(9)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i], queries[i] <= 10**(9)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums[i], queries[i] <= 10**(9)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i], queries[i] <= 10**(9)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i], queries[i] <= 10**(9)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i], queries[i] <= 10**(9)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i], queries[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each query, you should decrease all elements greater than queries[i] and increase all elements less than queries[i].", "The answer is the sum of absolute differences between queries[i] and every element of the array. How do you calculate that optimally?" ] }, { "question_id": 2603, "task_id": "collect-coins-in-a-tree", "drop": [], "similar": [ "minimum-height-trees", "sum-of-distances-in-tree", "maximum-score-after-applying-operations-on-a-tree", "find-number-of-coins-to-place-in-tree-nodes" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "coins", "edges" ], "tests": { "total": 65, "kept": 56, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "edges.length == n - 1" ] }, { "line": 34, "end_line": 34, "violates": [ "edges.length == n - 1", "0 <= ai, bi < n" ] }, { "line": 36, "end_line": 36, "violates": [ "edges.length == n - 1", "0 <= ai, bi < n" ] }, { "line": 39, "end_line": 39, "violates": [ "edges.length == n - 1", "0 <= ai, bi < n" ] }, { "line": 40, "end_line": 40, "violates": [ "edges.length == n - 1", "0 <= ai, bi < n" ] }, { "line": 51, "end_line": 51, "violates": [ "edges.length == n - 1", "0 <= ai, bi < n" ] }, { "line": 53, "end_line": 53, "violates": [ "edges.length == n - 1", "0 <= ai, bi < n" ] }, { "line": 54, "end_line": 54, "violates": [ "edges.length == n - 1" ] }, { "line": 56, "end_line": 56, "violates": [ "edges.length == n - 1" ] } ], "unchecked_constraints": [ "edges represents a valid tree." ], "public_tests": 2, "hints": [ "All leaves that do not have a coin are redundant and can be deleted from the tree.", "Remove the leaves that do not have coins on them, so that the resulting tree will have a coin on every leaf.", "In the remaining tree, remove each leaf node and its parent from the tree. The remaining nodes in the tree are the ones that must be visited. Hence, the answer is equal to (# remaining nodes -1) * 2" ] }, { "question_id": 2604, "task_id": "minimum-time-to-eat-all-grains", "drop": [ "premium" ] }, { "question_id": 2605, "task_id": "form-smallest-number-from-two-digit-arrays", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 97, "kept": 94, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 48, "end_line": 48, "violates": [ "1 <= nums1[i], nums2[i] <= 9" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums1[i], nums2[i] <= 9" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums1[i], nums2[i] <= 9" ] } ], "unchecked_constraints": [ "All digits in each array are unique." ], "public_tests": 2, "hints": [ "How many digits will the resulting number have at most?", "The resulting number will have either one or two digits. Try to find when each case is possible." ] }, { "question_id": 2606, "task_id": "find-the-substring-with-maximum-cost", "drop": [], "similar": [ "maximum-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "chars", "vals" ], "tests": { "total": 127, "kept": 116, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "vals.length == chars.length" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= chars.length <= 26" ] }, { "line": 32, "end_line": 32, "violates": [ "vals.length == chars.length" ] }, { "line": 49, "end_line": 49, "violates": [ "vals.length == chars.length" ] }, { "line": 55, "end_line": 55, "violates": [ "s consist of lowercase English letters." ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= chars.length <= 26" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= chars.length <= 26", "vals.length == chars.length" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= s.length <= 10**(5)", "1 <= chars.length <= 26" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= chars.length <= 26" ] }, { "line": 121, "end_line": 121, "violates": [ "vals.length == chars.length" ] }, { "line": 122, "end_line": 122, "violates": [ "vals.length == chars.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Create a new integer array where arr[i] denotes the value of character s[i].", "We can use Kadane\u2019s maximum subarray sum algorithm to find the maximum cost." ] }, { "question_id": 2607, "task_id": "make-k-subarray-sums-equal", "drop": [], "similar": [ "rotate-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "k" ], "tests": { "total": 102, "kept": 100, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= arr[i] <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= arr[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Think about gcd(n, k). How will it help to calculate the answer?", "indices i and j are in the same group if gcd(n, k) mod i = gcd(n, k) mod j. Each group should have equal elements. Think about the minimum number of operations for each group", "The minimum number of operations for each group equals the summation of differences between the elements and the median of elements inside the group." ] }, { "question_id": 2608, "task_id": "shortest-cycle-in-a-graph", "drop": [], "similar": [ "redundant-connection", "longest-cycle-in-a-graph", "divide-nodes-into-the-maximum-number-of-groups" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 64, "kept": 64, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There are no repeated edges." ], "public_tests": 2, "hints": [ "How can BFS be used?", "For each vertex u, calculate the length of the shortest cycle that contains vertex u using BFS" ] }, { "question_id": 2609, "task_id": "find-the-longest-balanced-substring-of-a-binary-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 185, "kept": 173, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= s.length <= 50" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= s.length <= 50" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= s.length <= 50" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= s.length <= 50" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= s.length <= 50" ] }, { "line": 129, "end_line": 129, "violates": [ "1 <= s.length <= 50" ] }, { "line": 132, "end_line": 132, "violates": [ "1 <= s.length <= 50" ] }, { "line": 145, "end_line": 145, "violates": [ "1 <= s.length <= 50" ] }, { "line": 157, "end_line": 157, "violates": [ "1 <= s.length <= 50" ] }, { "line": 164, "end_line": 164, "violates": [ "1 <= s.length <= 50" ] }, { "line": 174, "end_line": 174, "violates": [ "1 <= s.length <= 50" ] }, { "line": 183, "end_line": 183, "violates": [ "1 <= s.length <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Consider iterating over each subarray and checking if it\u2019s balanced or not.", "Among all balanced subarrays, the answer is the longest one of them." ] }, { "question_id": 2610, "task_id": "convert-an-array-into-a-2d-array-with-conditions", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 79, "kept": 69, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= nums.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Process the elements in the array one by one in any order and only create a new row in the matrix when we cannot put it into the existing rows", "We can simply iterate over the existing rows of the matrix to see if we can place each element." ] }, { "question_id": 2611, "task_id": "mice-and-cheese", "drop": [], "similar": [ "house-robber" ], "flags": [], "comparison": "exact", "parameter_names": [ "reward1", "reward2", "k" ], "tests": { "total": 96, "kept": 93, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= reward1[i], reward2[i] <= 1000" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= reward1[i], reward2[i] <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= reward1[i], reward2[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The intended solution uses greedy approach.", "Imagine at first that the second mouse eats all the cheese, then we should choose k types of cheese with the maximum sum of - reward2[i] + reward1[i]." ] }, { "question_id": 2613, "task_id": "beautiful-pairs", "drop": [ "premium" ] }, { "question_id": 2614, "task_id": "prime-in-diagonal", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 73, "kept": 69, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i][j] <= 4*10**(6)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i][j] <= 4*10**(6)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i][j] <= 4*10**(6)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i][j] <= 4*10**(6)" ] } ], "unchecked_constraints": [ "nums.length == numsi.length" ], "public_tests": 2, "hints": [ "Iterate over the diagonals of the matrix and check for each element.", "Check if the element is prime or not in O(sqrt(n)) time." ] }, { "question_id": 2615, "task_id": "sum-of-distances", "drop": [], "similar": [ "remove-duplicates-from-sorted-array", "find-all-duplicates-in-an-array", "minimum-operations-to-make-all-array-elements-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 105, "kept": 105, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use the prefix sum here?", "For each number x, collect all the indices where x occurs, and calculate the prefix sum of the array.", "For each occurrence of x, the indices to the right will be regular subtraction while the indices to the left will be reversed subtraction." ] }, { "question_id": 2616, "task_id": "minimize-the-maximum-difference-of-pairs", "drop": [], "similar": [ "minimum-absolute-difference", "minimum-difference-between-largest-and-smallest-value-in-three-moves" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "p" ], "tests": { "total": 106, "kept": 100, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "0 <= p <= (nums.length)/2" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 106, "end_line": 106, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 107, "end_line": 107, "violates": [ "0 <= p <= (nums.length)/2" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "To minimize the answer, the array should be sorted first.", "Can we use binary search here?" ] }, { "question_id": 2617, "task_id": "minimum-number-of-visited-cells-in-a-grid", "drop": [], "similar": [ "jump-game-ii", "jump-game" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 103, "kept": 96, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "0 <= grid[i][j] < m * n", "grid[m - 1][n - 1] == 0" ] }, { "line": 23, "end_line": 23, "violates": [ "grid[m - 1][n - 1] == 0" ] }, { "line": 41, "end_line": 41, "violates": [ "grid[m - 1][n - 1] == 0" ] }, { "line": 62, "end_line": 62, "violates": [ "grid[m - 1][n - 1] == 0" ] }, { "line": 83, "end_line": 83, "violates": [ "grid[m - 1][n - 1] == 0" ] }, { "line": 87, "end_line": 87, "violates": [ "grid[m - 1][n - 1] == 0" ] }, { "line": 93, "end_line": 93, "violates": [ "grid[m - 1][n - 1] == 0" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each cell (i,j), it is critical to find out the minimum number of steps to reach (i,j), denoted dis[i][j], quickly, given the tight constraint.", "Calculate dis[i][j] going left to right, top to bottom.", "Suppose we want to calculate dis[i][j], keep track of a priority queue that stores (dis[i][k], i, k) for all k \u2264 j, and another priority queue that stores (dis[k][j], k, j) for all k \u2264 i." ] }, { "question_id": 2638, "task_id": "count-the-number-of-k-free-subsets", "drop": [ "premium" ] }, { "question_id": 2639, "task_id": "find-the-width-of-columns-of-a-grid", "drop": [], "similar": [ "next-greater-numerically-balanced-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 96, "kept": 89, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "n == grid[i].length" ] }, { "line": 43, "end_line": 43, "violates": [ "n == grid[i].length" ] }, { "line": 62, "end_line": 62, "violates": [ "-10**(9) <= grid[r][c] <= 10**(9)" ] }, { "line": 82, "end_line": 82, "violates": [ "-10**(9) <= grid[r][c] <= 10**(9)" ] }, { "line": 84, "end_line": 84, "violates": [ "-10**(9) <= grid[r][c] <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "-10**(9) <= grid[r][c] <= 10**(9)" ] }, { "line": 89, "end_line": 89, "violates": [ "-10**(9) <= grid[r][c] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "You can find the length of a number by dividing it by 10 and then rounding it down again and again until this number becomes equal to 0. Add 1 if this number is negative.", "Traverse the matrix column-wise to find the maximum length in each column." ] }, { "question_id": 2640, "task_id": "find-the-score-of-all-prefixes-of-an-array", "drop": [], "similar": [ "most-beautiful-item-for-each-query" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 94, "kept": 88, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Keep track of the prefix maximum of the array", "Establish a relationship between ans[i] and ans[i-1]", "for 0 < i < n, ans[i] = ans[i-1]+conver[i]. In other words, array ans is the prefix sum array of the conversion array" ] }, { "question_id": 2641, "task_id": "cousins-in-binary-tree-ii", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "cousins-in-binary-tree", "maximum-level-sum-of-a-binary-tree" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "root" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the tree is in the range [1, 10**(5)].", "1 <= Node.val <= 10**(4)" ] }, { "question_id": 2643, "task_id": "row-with-maximum-ones", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "mat" ], "tests": { "total": 71, "kept": 71, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Iterate through each row and keep the count of ones." ] }, { "question_id": 2644, "task_id": "find-the-maximum-divisibility-score", "drop": [], "similar": [ "binary-prefix-divisible-by-5" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "divisors" ], "tests": { "total": 131, "kept": 122, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i], divisors[i] <= 10**(9)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i], divisors[i] <= 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i], divisors[i] <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i], divisors[i] <= 10**(9)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i], divisors[i] <= 10**(9)" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= nums[i], divisors[i] <= 10**(9)" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= nums[i], divisors[i] <= 10**(9)" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= nums[i], divisors[i] <= 10**(9)" ] }, { "line": 129, "end_line": 129, "violates": [ "1 <= nums[i], divisors[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Consider counting for each element in divisors the count of elements in nums divisible by it using bruteforce.", "After counting for each divisor, take the one with the maximum count. In case of a tie, take the minimum one of them." ] }, { "question_id": 2645, "task_id": "minimum-additions-to-make-valid-string", "drop": [], "similar": [ "merge-strings-alternately" ], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 108, "kept": 108, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Maintain a pointer on word and another pointer on string \u201cabc\u201d.", "If the two characters that are being pointed to differ, Increment the answer and the pointer to the string \u201cabc\u201d by one." ] }, { "question_id": 2646, "task_id": "minimize-the-total-price-of-the-trips", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "price", "trips" ], "tests": { "total": 65, "kept": 62, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= price[i] <= 1000" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= price[i] <= 1000" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= price[i] <= 1000" ] } ], "unchecked_constraints": [ "edges represents a valid tree.", "price[i] is an even integer." ], "public_tests": 2, "hints": [ "The final answer is the price[i] * freq[i], where freq[i] is the number of times node i was visited during the trip, and price[i] is the final price.", "To find freq[i] we will use dfs or bfs for each trip and update every node on the path start and end.", "Finally, to find the final price[i] we will use dynamic programming on the tree. Let dp(v, 0/1) denote the minimum total price with the node v\u2019s price being halved or not." ] }, { "question_id": 2647, "task_id": "color-the-triangle-red", "drop": [ "premium" ] }, { "question_id": 2651, "task_id": "calculate-delayed-arrival-time", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arrivalTime", "delayedTime" ], "tests": { "total": 31, "kept": 31, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= arrivaltime < 24" ], "public_tests": 2, "hints": [ "Use the modulo operator to handle the case when the arrival time plus the delayed time goes beyond 24 hours.", "If the arrival time plus the delayed time is greater than or equal to 24, you can also subtract 24 to get the time in the 24-hour format." ] }, { "question_id": 2652, "task_id": "sum-multiples", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 38, "kept": 38, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Iterate through the range 1 to n and count numbers divisible by either 3, 5, or 7." ] }, { "question_id": 2653, "task_id": "sliding-subarray-beauty", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k", "x" ], "tests": { "total": 106, "kept": 106, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try to maintain the frequency of negative numbers in the current window of size k.", "The x^th smallest negative integer can be gotten by iterating through the frequencies of the numbers in order." ] }, { "question_id": 2654, "task_id": "minimum-number-of-operations-to-make-all-array-elements-equal-to-1", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 157, "kept": 157, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Note that if you have at least one occurrence of 1 in the array, then you can make all the other elements equal to 1 with one operation each.", "Try finding the shortest subarray with a gcd equal to 1." ] }, { "question_id": 2655, "task_id": "find-maximal-uncovered-ranges", "drop": [ "premium" ] }, { "question_id": 2656, "task_id": "maximum-sum-with-exactly-k-elements", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 97, "kept": 93, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 2657, "task_id": "find-the-prefix-common-array-of-two-arrays", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "A", "B" ], "tests": { "total": 72, "kept": 68, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= A[i], B[i] <= n" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= A.length == B.length == n <= 50" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= A.length == B.length == n <= 50", "1 <= A[i], B[i] <= n" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= A[i], B[i] <= n" ] } ], "unchecked_constraints": [ "It is guaranteed that A and B are both a permutation of n integers." ], "public_tests": 2, "hints": [ "Consider keeping a frequency array that stores the count of occurrences of each number till index i.", "If a number occurred two times, it means it occurred in both A and B since they\u2019re both permutations so add one to the answer." ] }, { "question_id": 2658, "task_id": "maximum-number-of-fish-in-a-grid", "drop": [], "similar": [ "number-of-islands", "max-area-of-island" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 105, "kept": 98, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 48, "end_line": 48, "violates": [ "0 <= grid[i][j] <= 10" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= grid[i][j] <= 10" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= grid[i][j] <= 10" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= grid[i][j] <= 10" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= grid[i][j] <= 10" ] }, { "line": 83, "end_line": 83, "violates": [ "0 <= grid[i][j] <= 10" ] }, { "line": 98, "end_line": 98, "violates": [ "0 <= grid[i][j] <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Run DFS from each non-zero cell.", "Each time you pick a cell to start from, add up the number of fish contained in the cells you visit." ] }, { "question_id": 2659, "task_id": "make-array-empty", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 216, "kept": 211, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 64, "end_line": 64, "violates": [ "All values in nums are distinct." ] }, { "line": 94, "end_line": 94, "violates": [ "All values in nums are distinct." ] }, { "line": 98, "end_line": 98, "violates": [ "-10**(9 )<= nums[i] <= 10**(9)" ] }, { "line": 104, "end_line": 104, "violates": [ "-10**(9 )<= nums[i] <= 10**(9)" ] }, { "line": 106, "end_line": 106, "violates": [ "-10**(9 )<= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Understand the order in which the indices are removed from the array.", "We don\u2019t really need to delete or move the elements, only the array length matters.", "Upon removing an index, decide how many steps it takes to move to the next one.", "Use a data structure to speed up the calculation." ] }, { "question_id": 2660, "task_id": "determine-the-winner-of-a-bowling-game", "drop": [], "similar": [ "high-five" ], "flags": [], "comparison": "exact", "parameter_names": [ "player1", "player2" ], "tests": { "total": 93, "kept": 92, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 84, "end_line": 84, "violates": [ "n == player1.length == player2.length" ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Think about simulating the process to calculate the answer.", "Iterate over each element and check the previous two elements. See if one of them is 10 and can affect the score." ] }, { "question_id": 2661, "task_id": "first-completely-painted-row-or-column", "drop": [], "similar": [ "check-if-every-row-and-column-contains-all-numbers", "difference-between-ones-and-zeros-in-row-and-column" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "arr", "mat" ], "tests": { "total": 71, "kept": 68, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "All the integers of arr are unique." ] }, { "line": 39, "end_line": 39, "violates": [ "All the integers of arr are unique." ] }, { "line": 61, "end_line": 61, "violates": [ "All the integers of arr are unique." ] } ], "unchecked_constraints": [ "n = mat[i].length", "arr.length == m * n", "1 <= m, n <= 10**(5)", "1 <= m * n <= 10**(5)", "1 <= arr[i], mat[r][c] <= m * n" ], "public_tests": 2, "hints": [ "Can we use a frequency array?", "Pre-process the positions of the values in the matrix.", "Traverse the array and increment the corresponding row and column frequency using the pre-processed positions.", "If the row frequency becomes equal to the number of columns, or vice-versa return the current index." ] }, { "question_id": 2662, "task_id": "minimum-cost-of-a-path-with-special-roads", "drop": [], "similar": [ "minimum-path-sum", "number-of-restricted-paths-from-first-to-last-node" ], "flags": [], "comparison": "exact", "parameter_names": [ "start", "target", "specialRoads" ], "tests": { "total": 54, "kept": 54, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= startX <= targetX <= 10**(5)", "1 <= startY <= targetY <= 10**(5)", "startX <= x1i, x2i <= targetX", "startY <= y1i, y2i <= targetY" ], "public_tests": 3, "hints": [ "It can be proven that it is optimal to go only to the positions that are either the start or the end of a special road or the target position.", "Consider all positions given to you as nodes in a graph, and the edges of the graph are the special roads.", "Now the problem is equivalent to finding the shortest path in a directed graph." ] }, { "question_id": 2663, "task_id": "lexicographically-smallest-beautiful-string", "drop": [], "similar": [ "smallest-string-with-swaps", "find-palindrome-with-fixed-length" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 103, "kept": 90, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "4 <= k <= 26" ] }, { "line": 11, "end_line": 11, "violates": [ "4 <= k <= 26" ] }, { "line": 14, "end_line": 14, "violates": [ "4 <= k <= 26" ] }, { "line": 28, "end_line": 28, "violates": [ "4 <= k <= 26" ] }, { "line": 32, "end_line": 32, "violates": [ "4 <= k <= 26" ] }, { "line": 33, "end_line": 33, "violates": [ "4 <= k <= 26" ] }, { "line": 50, "end_line": 50, "violates": [ "4 <= k <= 26" ] }, { "line": 63, "end_line": 63, "violates": [ "4 <= k <= 26" ] }, { "line": 66, "end_line": 66, "violates": [ "4 <= k <= 26" ] }, { "line": 70, "end_line": 70, "violates": [ "4 <= k <= 26" ] }, { "line": 85, "end_line": 85, "violates": [ "4 <= k <= 26" ] }, { "line": 88, "end_line": 88, "violates": [ "4 <= k <= 26" ] }, { "line": 93, "end_line": 93, "violates": [ "4 <= k <= 26" ] } ], "unchecked_constraints": [ "s is a beautiful string." ], "public_tests": 2, "hints": [ "If the string does not contain any palindromic substrings of lengths 2 and 3, then the string does not contain any palindromic substrings at all.", "Iterate from right to left and if it is possible to increase character at index i without creating any palindromic substrings of lengths 2 and 3, then increase it.", "After increasing the character at index i, set every character after index i equal to character a. With this, we will ensure that we have created a lexicographically larger string than s, which does not contain any palindromes before index i and is lexicographically the smallest.", "Finally, we are just left with a case to fix palindromic substrings, which come after index i. This can be done with a similar method mentioned in the second hint." ] }, { "question_id": 2664, "task_id": "the-knights-tour", "drop": [ "premium" ] }, { "question_id": 2670, "task_id": "find-the-distinct-difference-array", "drop": [], "similar": [ "left-and-right-sum-differences" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 107, "kept": 103, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Which data structure will help you maintain distinct elements?", "Iterate over all possible prefix sizes. Then, use a nested loop to add the elements of the prefix to a set, and another nested loop to add the elements of the suffix to another set." ] }, { "question_id": 2672, "task_id": "number-of-adjacent-elements-with-the-same-color", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "queries" ], "tests": { "total": 74, "kept": 74, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Since at each query, only one element is being recolored, we just need to focus on its neighbors.", "If an element that is changed on the i-th query had the same color as its right element answer decreases by 1. Similarly contributes its left element too.", "After changing the color, if the element has the same color as its right element answer increases by 1. Similarly contributes its left element too." ] }, { "question_id": 2673, "task_id": "make-costs-of-paths-equal-in-a-binary-tree", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "cost" ], "tests": { "total": 50, "kept": 35, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "cost.length == n" ] }, { "line": 11, "end_line": 11, "violates": [ "cost.length == n" ] }, { "line": 14, "end_line": 14, "violates": [ "cost.length == n" ] }, { "line": 20, "end_line": 20, "violates": [ "cost.length == n" ] }, { "line": 21, "end_line": 21, "violates": [ "cost.length == n" ] }, { "line": 22, "end_line": 22, "violates": [ "cost.length == n" ] }, { "line": 23, "end_line": 23, "violates": [ "cost.length == n" ] }, { "line": 24, "end_line": 24, "violates": [ "cost.length == n" ] }, { "line": 25, "end_line": 25, "violates": [ "cost.length == n", "1 <= cost[i] <= 10**(4)" ] }, { "line": 32, "end_line": 32, "violates": [ "cost.length == n" ] }, { "line": 34, "end_line": 34, "violates": [ "cost.length == n" ] }, { "line": 35, "end_line": 35, "violates": [ "cost.length == n" ] }, { "line": 36, "end_line": 36, "violates": [ "cost.length == n", "1 <= cost[i] <= 10**(4)" ] }, { "line": 40, "end_line": 40, "violates": [ "cost.length == n" ] }, { "line": 46, "end_line": 46, "violates": [ "cost.length == n" ] } ], "unchecked_constraints": [ "n + 1 is a power of 2" ], "public_tests": 2, "hints": [ "The path from the root to a leaf that has the maximum cost should not be modified.", "The optimal way is to increase all other paths to make their costs equal to the path with maximum cost." ] }, { "question_id": 2678, "task_id": "number-of-senior-citizens", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "details" ], "tests": { "total": 78, "kept": 78, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The phone numbers and seat numbers of the passengers are distinct.", "details[i] consists of digits from '0' to '9'." ], "public_tests": 2, "hints": [ "Convert the value at index 11 and 12 to a numerical value.", "The age of the person at index i is equal to details[i][11]*10+details[i][12]." ] }, { "question_id": 2679, "task_id": "sum-in-a-matrix", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 103, "kept": 100, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "0 <= nums[i][j] <= 10**(3)" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= nums[i][j] <= 10**(3)" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= nums[i][j] <= 10**(3)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the numbers in each row in decreasing order.", "The answer is the summation of the max number in every column after sorting the rows." ] }, { "question_id": 2680, "task_id": "maximum-or", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 114, "kept": 111, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The optimal solution should apply all the k operations on a single number.", "Calculate the prefix or and the suffix or and perform k operations over each element, and maximize the answer." ] }, { "question_id": 2681, "task_id": "power-of-heroes", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 93, "kept": 93, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try something with sorting the array.", "For a pair of array elements nums[i] and nums[j] (i < j), the power would be nums[i]*nums[j]^2 regardless of how many elements in between are included.", "The number of subsets with the above as power will correspond to 2^(j-i-1).", "Try collecting the terms for nums[0], nums[1], \u2026, nums[j-1] when computing the power of heroes ending at index j to get the power in a single pass." ] }, { "question_id": 2682, "task_id": "find-the-losers-of-the-circular-game", "drop": [], "similar": [ "find-the-child-who-has-the-ball-after-k-seconds" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 73, "kept": 73, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simulate the whole game until a player receives the ball for the second time." ] }, { "question_id": 2683, "task_id": "neighboring-bitwise-xor", "drop": [], "similar": [ "bitwise-or-of-adjacent-elements" ], "flags": [], "comparison": "exact", "parameter_names": [ "derived" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The values in derived are either 0's or 1's" ], "public_tests": 3, "hints": [ "Understand that from the original element, we are using each element twice to construct the derived array", "The xor-sum of the derived array should be 0 since there is always a duplicate occurrence of each element." ] }, { "question_id": 2684, "task_id": "maximum-number-of-moves-in-a-grid", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 81, "kept": 81, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider using dynamic programming to find the maximum number of moves that can be made from each cell.", "The final answer will be the maximum value in cells of the first column." ] }, { "question_id": 2685, "task_id": "count-the-number-of-complete-components", "drop": [], "similar": [ "number-of-connected-components-in-an-undirected-graph" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 69, "kept": 62, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "ai != bi" ] }, { "line": 31, "end_line": 31, "violates": [ "ai != bi" ] }, { "line": 33, "end_line": 33, "violates": [ "ai != bi" ] }, { "line": 37, "end_line": 37, "violates": [ "ai != bi" ] }, { "line": 46, "end_line": 46, "violates": [ "ai != bi" ] }, { "line": 58, "end_line": 58, "violates": [ "ai != bi" ] }, { "line": 61, "end_line": 61, "violates": [ "ai != bi" ] } ], "unchecked_constraints": [ "There are no repeated edges." ], "public_tests": 2, "hints": [ "Find the connected components of an undirected graph using depth-first search (DFS) or breadth-first search (BFS).", "For each connected component, count the number of nodes and edges in the component.", "A connected component is complete if and only if the number of edges in the component is equal to m*(m-1)/2, where m is the number of nodes in the component." ] }, { "question_id": 2696, "task_id": "minimum-string-length-after-removing-substrings", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 153, "kept": 152, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use brute force to solve the problem?", "Repeatedly traverse the string to find and remove the substrings \u201cAB\u201d and \u201cCD\u201d until no more occurrences exist.", "Can the solution be optimized using a stack?" ] }, { "question_id": 2697, "task_id": "lexicographically-smallest-palindrome", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 216, "kept": 216, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "We can make any string a palindrome, by simply making any character at index i equal to the character at index length - i - 1 (using 0-based indexing).", "To make it lexicographically smallest we can change the character with maximum ASCII value to the one with minimum ASCII value." ] }, { "question_id": 2698, "task_id": "find-the-punishment-number-of-an-integer", "drop": [], "similar": [ "number-of-great-partitions" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 21, "kept": 21, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we generate all possible partitions of a number?", "Use a recursive algorithm that splits the number into two parts, generates all possible partitions of each part recursively, and then combines them in all possible ways." ] }, { "question_id": 2699, "task_id": "modify-graph-edge-weights", "drop": [], "similar": [], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "n", "edges", "source", "destination", "target" ], "tests": { "total": 77, "kept": 77, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "wi = -1 or 1 <= wi <= 10**(7)", "The graph is connected, and there are no self-loops or repeated edges" ], "public_tests": 3, "hints": [ "Firstly, check that it\u2019s actually possible to make the shortest path from source to destination equal to the target.", "If the shortest path from source to destination without the edges to be modified, is less than the target, then it is not possible.", "If the shortest path from source to destination including the edges to be modified and assigning them a temporary weight of 1, is greater than the target, then it is also not possible.", "Suppose we can find a modifiable edge (u, v) such that the length of the shortest path from source to u (dis1) plus the length of the shortest path from v to destination (dis2) is less than target (dis1 + dis2 < target), then we can change its weight to \u201ctarget - dis1 - dis2\u201d.", "For all the other edges that still have the weight \u201c-1\u201d, change the weights into sufficient large number (target, target + 1 or 200000000 etc.)." ] }, { "question_id": 2702, "task_id": "minimum-operations-to-make-numbers-non-positive", "drop": [ "premium" ] }, { "question_id": 2706, "task_id": "buy-two-chocolates", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "prices", "money" ], "tests": { "total": 111, "kept": 72, "dropped": { "constraint_violation": 39 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= money <= 100", "1 <= money <= 100" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= money <= 100", "1 <= money <= 100" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= money <= 100" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= money <= 100" ] }, { "line": 29, "end_line": 29, "violates": [ "2 <= prices.length <= 50", "1 <= money <= 100" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= money <= 100" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= money <= 100" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= prices[i] <= 100", "1 <= money <= 100" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= money <= 100", "1 <= money <= 100" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= money <= 100", "1 <= money <= 100" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= money <= 100" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= money <= 100" ] }, { "line": 48, "end_line": 48, "violates": [ "2 <= prices.length <= 50" ] }, { "line": 50, "end_line": 50, "violates": [ "2 <= prices.length <= 50", "2 <= prices.length <= 50" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= prices[i] <= 100", "1 <= money <= 100" ] }, { "line": 53, "end_line": 53, "violates": [ "2 <= prices.length <= 50", "2 <= prices.length <= 50" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= money <= 100" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= money <= 100" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= money <= 100" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= money <= 100" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= money <= 100", "1 <= money <= 100" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= money <= 100" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= money <= 100" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= money <= 100", "1 <= money <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= money <= 100" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= money <= 100", "1 <= money <= 100" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= money <= 100" ] }, { "line": 86, "end_line": 86, "violates": [ "2 <= prices.length <= 50" ] }, { "line": 90, "end_line": 90, "violates": [ "2 <= prices.length <= 50", "2 <= prices.length <= 50" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= money <= 100" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= money <= 100", "1 <= money <= 100" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= money <= 100", "1 <= money <= 100" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= money <= 100" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= money <= 100" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= money <= 100" ] }, { "line": 106, "end_line": 106, "violates": [ "2 <= prices.length <= 50", "2 <= prices.length <= 50" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= money <= 100", "1 <= money <= 100" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= money <= 100" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= money <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the array and check if the money is more than or equal to the sum of the two cheapest elements." ] }, { "question_id": 2707, "task_id": "extra-characters-in-a-string", "drop": [], "similar": [ "word-break" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "dictionary" ], "tests": { "total": 97, "kept": 96, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 71, "end_line": 71, "violates": [ "1 <= dictionary.length <= 50" ] } ], "unchecked_constraints": [ "dictionary contains distinct words" ], "public_tests": 2, "hints": [ "Can we use Dynamic Programming here?", "Define DP[i] as the min extra character if breaking up s[0:i] optimally." ] }, { "question_id": 2708, "task_id": "maximum-strength-of-a-group", "drop": [], "similar": [ "maximum-strength-of-k-disjoint-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 123, "kept": 112, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "-9 <= nums[i] <= 9" ] }, { "line": 16, "end_line": 16, "violates": [ "-9 <= nums[i] <= 9" ] }, { "line": 29, "end_line": 29, "violates": [ "-9 <= nums[i] <= 9" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums.length <= 13" ] }, { "line": 41, "end_line": 41, "violates": [ "-9 <= nums[i] <= 9" ] }, { "line": 57, "end_line": 57, "violates": [ "-9 <= nums[i] <= 9" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums.length <= 13" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums.length <= 13" ] }, { "line": 93, "end_line": 93, "violates": [ "-9 <= nums[i] <= 9" ] }, { "line": 98, "end_line": 98, "violates": [ "-9 <= nums[i] <= 9" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= nums.length <= 13" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to generate all pairs of subsets and check which group provides maximal strength.", "It can also be solved in O(NlogN) by sorting the array and using all positive integers.", "Use negative integers only in pairs such that their product becomes positive." ] }, { "question_id": 2709, "task_id": "greatest-common-divisor-traversal", "drop": [], "similar": [ "graph-connectivity-with-threshold" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 134, "kept": 129, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Create a (prime) factor-numbers list for all the indices.", "Add an edge between the neighbors of the (prime) factor-numbers list. The order of the numbers doesn\u2019t matter. We only need edges between 2 neighbors instead of edges for all pairs.", "The problem is now similar to checking if all the numbers (nodes of the graph) are in the same connected component.", "Any algorithm (i.e., BFS, DFS, or Union-Find Set) should work to find or check connected components" ] }, { "question_id": 2710, "task_id": "remove-trailing-zeros-from-a-string", "drop": [], "similar": [ "check-if-bitwise-or-has-trailing-zeros" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 24, "kept": 24, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "num doesn't have any leading zeros." ], "public_tests": 2, "hints": [ "Find the last non-zero digit in num." ] }, { "question_id": 2711, "task_id": "difference-of-number-of-distinct-values-on-diagonals", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 91, "kept": 84, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= m, n, grid[i][j] <= 50" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= m, n, grid[i][j] <= 50" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= m, n, grid[i][j] <= 50" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= m, n, grid[i][j] <= 50" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= m, n, grid[i][j] <= 50" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= m, n, grid[i][j] <= 50" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= m, n, grid[i][j] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use the set to count the number of distinct elements on diagonals." ] }, { "question_id": 2712, "task_id": "minimum-cost-to-make-all-characters-equal", "drop": [], "similar": [ "flip-string-to-monotone-increasing" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 162, "kept": 162, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For every index i, calculate the number of operations required to make the prefix [0, i - 1] equal to the character at index i, denoted prefix[i].", "For every index i, calculate the number of operations required to make the suffix [i + 1, n - 1] equal to the character at index i, denoted suffix[i].", "The final string will contain at least one character that is left unchanged; Therefore, the answer is the minimum of prefix[i] + suffix[i] for every i in [0, n - 1]." ] }, { "question_id": 2713, "task_id": "maximum-strictly-increasing-cells-in-a-matrix", "drop": [], "similar": [ "number-of-increasing-paths-in-a-grid" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "mat" ], "tests": { "total": 106, "kept": 106, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "We can try to build the answer in a bottom-up fashion, starting from the smallest values and increasing to the larger values.", "Going through the values in sorted order, we can store the maximum path we have seen so far for a row/column.", "When we are at a cell, we check its row and column to find out the best previous smaller value that we\u2019ve got so far, and we use it to increment the current value of the row and column." ] }, { "question_id": 2714, "task_id": "find-shortest-path-with-k-hops", "drop": [ "premium" ] }, { "question_id": 2716, "task_id": "minimize-string-length", "drop": [], "similar": [ "remove-all-adjacent-duplicates-in-string", "remove-all-adjacent-duplicates-in-string-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 112, "kept": 109, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 64, "end_line": 64, "violates": [ "1 <= s.length <= 100" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= s.length <= 100" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The minimized string will not contain duplicate characters.", "The minimized string will contain all distinct characters of the original string." ] }, { "question_id": 2717, "task_id": "semi-ordered-permutation", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums is a permutation." ], "public_tests": 3, "hints": [ "Find the index of elements 1 and n.", "Let x be the position of 1 and y be the position of n. the answer is x + (n-y-1) if x < y and x + (n-y-1) - 1 if x > y." ] }, { "question_id": 2718, "task_id": "sum-of-matrix-after-queries", "drop": [], "similar": [ "range-sum-query-2d-mutable", "range-addition-ii" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "queries" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Process queries in reversed order, as the latest queries represent the most recent changes in the matrix.", "Once you encounter an operation on some row/column, no further operations will affect the values in this row/column. Keep track of seen rows and columns with a set.", "When operating on an unseen row/column, the number of affected cells is the number of columns/rows you haven\u2019t previously seen." ] }, { "question_id": 2719, "task_id": "count-of-integers", "drop": [], "similar": [ "count-numbers-with-non-decreasing-digits", "count-evenly-good-integers" ], "flags": [], "comparison": "exact", "parameter_names": [ "num1", "num2", "min_sum", "max_sum" ], "tests": { "total": 85, "kept": 85, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= num1 <= num2 <= 10**(22)" ], "public_tests": 2, "hints": [ "Let f(n, l, r) denotes the number of integers from 1 to n with the sum of digits between l and r.", "The answer is f(num2, min_sum, max_sum) - f(num1-1, min_sum, max_sum).", "You can calculate f(n, l, r) using digit dp." ] }, { "question_id": 2729, "task_id": "check-if-the-number-is-fascinating", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 60, "kept": 60, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider changing the number to the way it is described in the statement.", "Check if the resulting number contains all the digits from 1 to 9 exactly once." ] }, { "question_id": 2730, "task_id": "find-the-longest-semi-repetitive-substring", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 197, "kept": 194, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 123, "end_line": 123, "violates": [ "1 <= s.length <= 50" ] }, { "line": 131, "end_line": 131, "violates": [ "1 <= s.length <= 50" ] }, { "line": 196, "end_line": 196, "violates": [ "1 <= s.length <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Since n is small, we can just check every substring, and if the substring is semi-repetitive, maximize the answer with its length." ] }, { "question_id": 2731, "task_id": "movement-of-robots", "drop": [], "similar": [ "last-moment-before-all-ants-fall-out-of-a-plank" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "s", "d" ], "tests": { "total": 110, "kept": 101, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "nums.length == s.length" ] }, { "line": 53, "end_line": 53, "violates": [ "nums.length == s.length" ] }, { "line": 58, "end_line": 58, "violates": [ "nums.length == s.length" ] }, { "line": 63, "end_line": 63, "violates": [ "nums.length == s.length" ] }, { "line": 82, "end_line": 82, "violates": [ "nums.length == s.length" ] }, { "line": 84, "end_line": 84, "violates": [ "nums.length == s.length" ] }, { "line": 86, "end_line": 86, "violates": [ "nums.length == s.length" ] }, { "line": 89, "end_line": 89, "violates": [ "nums.length == s.length" ] }, { "line": 93, "end_line": 93, "violates": [ "nums.length == s.length" ] } ], "unchecked_constraints": [ "nums[i] will be unique." ], "public_tests": 2, "hints": [ "Observe that if you ignore collisions, the resultant positions of robots after d seconds would be the same.", "After d seconds, sort the ending positions and use prefix sum to calculate the distance sum." ] }, { "question_id": 2732, "task_id": "find-a-good-subset-of-the-matrix", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 86, "kept": 59, "dropped": { "constraint_violation": 27 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= n <= 5" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= n <= 5" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= n <= 5" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= n <= 5" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= n <= 5" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= n <= 5" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= n <= 5" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= n <= 5" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= n <= 5" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= n <= 5" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= n <= 5" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= n <= 5" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= n <= 5" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= n <= 5" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= n <= 5" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= n <= 5" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= n <= 5" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= n <= 5" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= n <= 5" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= n <= 5" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= n <= 5" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= n <= 5" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= n <= 5" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= n <= 5" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= n <= 5" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= n <= 5" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= n <= 5" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "It can be proven, that if there exists a good subset of rows then there exists a good subset of rows with the size of either 1 or 2.", "To check if there exists a good subset of rows of size 1, we check if there exists a row containing only zeros, if it does, we return its index as a good subset.", "To check if there exists a good subset of rows of size 2, we iterate over two bit-masks, check if both are presented in the array and if they form a good subset, if they do, return their indices as a good subset." ] }, { "question_id": 2733, "task_id": "neither-minimum-nor-maximum", "drop": [], "similar": [ "third-maximum-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 94, "kept": 86, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 61, "end_line": 61, "violates": [ "All values in nums are distinct" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find any value in the array that is not the minimum or the maximum value." ] }, { "question_id": 2734, "task_id": "lexicographically-smallest-string-after-substring-operation", "drop": [], "similar": [ "shifting-letters", "lexicographically-smallest-string-after-applying-operations", "lexicographically-smallest-string-after-operations-with-constraint", "replace-question-marks-in-string-to-minimize-its-value" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 102, "kept": 101, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 99, "end_line": 99, "violates": [ "s consists of lowercase English letters" ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "When a character is replaced by the one that comes before it on the alphabet, it makes the string lexicographically smaller, except for \u2018a'.", "Find the leftmost substring that doesn\u2019t contain the character 'a' and change all characters in it." ] }, { "question_id": 2735, "task_id": "collecting-chocolates", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "x" ], "tests": { "total": 100, "kept": 98, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How many maximum rotations will be needed?", "The array will be rotated for a max of N times, so try all possibilities as N = 1000." ] }, { "question_id": 2736, "task_id": "maximum-sum-queries", "drop": [], "similar": [ "most-beautiful-item-for-each-query" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "queries" ], "tests": { "total": 78, "kept": 64, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= xi, yi <= 10**(9)" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= xi, yi <= 10**(9)" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= xi, yi <= 10**(9)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= xi, yi <= 10**(9)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= xi, yi <= 10**(9)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= xi, yi <= 10**(9)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= xi, yi <= 10**(9)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= xi, yi <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= xi, yi <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= xi, yi <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= xi, yi <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= xi, yi <= 10**(9)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= xi, yi <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= xi, yi <= 10**(9)" ] } ], "unchecked_constraints": [ "xi == queries[i][1]", "yi == queries[i][2]" ], "public_tests": 3, "hints": [ "Sort (x, y) tuples and queries by x-coordinate descending. Don\u2019t forget to index queries before sorting so that you can answer them in the correct order.", "Before answering a query (min_x, min_y), add all (x, y) pairs with x >= min_x to some data structure.", "Use a monotone descending map to store (y, x + y) pairs. A monotone map has ascending keys and descending values. When inserting a pair (y, x + y), remove all pairs (y', x' + y') with y' < y and x' + y' <= x + y.", "To find the insertion position use binary search (built-in in many languages).", "When querying for max (x + y) over y >= y', use binary search to find the first pair (y, x + y) with y >= y'. It will have the maximum value of x + y because the map has monotone descending values." ] }, { "question_id": 2737, "task_id": "find-the-closest-marked-node", "drop": [ "premium" ] }, { "question_id": 2739, "task_id": "total-distance-traveled", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "mainTank", "additionalTank" ], "tests": { "total": 79, "kept": 66, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= mainTank, additionalTank <= 100" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= mainTank, additionalTank <= 100" ] }, { "line": 7, "end_line": 7, "violates": [ "1 <= mainTank, additionalTank <= 100" ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= mainTank, additionalTank <= 100" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= mainTank, additionalTank <= 100" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= mainTank, additionalTank <= 100" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= mainTank, additionalTank <= 100" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= mainTank, additionalTank <= 100" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= mainTank, additionalTank <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= mainTank, additionalTank <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= mainTank, additionalTank <= 100" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= mainTank, additionalTank <= 100" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= mainTank, additionalTank <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Avoid calculations in decimal to prevent precision errors." ] }, { "question_id": 2740, "task_id": "find-the-value-of-the-partition", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 106, "kept": 105, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the array.", "The answer is min(nums[i+1] - nums[i]) for all i in the range [0, n-2]." ] }, { "question_id": 2741, "task_id": "special-permutations", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 99, "kept": 90, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 48, "end_line": 48, "violates": [ "2 <= nums.length <= 14" ] }, { "line": 51, "end_line": 51, "violates": [ "2 <= nums.length <= 14" ] }, { "line": 61, "end_line": 61, "violates": [ "2 <= nums.length <= 14" ] }, { "line": 66, "end_line": 66, "violates": [ "2 <= nums.length <= 14" ] }, { "line": 87, "end_line": 87, "violates": [ "2 <= nums.length <= 14" ] }, { "line": 96, "end_line": 96, "violates": [ "2 <= nums.length <= 14" ] }, { "line": 97, "end_line": 97, "violates": [ "2 <= nums.length <= 14" ] }, { "line": 98, "end_line": 98, "violates": [ "2 <= nums.length <= 14" ] }, { "line": 100, "end_line": 100, "violates": [ "2 <= nums.length <= 14" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we solve this problem using DP with bit masking?", "You just need two states in DP which are last_ind in the permutation and the mask of numbers already used." ] }, { "question_id": 2742, "task_id": "painting-the-walls", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "cost", "time" ], "tests": { "total": 93, "kept": 91, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 51, "end_line": 51, "violates": [ "1 <= time[i] <= 500" ] }, { "line": 75, "end_line": 75, "violates": [ "cost.length == time.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we break the problem down into smaller subproblems and use DP?", "If you pay for wall i, it contributes cost[i] and effectively covers time[i] + 1 walls: the paid wall itself plus up to time[i] walls that the free painter can paint while the paid painter works.", "Use DP over the number of walls covered, capped at n." ] }, { "question_id": 2743, "task_id": "count-substrings-without-repeating-character", "drop": [ "premium" ] }, { "question_id": 2744, "task_id": "find-maximum-number-of-string-pairs", "drop": [], "similar": [ "group-shifted-strings", "palindrome-pairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 65, "kept": 45, "dropped": { "constraint_violation": 20 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "words[i].length == 2", "words[i] contains only lowercase English letters." ] }, { "line": 28, "end_line": 28, "violates": [ "words[i].length == 2", "words[i] contains only lowercase English letters." ] }, { "line": 29, "end_line": 29, "violates": [ "words[i].length == 2", "words[i] contains only lowercase English letters." ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= words.length <= 50" ] }, { "line": 36, "end_line": 36, "violates": [ "words[i].length == 2" ] }, { "line": 37, "end_line": 37, "violates": [ "words[i].length == 2" ] }, { "line": 38, "end_line": 38, "violates": [ "words[i].length == 2" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= words.length <= 50" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= words.length <= 50" ] }, { "line": 43, "end_line": 43, "violates": [ "words[i].length == 2" ] }, { "line": 46, "end_line": 46, "violates": [ "words[i].length == 2", "words[i] contains only lowercase English letters." ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= words.length <= 50" ] }, { "line": 49, "end_line": 49, "violates": [ "words[i].length == 2" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= words.length <= 50" ] }, { "line": 54, "end_line": 54, "violates": [ "words[i].length == 2", "words[i] contains only lowercase English letters." ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= words.length <= 50" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= words.length <= 50" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= words.length <= 50" ] }, { "line": 64, "end_line": 64, "violates": [ "words[i].length == 2" ] }, { "line": 66, "end_line": 66, "violates": [ "words[i].length == 2" ] } ], "unchecked_constraints": [ "words consists of distinct strings." ], "public_tests": 3, "hints": [ "Notice that array words consist of distinct strings.", "Iterate over all indices (i, j) and check if they can be paired." ] }, { "question_id": 2745, "task_id": "construct-the-longest-new-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "x", "y", "z" ], "tests": { "total": 88, "kept": 85, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= x, y, z <= 50" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= x, y, z <= 50" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= x, y, z <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It can be proved that ALL \u201cAB\u201ds can be used in the optimal solution. (1) If the final string starts with 'A', we can put all unused \u201cAB\u201ds at the very beginning. (2) If the final string starts with 'B' (meaning) it starts with \u201cBB\u201d, we can put all unused \u201cAB\u201ds after the 2nd 'B'.", "Using \u201cAB\u201d doesn\u2019t increase the number of \u201cAA\u201ds or \u201cBB\u201ds we can use. If we put an \u201cAB\u201d after \u201cBB\u201d, then we still need to append \u201cAA\u201d as before, so it doesn\u2019t change the state.", "We only need to consider strings \u201cAA\u201d and \u201cBB\u201d; we can either use the pattern \u201cAABBAABB\u2026\u201d or the pattern \u201cBBAABBAA\u2026\u201d, depending on which one of x and y is larger." ] }, { "question_id": 2746, "task_id": "decremental-string-concatenation", "drop": [], "similar": [ "largest-merge-of-two-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 85, "kept": 85, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Each character in words[i] is an English lowercase letter" ], "public_tests": 3, "hints": [ "Use dynamic programming with memoization.", "Notice that the first and last characters of a string are sufficient to determine the length of its concatenation with any other string.", "Define dp[i][first][last] as the shortest concatenation length of the first i words starting with a character first and ending with a character last. Convert characters to their ASCII codes if your programming language cannot implicitly convert them to array indices." ] }, { "question_id": 2747, "task_id": "count-zero-request-servers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "logs", "x", "queries" ], "tests": { "total": 92, "kept": 59, "dropped": { "constraint_violation": 33 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 8, "end_line": 8, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 16, "end_line": 16, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 17, "end_line": 17, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 18, "end_line": 18, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 21, "end_line": 21, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 23, "end_line": 23, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 29, "end_line": 29, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 30, "end_line": 30, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 31, "end_line": 31, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 32, "end_line": 32, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 34, "end_line": 34, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 39, "end_line": 39, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 40, "end_line": 40, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 47, "end_line": 47, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 49, "end_line": 49, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 51, "end_line": 51, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 55, "end_line": 55, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 56, "end_line": 56, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 57, "end_line": 57, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 60, "end_line": 60, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 62, "end_line": 62, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 66, "end_line": 66, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 71, "end_line": 71, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 73, "end_line": 73, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 75, "end_line": 75, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 79, "end_line": 79, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 80, "end_line": 80, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 81, "end_line": 81, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 84, "end_line": 84, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 86, "end_line": 86, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 87, "end_line": 87, "violates": [ "x < queries[i] <= 10**(6)" ] }, { "line": 88, "end_line": 88, "violates": [ "x < queries[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use sorting and two-pointer approach here?", "Sort the queries array and logs array based on time in increasing order.", "For every window of size x, use sliding window and two-pointer approach to find the answer to the queries." ] }, { "question_id": 2748, "task_id": "number-of-beautiful-pairs", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 102, "kept": 66, "dropped": { "constraint_violation": 36 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 7, "end_line": 7, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 14, "end_line": 14, "violates": [ "nums[i] % 10 != 0", "nums[i] % 10 != 0" ] }, { "line": 20, "end_line": 20, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 23, "end_line": 23, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 25, "end_line": 25, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 28, "end_line": 28, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 32, "end_line": 32, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 9999" ] }, { "line": 34, "end_line": 34, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 9999", "nums[i] % 10 != 0" ] }, { "line": 41, "end_line": 41, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 46, "end_line": 46, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 9999" ] }, { "line": 48, "end_line": 48, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 49, "end_line": 49, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 52, "end_line": 52, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 9999" ] }, { "line": 56, "end_line": 56, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 57, "end_line": 57, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 60, "end_line": 60, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 66, "end_line": 66, "violates": [ "nums[i] % 10 != 0", "nums[i] % 10 != 0" ] }, { "line": 71, "end_line": 71, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 73, "end_line": 73, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 74, "end_line": 74, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 78, "end_line": 78, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 79, "end_line": 79, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 83, "end_line": 83, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 9999", "nums[i] % 10 != 0" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums[i] <= 9999", "nums[i] % 10 != 0" ] }, { "line": 90, "end_line": 90, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 9999" ] }, { "line": 98, "end_line": 98, "violates": [ "nums[i] % 10 != 0" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 9999", "nums[i] % 10 != 0" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 9999" ] }, { "line": 103, "end_line": 103, "violates": [ "nums[i] % 10 != 0" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Since nums.length is small, you can find all pairs of indices and check if each pair is beautiful.", "Use integer to string conversion to get the first and last digit of each number." ] }, { "question_id": 2749, "task_id": "minimum-operations-to-make-the-integer-zero", "drop": [], "similar": [ "broken-calculator", "minimum-operations-to-reduce-x-to-zero" ], "flags": [], "comparison": "exact", "parameter_names": [ "num1", "num2" ], "tests": { "total": 122, "kept": 108, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "1 <= num1 <= 10**(9)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= num1 <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= num1 <= 10**(9)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= num1 <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= num1 <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= num1 <= 10**(9)", "-10**(9) <= num2 <= 10**(9)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= num1 <= 10**(9)", "-10**(9) <= num2 <= 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= num1 <= 10**(9)", "-10**(9) <= num2 <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= num1 <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= num1 <= 10**(9)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= num1 <= 10**(9)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= num1 <= 10**(9)", "-10**(9) <= num2 <= 10**(9)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= num1 <= 10**(9)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= num1 <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If we want to make integer n equal to 0 by only subtracting powers of 2 from n, in how many operations can we achieve it?", "We need at least - the number of bits in the binary representation of n, and at most - n.", "Notice that, if it is possible to make num1 equal to 0, then we need at most 60 operations.", "Iterate on the number of operations." ] }, { "question_id": 2750, "task_id": "ways-to-split-array-into-good-subarrays", "drop": [], "similar": [ "binary-subarrays-with-sum", "count-number-of-nice-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 87, "kept": 87, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If the array consists of only 0s answer is 0.", "In the final split, exactly one separation point exists between two consecutive 1s.", "In how many ways can separation points be put?" ] }, { "question_id": 2751, "task_id": "robot-collisions", "drop": [], "similar": [ "asteroid-collision" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "positions", "healths", "directions" ], "tests": { "total": 138, "kept": 135, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 40, "end_line": 40, "violates": [ "1 <= positions.length == healths.length == directions.length == n <= 10**(5)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= positions.length == healths.length == directions.length == n <= 10**(5)" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= positions.length == healths.length == directions.length == n <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Process the robots in the order of their positions to ensure that we process the collisions correctly.", "To optimize the solution, use a stack to keep track of the surviving robots as we iterate through the positions.", "Instead of simulating each collision, check the current robot against the top of the stack (if it exists) to determine if a collision occurs." ] }, { "question_id": 2760, "task_id": "longest-even-odd-subarray-with-threshold", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "threshold" ], "tests": { "total": 124, "kept": 121, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Brute force all the possible subarrays and find the longest that satisfies the conditions." ] }, { "question_id": 2761, "task_id": "prime-pairs-with-target-sum", "drop": [], "similar": [ "count-primes" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 52, "kept": 51, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 46, "end_line": 46, "violates": [ "1 <= n <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Pre-compute all the prime numbers in the range [1, n] using a sieve, and store them in a data structure where they can be accessed in O(1) time.", "For x in the range [2, n/2], we can use the pre-computed list of prime numbers to check if both x and n - x are primes. If they are, we add them to the result." ] }, { "question_id": 2762, "task_id": "continuous-subarrays", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 234, "kept": 221, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 135, "end_line": 135, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 142, "end_line": 142, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 177, "end_line": 177, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 178, "end_line": 178, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 191, "end_line": 191, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 203, "end_line": 203, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try using the sliding window technique.", "Use a set or map to keep track of the maximum and minimum of subarrays." ] }, { "question_id": 2763, "task_id": "sum-of-imbalance-numbers-of-all-subarrays", "drop": [], "similar": [ "count-subarrays-with-median-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 181, "kept": 143, "dropped": { "constraint_violation": 38 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= nums[i] <= nums.length", "1 <= nums[i] <= nums.length" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 132, "end_line": 132, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 135, "end_line": 135, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 136, "end_line": 136, "violates": [ "1 <= nums[i] <= nums.length", "1 <= nums[i] <= nums.length" ] }, { "line": 137, "end_line": 137, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 143, "end_line": 143, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 146, "end_line": 146, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 152, "end_line": 152, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 153, "end_line": 153, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 156, "end_line": 156, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 159, "end_line": 159, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 162, "end_line": 162, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 169, "end_line": 169, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 178, "end_line": 178, "violates": [ "1 <= nums[i] <= nums.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate over all subarrays in a nested fashion. Namely, for each left endpoint, start from nums[left] and add elements nums[left + 1], nums[left + 2], etc.", "To keep track of the imbalance value, maintain a set of added elements.", "Increment the imbalance value whenever a new number is not adjacent (+/- 1) to other old numbers. For example, when you add 3 to [1, 5], or when you add 5 to [1, 3]. For a formal proof, consider three cases: new value is (i) largest, (ii) smallest, (iii) between two old numbers.", "Decrement the imbalance value whenever a new number is adjacent (+/- 1) to two old numbers. For example, when you add 3 to [2, 4]. The imbalance value does not change in the case of one adjacent old number." ] }, { "question_id": 2764, "task_id": "is-array-a-preorder-of-some-binary-tree", "drop": [ "premium" ] }, { "question_id": 2765, "task_id": "longest-alternating-subarray", "drop": [], "similar": [ "longest-turbulent-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 157, "kept": 156, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "As the constraints are low, you can check each subarray for the given condition." ] }, { "question_id": 2766, "task_id": "relocate-marbles", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "moveFrom", "moveTo" ], "tests": { "total": 97, "kept": 97, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The test cases are generated such that there is at least a marble in moveFrom[i] at the moment we want to apply the i**(th) move." ], "public_tests": 2, "hints": [ "Can we solve this problem using a set or map?", "Sequentially process pairs from moveFrom[i] and moveTo[i]. In each step, remove the occurrence of moveFrom[i] and add moveTo[i] into the set." ] }, { "question_id": 2767, "task_id": "partition-string-into-minimum-beautiful-substrings", "drop": [], "similar": [ "partition-array-for-maximum-sum", "minimum-substring-partition-of-equal-character-frequency" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 148, "kept": 95, "dropped": { "constraint_violation": 53 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= s.length <= 15" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= s.length <= 15" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= s.length <= 15" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= s.length <= 15" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= s.length <= 15" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= s.length <= 15" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= s.length <= 15" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= s.length <= 15" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= s.length <= 15" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= s.length <= 15" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= s.length <= 15" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= s.length <= 15" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= s.length <= 15" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= s.length <= 15" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= s.length <= 15" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= s.length <= 15" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= s.length <= 15" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= s.length <= 15" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= s.length <= 15" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= s.length <= 15" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= s.length <= 15" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= s.length <= 15" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= s.length <= 15" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= s.length <= 15" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= s.length <= 15" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= s.length <= 15" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= s.length <= 15" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= s.length <= 15" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= s.length <= 15" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= s.length <= 15" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= s.length <= 15" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= s.length <= 15" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= s.length <= 15" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= s.length <= 15" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= s.length <= 15" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= s.length <= 15" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= s.length <= 15" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= s.length <= 15" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= s.length <= 15" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= s.length <= 15" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= s.length <= 15" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= s.length <= 15" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= s.length <= 15" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= s.length <= 15" ] }, { "line": 132, "end_line": 132, "violates": [ "1 <= s.length <= 15" ] }, { "line": 134, "end_line": 134, "violates": [ "1 <= s.length <= 15" ] }, { "line": 136, "end_line": 136, "violates": [ "1 <= s.length <= 15" ] }, { "line": 138, "end_line": 138, "violates": [ "1 <= s.length <= 15" ] }, { "line": 140, "end_line": 140, "violates": [ "1 <= s.length <= 15" ] }, { "line": 142, "end_line": 142, "violates": [ "1 <= s.length <= 15" ] }, { "line": 144, "end_line": 144, "violates": [ "1 <= s.length <= 15" ] }, { "line": 146, "end_line": 146, "violates": [ "1 <= s.length <= 15" ] }, { "line": 147, "end_line": 147, "violates": [ "1 <= s.length <= 15" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "To check if number x is a power of 5 or not, we will divide x by 5 while x > 1 and x mod 5 == 0. After iteration if x == 1, then it was a power of 5.", "Since the constraint of s.length is small, we can use recursion to find all the partitions." ] }, { "question_id": 2768, "task_id": "number-of-black-blocks", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n", "coordinates" ], "tests": { "total": 72, "kept": 71, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "0 <= coordinates[i][1] < n" ] } ], "unchecked_constraints": [ "It is guaranteed that coordinates contains pairwise distinct coordinates." ], "public_tests": 2, "hints": [ "The number of blocks is too much but the number of black cells is less than that.", "It means the number of blocks with at least one black cell is O(|coordinates|). let\u2019s just hold them.", "Iterate through the coordinates and update the block counts accordingly. For each coordinate, determine which block(s) it belongs to and increment the count of black cells for those block(s).", "After processing all the coordinates, count the number of blocks with different numbers of black cells. You can use another data structure to keep track of the counts of blocks with 0 black cells, 1 black cell, and so on." ] }, { "question_id": 2769, "task_id": "find-the-maximum-achievable-number", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "num", "t" ], "tests": { "total": 82, "kept": 82, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let x be the answer, it\u2019s always optimal to decrease x in each operation and increase nums." ] }, { "question_id": 2770, "task_id": "maximum-number-of-jumps-to-reach-the-last-index", "drop": [], "similar": [ "jump-game-ii", "frog-jump", "jump-game-iii", "jump-game-iv", "minimum-jumps-to-reach-home", "jump-game-vii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 141, "kept": 141, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a dynamic programming approach.", "Define a dynamic programming array dp of size n, where dp[i] represents the maximum number of jumps from index 0 to index i.", "For each j iterate over all i < j. Set dp[j] = max(dp[j], dp[i] + 1) if -target <= nums[j] - nums[i] <= target." ] }, { "question_id": 2771, "task_id": "longest-non-decreasing-subarray-from-two-arrays", "drop": [], "similar": [ "russian-doll-envelopes", "maximum-length-of-pair-chain" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 125, "kept": 122, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(9)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(9)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Consider using dynamic programming.", "Let dp[i][0] (dp[i][1]) be the length of the longest non-decreasing ending with nums1[i] (nums2[i]).", "Initialize dp[i][0] to 1. If nums1[i] >= nums1[i - 1] then dp[i][0] may be dp[i - 1][0] + 1. If nums1[i] >= nums2[i - 1] then dp[i][0] may be dp[i - 1][1] + 1. Perform a similar calculation for nums2[i] and dp[i][1]." ] }, { "question_id": 2772, "task_id": "apply-operations-to-make-all-array-elements-equal-to-zero", "drop": [], "similar": [ "continuous-subarray-sum", "number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 101, "kept": 101, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "In case it is possible, then how can you do the operations? which subarrays do you choose and in what order?", "The order of the chosen subarrays should be from the left to the right of the array" ] }, { "question_id": 2773, "task_id": "height-of-special-binary-tree", "drop": [ "premium" ] }, { "question_id": 2778, "task_id": "sum-of-squares-of-special-elements", "drop": [], "similar": [ "sum-of-square-numbers", "sum-of-all-odd-length-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 105, "kept": 40, "dropped": { "constraint_violation": 65 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums.length == n <= 50" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums.length == n <= 50", "1 <= nums[i] <= 50" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums.length == n <= 50" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums.length == n <= 50", "1 <= nums[i] <= 50" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate over all the elements of the array. For each index i, check if it is special using the modulo operator.", "if n%i == 0, index i is special and you should add nums[i] to the answer." ] }, { "question_id": 2779, "task_id": "maximum-beauty-of-an-array-after-applying-operation", "drop": [], "similar": [ "maximum-size-subarray-sum-equals-k", "partition-array-such-that-maximum-difference-is-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 119, "kept": 119, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the array.", "The problem becomes the following: find maximum subarray A[i \u2026 j] such that A[j] - A[i] \u2264 2 * k." ] }, { "question_id": 2780, "task_id": "minimum-index-of-a-valid-split", "drop": [], "similar": [ "majority-element", "partition-array-into-disjoint-intervals" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 12, "kept": 12, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "nums has exactly one dominant element." ], "public_tests": 3, "hints": [ "Find the dominant element of nums by using a hashmap to maintain element frequency, we denote the dominant element as x and its frequency as f.", "For each index in [0, n - 2], calculate f1, x\u2019s frequency in the subarray [0, i] when looping the index. And f2, x\u2019s frequency in the subarray [i + 1, n - 1] which is equal to f - f1. Then we can check whether x is dominant in both subarrays." ] }, { "question_id": 2781, "task_id": "length-of-the-longest-valid-substring", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "word", "forbidden" ], "tests": { "total": 76, "kept": 75, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= forbidden[i].length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 2782, "task_id": "number-of-unique-categories", "drop": [ "premium" ] }, { "question_id": 2784, "task_id": "check-if-array-is-good", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 120, "kept": 111, "dropped": { "constraint_violation": 8, "unreadable": 1 } }, "dropped_tests": [ { "line": 45, "end_line": 45, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 104, "end_line": 104, "unreadable": true }, { "line": 118, "end_line": 118, "violates": [ "1 <= nums.length <= 100" ] } ], "unchecked_constraints": [ "1 <= num[i] <= 200" ], "public_tests": 4, "hints": [ "Find the maximum element of the array." ] }, { "question_id": 2785, "task_id": "sort-vowels-in-a-string", "drop": [], "similar": [ "reverse-vowels-of-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 150, "kept": 143, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= s.length <= 10**(5)" ] }, { "line": 47, "end_line": 47, "violates": [ "s consists only of letters of the English alphabet in uppercase and lowercase." ] }, { "line": 49, "end_line": 49, "violates": [ "s consists only of letters of the English alphabet in uppercase and lowercase." ] }, { "line": 55, "end_line": 55, "violates": [ "s consists only of letters of the English alphabet in uppercase and lowercase." ] }, { "line": 77, "end_line": 77, "violates": [ "s consists only of letters of the English alphabet in uppercase and lowercase." ] }, { "line": 124, "end_line": 124, "violates": [ "s consists only of letters of the English alphabet in uppercase and lowercase." ] }, { "line": 134, "end_line": 134, "violates": [ "s consists only of letters of the English alphabet in uppercase and lowercase." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Add all the vowels in an array and sort the array.", "Replace characters in string s if it's a vowel from the new array." ] }, { "question_id": 2786, "task_id": "visit-array-positions-to-maximize-score", "drop": [], "similar": [ "jump-game-ii", "stone-game" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "x" ], "tests": { "total": 109, "kept": 106, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i], x <= 10**(6)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i], x <= 10**(6)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i], x <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How can we use dynamic programming to solve the problem?", "Let dp[i] be the answer to the subarray nums[0\u2026i]. What are the transitions of this dp?" ] }, { "question_id": 2787, "task_id": "ways-to-express-an-integer-as-sum-of-powers", "drop": [], "similar": [ "perfect-squares", "combination-sum-iv", "target-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "x" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "You can use dynamic programming, where dp[k][j] represents the number of ways to express k as the sum of the x-th power of unique positive integers such that the biggest possible number we use is j.", "To calculate dp[k][j], you can iterate over the numbers smaller than j and try to use each one as a power of x to make our sum k." ] }, { "question_id": 2788, "task_id": "split-strings-by-separator", "drop": [], "similar": [ "split-a-string-in-balanced-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "words", "separator" ], "tests": { "total": 138, "kept": 115, "dropped": { "constraint_violation": 23 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 130, "end_line": 130, "violates": [ "1 <= words[i].length <= 20" ] }, { "line": 138, "end_line": 138, "violates": [ "1 <= words[i].length <= 20" ] } ], "unchecked_constraints": [ "characters in words[i] are either lowercase English letters or characters from the string \".,|$#@\" (excluding the quotes)", "separator is a character from the string \".,|$#@\" (excluding the quotes)" ], "public_tests": 3, "hints": [ "Iterate over each string in the given array using a loop and perform string splitting based on the provided separator character.", "Be sure not to return empty strings." ] }, { "question_id": 2789, "task_id": "largest-element-in-an-array-after-merge-operations", "drop": [], "similar": [ "jump-game", "house-robber", "get-maximum-in-generated-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 124, "kept": 124, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Start from the end of the array and keep merging elements together until it is no longer possible.", "The answer will be the resulting element from the last merge operation." ] }, { "question_id": 2790, "task_id": "maximum-number-of-groups-with-increasing-length", "drop": [], "similar": [ "group-the-people-given-the-group-size-they-belong-to" ], "flags": [], "comparison": "exact", "parameter_names": [ "usageLimits" ], "tests": { "total": 70, "kept": 70, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we solve this problem using sorting and binary search?", "Sort the array in increasing order and run a binary search on the number of groups, x.", "To determine if a value x is feasible, greedily distribute the numbers such that each group receives 1, 2, 3, ..., x numbers." ] }, { "question_id": 2791, "task_id": "count-paths-that-can-form-a-palindrome-in-a-tree", "drop": [ "too_few_tests" ], "similar": [ "count-valid-paths-in-a-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "parent", "s" ], "tests": { "total": 49, "kept": 9, "dropped": { "constraint_violation": 40 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "n == parent.length == s.length" ] }, { "line": 9, "end_line": 9, "violates": [ "n == parent.length == s.length" ] }, { "line": 10, "end_line": 10, "violates": [ "n == parent.length == s.length" ] }, { "line": 11, "end_line": 11, "violates": [ "n == parent.length == s.length" ] }, { "line": 12, "end_line": 12, "violates": [ "n == parent.length == s.length" ] }, { "line": 13, "end_line": 13, "violates": [ "n == parent.length == s.length" ] }, { "line": 14, "end_line": 14, "violates": [ "n == parent.length == s.length" ] }, { "line": 15, "end_line": 15, "violates": [ "n == parent.length == s.length" ] }, { "line": 16, "end_line": 16, "violates": [ "n == parent.length == s.length" ] }, { "line": 17, "end_line": 17, "violates": [ "n == parent.length == s.length" ] }, { "line": 18, "end_line": 18, "violates": [ "n == parent.length == s.length" ] }, { "line": 19, "end_line": 19, "violates": [ "n == parent.length == s.length" ] }, { "line": 21, "end_line": 21, "violates": [ "n == parent.length == s.length" ] }, { "line": 22, "end_line": 22, "violates": [ "n == parent.length == s.length" ] }, { "line": 23, "end_line": 23, "violates": [ "n == parent.length == s.length" ] }, { "line": 24, "end_line": 24, "violates": [ "n == parent.length == s.length" ] }, { "line": 25, "end_line": 25, "violates": [ "n == parent.length == s.length" ] }, { "line": 26, "end_line": 26, "violates": [ "n == parent.length == s.length" ] }, { "line": 27, "end_line": 27, "violates": [ "n == parent.length == s.length" ] }, { "line": 28, "end_line": 28, "violates": [ "n == parent.length == s.length" ] }, { "line": 29, "end_line": 29, "violates": [ "n == parent.length == s.length" ] }, { "line": 30, "end_line": 30, "violates": [ "n == parent.length == s.length" ] }, { "line": 31, "end_line": 31, "violates": [ "n == parent.length == s.length" ] }, { "line": 32, "end_line": 32, "violates": [ "n == parent.length == s.length" ] }, { "line": 33, "end_line": 33, "violates": [ "n == parent.length == s.length" ] }, { "line": 34, "end_line": 34, "violates": [ "n == parent.length == s.length" ] }, { "line": 35, "end_line": 35, "violates": [ "n == parent.length == s.length" ] }, { "line": 36, "end_line": 36, "violates": [ "n == parent.length == s.length" ] }, { "line": 38, "end_line": 38, "violates": [ "n == parent.length == s.length" ] }, { "line": 39, "end_line": 39, "violates": [ "n == parent.length == s.length" ] }, { "line": 41, "end_line": 41, "violates": [ "n == parent.length == s.length" ] }, { "line": 42, "end_line": 42, "violates": [ "n == parent.length == s.length" ] }, { "line": 43, "end_line": 43, "violates": [ "n == parent.length == s.length" ] }, { "line": 44, "end_line": 44, "violates": [ "n == parent.length == s.length" ] }, { "line": 45, "end_line": 45, "violates": [ "n == parent.length == s.length" ] }, { "line": 46, "end_line": 46, "violates": [ "n == parent.length == s.length" ] }, { "line": 47, "end_line": 47, "violates": [ "n == parent.length == s.length" ] }, { "line": 48, "end_line": 48, "violates": [ "n == parent.length == s.length" ] }, { "line": 49, "end_line": 49, "violates": [ "n == parent.length == s.length" ] }, { "line": 50, "end_line": 50, "violates": [ "n == parent.length == s.length" ] } ], "unchecked_constraints": [ "0 <= parent[i] <= n - 1 for all i >= 1", "parent represents a valid tree." ] }, { "question_id": 2792, "task_id": "count-nodes-that-are-great-enough", "drop": [ "premium" ] }, { "question_id": 2798, "task_id": "number-of-employees-who-met-the-target", "drop": [], "similar": [ "minimum-operations-to-exceed-threshold-value-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "hours", "target" ], "tests": { "total": 103, "kept": 100, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 61, "end_line": 61, "violates": [ "1 <= n == hours.length <= 50" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= n == hours.length <= 50" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= n == hours.length <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate over the elements of array hours and check if the value is greater than or equal to target." ] }, { "question_id": 2799, "task_id": "count-complete-subarrays-in-an-array", "drop": [], "similar": [ "longest-substring-without-repeating-characters", "subarrays-with-k-different-integers" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let\u2019s say k is the number of distinct elements in the array. Our goal is to find the number of subarrays with k distinct elements.", "Since the constraints are small, you can check every subarray." ] }, { "question_id": 2800, "task_id": "shortest-string-that-contains-three-strings", "drop": [], "similar": [ "shortest-common-supersequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "a", "b", "c" ], "tests": { "total": 111, "kept": 111, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Think about how you can generate all possible strings that contain all three input strings as substrings. Can you come up with an efficient algorithm to do this?", "Check all permutations of the words a, b, and c. For each permutation, begin by appending some letters to the end of the first word to form the second word. Then, proceed to add more letters to generate the third word." ] }, { "question_id": 2801, "task_id": "count-stepping-numbers-in-range", "drop": [], "similar": [ "stepping-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "low", "high" ], "tests": { "total": 101, "kept": 100, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 65, "end_line": 65, "violates": [ "1 <= int(low) <= int(high) < 10**(100)" ] } ], "unchecked_constraints": [ "low and high don't have any leading zeros." ], "public_tests": 2, "hints": [ "Calculate the number of stepping numbers in the range [1, high] and subtract the number of stepping numbers in the range [1, low - 1].", "The main problem is calculating the number of stepping numbers in the range [1, x].", "First, calculate the number of stepping numbers shorter than x in length, which can be done using dynamic programming. (dp[i][j] is the number of i-digit stepping numbers ending with digit j).", "Finally, calculate the number of stepping numbers that have the same length as x similarly. However, this time we need to maintain whether the prefix (in string) is smaller than or equal to x in the DP state." ] }, { "question_id": 2802, "task_id": "find-the-k-th-lucky-number", "drop": [ "premium" ] }, { "question_id": 2806, "task_id": "account-balance-after-rounded-purchase", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "purchaseAmount" ], "tests": { "total": 54, "kept": 54, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "To determine the nearest multiple of 10, we can brute force the rounded amount since there are at most 100 options. In case of multiple nearest multiples, choose the largest.", "Another solution is observing that the rounded amount is floor((purchaseAmount + 5) / 10) * 10. Using this formula, we can calculate the account balance without having to brute force the rounded amount." ] }, { "question_id": 2807, "task_id": "insert-greatest-common-divisors-in-linked-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "reverse-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the list is in the range [1, 5000].", "1 <= Node.val <= 1000" ] }, { "question_id": 2808, "task_id": "minimum-seconds-to-equalize-a-circular-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 116, "kept": 111, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For every possible x - the final value of the array, calculate the number of seconds needed to make all elements equal to x.", "Notice that if you take two consecutive occurrences (i, j) of x, then the number of operations to make segment [i + 1, j - 1] equal to x is floor((j - i) / 2)" ] }, { "question_id": 2809, "task_id": "minimum-time-to-make-array-sum-at-most-x", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "x" ], "tests": { "total": 111, "kept": 111, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It can be proven that in the optimal solution, for each index i, we only need to set nums1[i] to 0 at most once. (If we have to set it twice, we can simply remove the earlier set and all the operations \u201cshift left\u201d by 1.)", "It can also be proven that if we select several indexes i_1, i_2, ..., i_k and set nums1[i_1], nums1[i_2], ..., nums1[i_k] to 0, it\u2019s always optimal to set them in the order of nums2[i_1] <= nums2[i_2] <= ... <= nums2[i_k] (the larger the increase is, the later we should set it to 0).", "Let\u2019s sort all the values by nums2 (in non-decreasing order). Let dp[i][j] represent the maximum total value that can be reduced if we do j operations on the first i elements. Then we have dp[i][0] = 0 (for all i = 0, 1, ..., n) and dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - 1] + nums2[i - 1] * j + nums1[i - 1]) (for 1 <= i <= n and 1 <= j <= i).", "The answer is the minimum value of t, such that 0 <= t <= n and sum(nums1) + sum(nums2) * t - dp[n][t] <= x, or -1 if it doesn\u2019t exist." ] }, { "question_id": 2810, "task_id": "faulty-keyboard", "drop": [], "similar": [ "reverse-vowels-of-a-string", "reverse-string-ii", "reverse-only-letters", "find-the-original-typed-string-i", "find-the-original-typed-string-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 171, "kept": 141, "dropped": { "constraint_violation": 30 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "s[0] != 'i'" ] }, { "line": 14, "end_line": 14, "violates": [ "s[0] != 'i'" ] }, { "line": 16, "end_line": 16, "violates": [ "s[0] != 'i'" ] }, { "line": 17, "end_line": 17, "violates": [ "s[0] != 'i'" ] }, { "line": 24, "end_line": 24, "violates": [ "s[0] != 'i'" ] }, { "line": 33, "end_line": 33, "violates": [ "s[0] != 'i'" ] }, { "line": 41, "end_line": 41, "violates": [ "s[0] != 'i'" ] }, { "line": 43, "end_line": 43, "violates": [ "s[0] != 'i'" ] }, { "line": 52, "end_line": 52, "violates": [ "s[0] != 'i'" ] }, { "line": 54, "end_line": 54, "violates": [ "s[0] != 'i'" ] }, { "line": 67, "end_line": 67, "violates": [ "s[0] != 'i'" ] }, { "line": 70, "end_line": 70, "violates": [ "s[0] != 'i'" ] }, { "line": 72, "end_line": 72, "violates": [ "s[0] != 'i'" ] }, { "line": 79, "end_line": 79, "violates": [ "s[0] != 'i'" ] }, { "line": 93, "end_line": 93, "violates": [ "s[0] != 'i'" ] }, { "line": 96, "end_line": 96, "violates": [ "s[0] != 'i'" ] }, { "line": 105, "end_line": 105, "violates": [ "s[0] != 'i'" ] }, { "line": 114, "end_line": 114, "violates": [ "s[0] != 'i'" ] }, { "line": 116, "end_line": 116, "violates": [ "s[0] != 'i'" ] }, { "line": 124, "end_line": 124, "violates": [ "s[0] != 'i'" ] }, { "line": 131, "end_line": 131, "violates": [ "s[0] != 'i'" ] }, { "line": 144, "end_line": 144, "violates": [ "s[0] != 'i'" ] }, { "line": 149, "end_line": 149, "violates": [ "s[0] != 'i'" ] }, { "line": 155, "end_line": 155, "violates": [ "s[0] != 'i'" ] }, { "line": 156, "end_line": 156, "violates": [ "s[0] != 'i'" ] }, { "line": 160, "end_line": 160, "violates": [ "s[0] != 'i'" ] }, { "line": 165, "end_line": 165, "violates": [ "s[0] != 'i'" ] }, { "line": 166, "end_line": 166, "violates": [ "s[0] != 'i'" ] }, { "line": 168, "end_line": 168, "violates": [ "s[0] != 'i'" ] }, { "line": 169, "end_line": 169, "violates": [ "s[0] != 'i'" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to build a new string by traversing the given string and reversing whenever you get the character \u2018i\u2019." ], "similar_to_test": [ "3330 find-the-original-typed-string-i", "3333 find-the-original-typed-string-ii" ] }, { "question_id": 2811, "task_id": "check-if-it-is-possible-to-split-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "m" ], "tests": { "total": 113, "kept": 108, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 100", "1 <= m <= 200" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 100", "1 <= m <= 200" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 100", "1 <= m <= 200" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= n == nums.length <= 100" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 100", "1 <= m <= 200" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "It can be proven that if you can split more than one element as a subarray, then you can split exactly one element." ] }, { "question_id": 2812, "task_id": "find-the-safest-path-in-a-grid", "drop": [], "similar": [ "path-with-minimum-effort" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 66, "kept": 65, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "grid[i].length == n" ] } ], "unchecked_constraints": [ "There is at least one thief in the grid." ], "public_tests": 3, "hints": [ "Consider using both BFS and binary search together.", "Launch a BFS starting from all the cells containing thieves to calculate d[x][y] which is the smallest Manhattan distance from (x, y) to the nearest grid that contains thieves.", "To check if the bottom-right cell of the grid can be reached through a path of safeness factor v, eliminate all cells (x, y) such that grid[x][y] < v. if (0, 0) and (n - 1, n - 1) are still connected, there exists a path between (0, 0) and (n - 1, n - 1) of safeness factor v.", "Binary search over the final safeness factor v." ] }, { "question_id": 2813, "task_id": "maximum-elegance-of-a-k-length-subsequence", "drop": [], "similar": [ "ipo" ], "flags": [], "comparison": "exact", "parameter_names": [ "items", "k" ], "tests": { "total": 112, "kept": 105, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= categoryi <= n" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= categoryi <= n" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= categoryi <= n" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= categoryi <= n" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= profiti <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= categoryi <= n" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= categoryi <= n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Greedy algorithm.", "Sort items in non-increasing order of profits.", "Select the first k items (the top k most profitable items). Keep track of the items as the candidate set.", "For the remaining n - k items sorted in non-increasing order of profits, try replacing an item in the candidate set using the current item.", "The replacing item should add a new category to the candidate set and should remove the item with the minimum profit that occurs more than once in the candidate set." ] }, { "question_id": 2814, "task_id": "minimum-time-takes-to-reach-destination-without-drowning", "drop": [ "premium" ] }, { "question_id": 2815, "task_id": "max-pair-sum-in-an-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 126, "kept": 79, "dropped": { "constraint_violation": 47 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the largest and second largest element with maximum digits equal to x where 1<=x<=9." ] }, { "question_id": 2816, "task_id": "double-a-number-represented-as-a-linked-list", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "add-two-numbers", "plus-one-linked-list" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "head" ], "tests": { "total": 0, "kept": 0, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The number of nodes in the list is in the range [1, 10**(4)]", "0 <= Node.val <= 9", "The input is generated such that the list represents a number that does not have leading zeros, except the number 0 itself." ] }, { "question_id": 2817, "task_id": "minimum-absolute-difference-between-elements-with-constraint", "drop": [], "similar": [ "k-diff-pairs-in-an-array", "find-all-k-distant-indices-in-an-array", "find-indices-with-index-and-value-difference-i", "find-indices-with-index-and-value-difference-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "x" ], "tests": { "total": 213, "kept": 203, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 134, "end_line": 134, "violates": [ "0 <= x < nums.length" ] }, { "line": 139, "end_line": 139, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 157, "end_line": 157, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 180, "end_line": 180, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let's only consider the cases where i < j, as the problem is symmetric.", "For an index j, we are interested in an index i in the range [0, j - x] that minimizes abs(nums[i] - nums[j]).", "For every index j, while going from left to right, add nums[j - x] to a set (C++ set, Java TreeSet, and Python sorted set).", "After inserting nums[j - x], we can calculate the closest value to nums[j] in the set using binary search and store the absolute difference. In C++, we can achieve this by using lower_bound and/or upper_bound.", "Calculate the minimum absolute difference among all indices." ] }, { "question_id": 2819, "task_id": "minimum-relative-loss-after-buying-chocolates", "drop": [ "premium" ] }, { "question_id": 2824, "task_id": "count-pairs-whose-sum-is-less-than-target", "drop": [], "similar": [ "two-sum", "count-the-number-of-fair-pairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 112, "kept": 93, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 13, "end_line": 13, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 20, "end_line": 20, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 21, "end_line": 21, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums.length == n <= 50" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums.length == n <= 50" ] }, { "line": 58, "end_line": 58, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 60, "end_line": 60, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 65, "end_line": 65, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 66, "end_line": 66, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 73, "end_line": 73, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 74, "end_line": 74, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 78, "end_line": 78, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums.length == n <= 50" ] }, { "line": 87, "end_line": 87, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 89, "end_line": 89, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 102, "end_line": 102, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 106, "end_line": 106, "violates": [ "-50 <= nums[i], target <= 50" ] }, { "line": 110, "end_line": 110, "violates": [ "-50 <= nums[i], target <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The constraints are small enough for a brute-force solution to pass" ] }, { "question_id": 2825, "task_id": "make-string-a-subsequence-using-cyclic-increments", "drop": [], "similar": [ "is-subsequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "str1", "str2" ], "tests": { "total": 153, "kept": 137, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 40, "end_line": 40, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 53, "end_line": 53, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 65, "end_line": 65, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 66, "end_line": 66, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 67, "end_line": 67, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 104, "end_line": 104, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 117, "end_line": 117, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 119, "end_line": 119, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 129, "end_line": 129, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 131, "end_line": 131, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 132, "end_line": 132, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 141, "end_line": 141, "violates": [ "1 <= str2.length <= 10**(5)" ] }, { "line": 145, "end_line": 145, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 147, "end_line": 147, "violates": [ "str1 and str2 consist of only lowercase English letters." ] }, { "line": 150, "end_line": 150, "violates": [ "str1 and str2 consist of only lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Consider the indices we will increment separately.", "We can maintain two pointers: pointer i for str1 and pointer j for str2, while ensuring they remain within the bounds of the strings.", "If both str1[i] and str2[j] match, or if incrementing str1[i] matches str2[j], we increase both pointers; otherwise, we increment only pointer i.", "It is possible to make str2 a subsequence of str1 if j is at the end of str2, after we can no longer find a match." ] }, { "question_id": 2826, "task_id": "sorting-three-groups", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 131, "kept": 131, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The problem asks to change the array nums to make it sorted (i.e., all the 1s are on the left of 2s, and all the 2s are on the left of 3s.).", "We can try all the possibilities to make nums indices range in [0, i) to 0 and [i, j) to 1 and [j, n) to 2. Note the ranges are left-close and right-open; each might be empty. Namely, 0 <= i <= j <= n.", "Count the changes we need for each possibility by comparing the expected and original values at each index position." ] }, { "question_id": 2827, "task_id": "number-of-beautiful-integers-in-the-range", "drop": [], "similar": [ "count-numbers-with-non-decreasing-digits", "count-evenly-good-integers" ], "flags": [], "comparison": "exact", "parameter_names": [ "low", "high", "k" ], "tests": { "total": 99, "kept": 97, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 60, "end_line": 60, "violates": [ "0 < k <= 20" ] }, { "line": 85, "end_line": 85, "violates": [ "0 < k <= 20" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The intended solution uses Dynamic Programming.", "Let f(n) denote number of beautiful integers in the range [1\u2026n] , then the answer is f(r) - f(l-1) ." ] }, { "question_id": 2828, "task_id": "check-if-a-string-is-an-acronym-of-words", "drop": [], "similar": [ "word-abbreviation" ], "flags": [], "comparison": "exact", "parameter_names": [ "words", "s" ], "tests": { "total": 129, "kept": 97, "dropped": { "constraint_violation": 32 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 129, "end_line": 129, "violates": [ "1 <= words[i].length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Concatenate the first characters of the strings in words, and compare the resulting concatenation to s." ] }, { "question_id": 2829, "task_id": "determine-the-minimum-sum-of-a-k-avoiding-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 77, "kept": 75, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 56, "end_line": 56, "violates": [ "1 <= n, k <= 50" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= n, k <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to start with the smallest possible integers.", "Check if the current number can be added to the array.", "To check if the current number can be added, keep track of already added numbers in a set.", "If the number i is added to the array, then i + k can not be added." ] }, { "question_id": 2830, "task_id": "maximize-the-profit-as-the-salesman", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "offers" ], "tests": { "total": 90, "kept": 75, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "0 <= starti <= endi <= n - 1" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= starti <= endi <= n - 1" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= starti <= endi <= n - 1" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= starti <= endi <= n - 1" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= starti <= endi <= n - 1" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= starti <= endi <= n - 1" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= starti <= endi <= n - 1" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= starti <= endi <= n - 1" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= goldi <= 10**(3)" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= starti <= endi <= n - 1" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= starti <= endi <= n - 1" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= starti <= endi <= n - 1" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= goldi <= 10**(3)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= goldi <= 10**(3)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= goldi <= 10**(3)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The intended solution uses a dynamic programming approach to solve the problem.", "Sort the array offers by start_i.", "Let dp[i] = { the maximum amount of gold if the sold houses are in the range [0 \u2026 i] }." ] }, { "question_id": 2831, "task_id": "find-the-longest-equal-subarray", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 120, "kept": 113, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= nums.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each number x in nums, create a sorted list indices_x of all indices i such that nums[i] == x.", "On every indices_x, execute a sliding window technique.", "For each indices_x, find i, j such that (indices_x[j] - indices_x[i]) - (j - i) <= k and j - i + 1 is maximized.", "The answer would be the maximum of j - i + 1 for all indices_x." ] }, { "question_id": 2832, "task_id": "maximal-range-that-each-element-is-maximum-in-it", "drop": [ "premium" ] }, { "question_id": 2833, "task_id": "furthest-point-from-origin", "drop": [], "similar": [ "robot-return-to-origin" ], "flags": [], "comparison": "exact", "parameter_names": [ "moves" ], "tests": { "total": 151, "kept": 149, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "1 <= moves.length == n <= 50" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= moves.length == n <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "In an optimal answer, all occurrences of '_\u2019 will be replaced with the same character.", "Replace all characters of '_\u2019 with the character that occurs the most." ] }, { "question_id": 2834, "task_id": "find-the-minimum-possible-sum-of-a-beautiful-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "target" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Greedily try to add the smallest possible number in the array nums, such that nums contains distinct positive integers, and there are no two indices i and j with nums[i] + nums[j] == target." ] }, { "question_id": 2835, "task_id": "minimum-operations-to-form-subsequence-with-target-sum", "drop": [], "similar": [ "number-of-subsequences-that-satisfy-the-given-sum-condition", "closest-subsequence-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 117, "kept": 115, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 109, "end_line": 109, "violates": [ "1 <= target < 2**(31)" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= target < 2**(31)" ] } ], "unchecked_constraints": [ "nums consists only of non-negative powers of two." ], "public_tests": 3, "hints": [ "if target > sum(nums[i]) , return -1. Otherwise, an answer exists", "Solve the problem for each set bit of target, independently, from least significant to most significant bit.", "For each set bit of target from least to most significant, let X = sum(nums[i]) for nums[i] <= 2^bit.", "if X >= 2^bit, repeatedly select the maximum nums[i] such that nums[i]<=2^bit that has not been selected yet, until the sum of selected elements equals 2^bit. The selected nums[i] will be part of the subsequence whose elements sum to target, so those elements can not be selected again.", "Otherwise, select the smallest nums[i] such that nums[i] > 2^bit, delete nums[i] and add two occurences of nums[i]/2. Without moving to the next bit, go back to the step in hint 3." ] }, { "question_id": 2836, "task_id": "maximize-value-of-function-in-a-ball-passing-game", "drop": [], "similar": [ "jump-game-vi" ], "flags": [], "comparison": "exact", "parameter_names": [ "receiver", "k" ], "tests": { "total": 109, "kept": 108, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 88, "end_line": 88, "violates": [ "1 <= k <= 10**(10)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We can solve the problem using binary lifting.", "For each player with id x and for every i in the range [0, ceil(log_2k)], we can determine the last receiver's id and compute the sum of player ids who receive the ball after 2^i passes, starting from x.", "Let last_receiver[x][i] = the last receiver's id after 2^i passes, and sum[x][i] = the sum of player ids who receive the ball after 2^i passes. For all x in the range [0, n - 1], last_receiver[x][0] = receiver[x], and sum[x][0] = receiver[x].", "Then for i in range [1, ceil(log_2k)], last_receiver[x][i] = last_receiver[last_receiver[x][i - 1]][i - 1] and sum[x][i] = sum[x][i - 1] + sum[last_receiver[x][i - 1]][i - 1], for all x in the range [0, n - 1].", "Starting from each player id x, we can now go through the powers of 2 in the binary representation of k and make jumps corresponding to each power, using the pre-computed values, to compute f(x).", "The answer is the maximum f(x) from each player id." ] }, { "question_id": 2838, "task_id": "maximum-coins-heroes-can-collect", "drop": [ "premium" ] }, { "question_id": 2839, "task_id": "check-if-strings-can-be-made-equal-with-operations-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "s2" ], "tests": { "total": 63, "kept": 63, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Since the strings are very small you can try a brute-force approach.", "There are only 2 different swaps that are possible in a string." ] }, { "question_id": 2840, "task_id": "check-if-strings-can-be-made-equal-with-operations-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "s2" ], "tests": { "total": 127, "kept": 107, "dropped": { "constraint_violation": 20 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "n == s1.length == s2.length" ] }, { "line": 20, "end_line": 20, "violates": [ "n == s1.length == s2.length" ] }, { "line": 21, "end_line": 21, "violates": [ "n == s1.length == s2.length" ] }, { "line": 25, "end_line": 25, "violates": [ "n == s1.length == s2.length" ] }, { "line": 34, "end_line": 34, "violates": [ "n == s1.length == s2.length" ] }, { "line": 39, "end_line": 39, "violates": [ "n == s1.length == s2.length" ] }, { "line": 42, "end_line": 42, "violates": [ "n == s1.length == s2.length" ] }, { "line": 51, "end_line": 51, "violates": [ "n == s1.length == s2.length" ] }, { "line": 53, "end_line": 53, "violates": [ "n == s1.length == s2.length" ] }, { "line": 54, "end_line": 54, "violates": [ "n == s1.length == s2.length" ] }, { "line": 60, "end_line": 60, "violates": [ "n == s1.length == s2.length" ] }, { "line": 69, "end_line": 69, "violates": [ "n == s1.length == s2.length" ] }, { "line": 74, "end_line": 74, "violates": [ "n == s1.length == s2.length" ] }, { "line": 75, "end_line": 75, "violates": [ "n == s1.length == s2.length" ] }, { "line": 76, "end_line": 76, "violates": [ "n == s1.length == s2.length" ] }, { "line": 85, "end_line": 85, "violates": [ "n == s1.length == s2.length" ] }, { "line": 90, "end_line": 90, "violates": [ "n == s1.length == s2.length" ] }, { "line": 93, "end_line": 93, "violates": [ "n == s1.length == s2.length" ] }, { "line": 94, "end_line": 94, "violates": [ "n == s1.length == s2.length" ] }, { "line": 123, "end_line": 123, "violates": [ "n == s1.length == s2.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Characters in two positions can be swapped if and only if the two positions have the same parity.", "To be able to make the two strings equal, the characters at even and odd positions in the strings should be the same." ] }, { "question_id": 2841, "task_id": "maximum-sum-of-almost-unique-subarray", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "m", "k" ], "tests": { "total": 108, "kept": 106, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a set or map to keep track of the number of distinct elements.", "Use 2-pointers to maintain the size, the number of unique elements, and the sum of all the elements in all subarrays of size k from left to right dynamically.****" ] }, { "question_id": 2842, "task_id": "count-k-subsequences-of-a-string-with-maximum-beauty", "drop": [ "too_few_tests" ], "similar": [ "distinct-subsequences-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 2, "kept": 2, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 2843, "task_id": "count-symmetric-integers", "drop": [], "similar": [ "palindrome-number", "sum-of-digits-in-base-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "low", "high" ], "tests": { "total": 72, "kept": 65, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= low <= high <= 10**(4)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= low <= high <= 10**(4)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= low <= high <= 10**(4)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= low <= high <= 10**(4)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= low <= high <= 10**(4)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= low <= high <= 10**(4)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= low <= high <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate over all numbers from low to high", "Convert each number to a string and compare the sum of the first half with that of the second." ] }, { "question_id": 2844, "task_id": "minimum-operations-to-make-a-special-number", "drop": [], "similar": [ "remove-k-digits", "remove-digit-from-number-to-maximize-result" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 188, "kept": 188, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "num does not contain any leading zeros." ], "public_tests": 3, "hints": [ "If num contains a single zero digit then the answer is at most n - 1.", "A number is divisible by 25 if its last two digits are 75, 50, 25, or 00.", "Iterate over all possible pairs of indices i < j such that num[i] * 10 + num[j] is in [00,25,50,75]. Then, set the answer to min(answer, n - i - 2) ." ] }, { "question_id": 2845, "task_id": "count-of-interesting-subarrays", "drop": [], "similar": [ "subarray-sums-divisible-by-k", "count-number-of-nice-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "modulo", "k" ], "tests": { "total": 110, "kept": 107, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= modulo <= 10**(9)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The problem can be solved using prefix sums.", "Let count[i] be the number of indices where nums[i] % modulo == k among the first i indices.", "count[0] = 0 and count[i] = count[i - 1] + (nums[i - 1] % modulo == k ? 1 : 0) for i = 1, 2, ..., n.", "Now we want to calculate for each i = 1, 2, ..., n, how many indices j < i such that (count[i] - count[j]) % modulo == k.", "Rewriting (count[i] - count[j]) % modulo == k becomes count[j] = (count[i] + modulo - k) % modulo.", "Using a map data structure, for each i = 0, 1, 2, ..., n, we just sum up all map[(count[i] + modulo - k) % modulo] before increasing map[count[i] % modulo], and the total sum is the final answer." ] }, { "question_id": 2846, "task_id": "minimum-edge-weight-equilibrium-queries-in-a-tree", "drop": [], "similar": [ "kth-ancestor-of-a-tree-node", "minimum-runes-to-add-to-cast-spell" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "queries" ], "tests": { "total": 26, "kept": 26, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The input is generated such that edges represents a valid tree." ], "public_tests": 2, "hints": [ "Root the tree at any node.", "Define a 2D array freq[node][weight] which saves the frequency of each edge weight on the path from the root to each node.", "The frequency of edge weight w on the path from a to b is equal to freq[a][w] + freq[b][w] - freq[lca(a,b)][w] * 2, where lca(a,b) is the lowest common ancestor of a and b in the tree.", "lca(a,b) can be calculated using binary lifting algorithm or Tarjan algorithm." ], "similar_to_test": [ "3383 minimum-runes-to-add-to-cast-spell" ] }, { "question_id": 2847, "task_id": "smallest-number-with-given-digit-product", "drop": [ "premium" ], "similar_to_test": [ "3345 smallest-divisible-digit-product-i", "3348 smallest-divisible-digit-product-ii" ] }, { "question_id": 2848, "task_id": "points-that-intersect-with-cars", "drop": [], "similar": [ "merge-intervals", "meeting-rooms", "meeting-rooms-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 85, "kept": 84, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 55, "end_line": 55, "violates": [ "1 <= starti <= endi <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the array according to first element and then starting from the 0^th index remove the overlapping parts and return the count of non-overlapping points." ] }, { "question_id": 2849, "task_id": "determine-if-a-cell-is-reachable-at-a-given-time", "drop": [], "similar": [ "reaching-points" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "sx", "sy", "fx", "fy", "t" ], "tests": { "total": 89, "kept": 79, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "0 <= t <= 10**(9)" ] }, { "line": 15, "end_line": 15, "violates": [ "0 <= t <= 10**(9)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= sx, sy, fx, fy <= 10**(9)" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= t <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= sx, sy, fx, fy <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= sx, sy, fx, fy <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= sx, sy, fx, fy <= 10**(9)" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= t <= 10**(9)" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= t <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= t <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Minimum time to reach the cell should be less than or equal to given time.", "The answer is true if t is greater or equal than the Chebyshev distance from (sx, sy) to (fx, fy). However, there is one more edge case to be considered.", "The answer is false If sx == fx and sy == fy" ] }, { "question_id": 2850, "task_id": "minimum-moves-to-spread-stones-over-grid", "drop": [], "similar": [ "minimum-number-of-operations-to-move-all-balls-to-each-box", "minimum-number-of-operations-to-make-x-and-y-equal" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 39, "kept": 39, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "Sum of grid is equal to 9." ], "public_tests": 2, "hints": [ "There are at most 4 cells with more than one stone.", "Let a be the number of cells containing more than one stone, and b be the number of cells containing no stones. . b^a \u2264 6561. Use this fact to come up with a bruteforce.", "For all empty cells, bruteforce over all possible cells from which a stone can come. Note that a stone will always come from a cell containing at least 2 stones." ] }, { "question_id": 2851, "task_id": "string-transformation", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t", "k" ], "tests": { "total": 89, "kept": 59, "dropped": { "constraint_violation": 30 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= k <= 10**(15)", "s.length == t.length" ] }, { "line": 17, "end_line": 17, "violates": [ "s.length == t.length" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= k <= 10**(15)", "s.length == t.length" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= k <= 10**(15)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= k <= 10**(15)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= k <= 10**(15)" ] }, { "line": 29, "end_line": 29, "violates": [ "s.length == t.length" ] }, { "line": 31, "end_line": 31, "violates": [ "s.length == t.length" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= k <= 10**(15)", "s.length == t.length" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= k <= 10**(15)", "s.length == t.length" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= k <= 10**(15)", "s.length == t.length" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= k <= 10**(15)" ] }, { "line": 48, "end_line": 48, "violates": [ "s.length == t.length" ] }, { "line": 49, "end_line": 49, "violates": [ "s.length == t.length" ] }, { "line": 50, "end_line": 50, "violates": [ "s.length == t.length" ] }, { "line": 60, "end_line": 60, "violates": [ "s.length == t.length" ] }, { "line": 61, "end_line": 61, "violates": [ "s.length == t.length" ] }, { "line": 66, "end_line": 66, "violates": [ "s.length == t.length" ] }, { "line": 67, "end_line": 67, "violates": [ "s.length == t.length" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= k <= 10**(15)" ] }, { "line": 72, "end_line": 72, "violates": [ "s.length == t.length" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= k <= 10**(15)" ] }, { "line": 74, "end_line": 74, "violates": [ "s.length == t.length" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= k <= 10**(15)" ] }, { "line": 77, "end_line": 77, "violates": [ "s.length == t.length" ] }, { "line": 80, "end_line": 80, "violates": [ "s.length == t.length" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= k <= 10**(15)" ] }, { "line": 86, "end_line": 86, "violates": [ "s.length == t.length" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= k <= 10**(15)", "s.length == t.length" ] }, { "line": 89, "end_line": 89, "violates": [ "s.length == t.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "String t can be only constructed if it is a rotated version of string s.", "Use KMP algorithm or Z algorithm to find the number of indices from where s is equal to t.", "Use Dynamic Programming to count the number of ways." ] }, { "question_id": 2852, "task_id": "sum-of-remoteness-of-all-cells", "drop": [ "premium" ] }, { "question_id": 2855, "task_id": "minimum-right-shifts-to-sort-the-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 129, "kept": 128, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 92, "end_line": 92, "violates": [ "1 <= nums.length <= 100", "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [ "nums contains distinct integers." ], "public_tests": 3, "hints": [ "Find the pivot point around which the array is rotated.", "Will the answer exist if there is more than one point where nums[i] < nums[i-1]?" ] }, { "question_id": 2856, "task_id": "minimum-array-length-after-pair-removals", "drop": [], "similar": [ "find-the-maximum-number-of-marked-indices" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 121, "kept": 121, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 4, "hints": [ "To minimize the length of the array, we should maximize the number of operations performed.", "To perform k operations, it is optimal to use the smallest k values and the largest k values in nums.", "What is the best way to make pairs from the smallest k values and the largest k values so it is possible to remove all the pairs?", "If we consider the smallest k values and the largest k values as two separate sorted 0-indexed arrays, a and b, It is optimal to pair a[i] and b[i]. So, a k is valid if a[i] < b[i] for all i in the range [0, k - 1].", "The greatest possible valid k can be found using binary search.", "The answer is nums.length - 2 * k." ] }, { "question_id": 2857, "task_id": "count-pairs-of-points-with-distance-k", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "coordinates", "k" ], "tests": { "total": 91, "kept": 68, "dropped": { "constraint_violation": 23 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "0 <= k <= 100" ] }, { "line": 13, "end_line": 13, "violates": [ "0 <= k <= 100" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= k <= 100" ] }, { "line": 20, "end_line": 20, "violates": [ "0 <= k <= 100" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= xi, yi <= 10**(6)" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= k <= 100" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= k <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= k <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= k <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= k <= 100" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= k <= 100" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= k <= 100" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= k <= 100" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= k <= 100" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= k <= 100" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= k <= 100" ] }, { "line": 73, "end_line": 73, "violates": [ "0 <= k <= 100" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= k <= 100" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= k <= 100" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= k <= 100" ] }, { "line": 85, "end_line": 85, "violates": [ "0 <= k <= 100" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= k <= 100" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= k <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Suppose that x = x_1 XOR x_2 and y = y_1 XOR y_2 then we can get x_2 = x XOR x_1 and y_2 = y XOR y_1.", "We are supposed to have k = x + y so we can get x_2 = x XOR x_1 and y_2 = (k - x) XOR y_1.", "We can iterate over all possible values of x and count the number of points (x_1, x_2) and (x_2, y_2)." ] }, { "question_id": 2858, "task_id": "minimum-edge-reversals-so-every-node-is-reachable", "drop": [], "similar": [ "reorder-routes-to-make-all-paths-lead-to-the-city-zero" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 42, "kept": 42, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The input is generated such that if the edges were bi-directional, the graph would be a tree." ], "public_tests": 2, "hints": [ "The problem can be solved using tree DP.", "Using node 0 as the root, let dp[x] be the minimum number of edge reversals so node x can reach every node in its subtree.", "Using a DFS traversing the edges bidirectionally, we can compute dp.\ndp[x] = dp[y] + (1 if the edge between x and y is going from y to x; 0 otherwise), where x is the parent of y.", "Let answer[x] be the minimum number of edge reversals so it is possible to reach any other node starting from node x.", "Using another DFS starting from node 0 and traversing the edges bidirectionally, we can compute answer.\nanswer[0] = dp[0]\nanswer[y] = answer[x] + (1 if the edge between x and y is going from x to y; -1 otherwise), where x is the parent of y." ] }, { "question_id": 2859, "task_id": "sum-of-values-at-indices-with-k-set-bits", "drop": [], "similar": [ "counting-bits", "find-the-k-or-of-an-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 79, "kept": 70, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate through the indices i in the range [0, n - 1], for each index i count the number of bits in its binary representation. If it is k, add nums[i] to the result." ] }, { "question_id": 2860, "task_id": "happy-students", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 120, "kept": 97, "dropped": { "constraint_violation": 23 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 7, "end_line": 7, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 11, "end_line": 11, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 12, "end_line": 12, "violates": [ "0 <= nums[i] < nums.length", "0 <= nums[i] < nums.length" ] }, { "line": 13, "end_line": 13, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= nums[i] < nums.length", "0 <= nums[i] < nums.length" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= nums[i] < nums.length", "0 <= nums[i] < nums.length" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= nums[i] < nums.length", "0 <= nums[i] < nums.length" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= nums[i] < nums.length", "0 <= nums[i] < nums.length" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 98, "end_line": 98, "violates": [ "0 <= nums[i] < nums.length", "0 <= nums[i] < nums.length" ] }, { "line": 105, "end_line": 105, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 106, "end_line": 106, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 107, "end_line": 107, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 108, "end_line": 108, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 115, "end_line": 115, "violates": [ "0 <= nums[i] < nums.length" ] }, { "line": 117, "end_line": 117, "violates": [ "0 <= nums[i] < nums.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If a student with nums[i] = x is selected, all the students with nums[j] <= x must be selected.", "If a student with nums[i] = x is not selected, all the students with nums[j] >= x must not be selected.", "Sort values in nums and try all possible values for x from 0 to n separately." ] }, { "question_id": 2861, "task_id": "maximum-number-of-alloys", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k", "budget", "composition", "stock", "cost" ], "tests": { "total": 91, "kept": 82, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= composition[i][j] <= 100" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= composition[i][j] <= 100" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= composition[i][j] <= 100" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= composition[i][j] <= 100" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= composition[i][j] <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= composition[i][j] <= 100" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= composition[i][j] <= 100" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= composition[i][j] <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= composition[i][j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use binary search to find the answer." ] }, { "question_id": 2862, "task_id": "maximum-element-sum-of-a-complete-subset-of-indices", "drop": [], "similar": [ "constrained-subsequence-sum", "maximum-alternating-subsequence-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 62, "kept": 61, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Define P(x) as the product of primes p with odd exponents in x's factorization. Examples: For x = 18, factorization 2^1 \u00d7 3^2, P(18) = 2; for x = 45, factorization 3^2 \u00d7 5^1, P(45) = 5; for x = 50, factorization 2^1 \u00d7 5^2, P(50) = 2; for x = 210, factorization 2^1 \u00d7 3^1 \u00d7 5^1 \u00d7 7^1, P(210) = 210.", "If P(i) = P(j), nums[i] and nums[j] can be grouped together.", "Pick the group with the largest sum." ] }, { "question_id": 2863, "task_id": "maximum-length-of-semi-decreasing-subarrays", "drop": [ "premium" ] }, { "question_id": 2864, "task_id": "maximum-odd-binary-number", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 78, "kept": 78, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s contains at least one '1'." ], "public_tests": 2, "hints": [ "The binary representation of an odd number contains '1' in the least significant place." ] }, { "question_id": 2865, "task_id": "beautiful-towers-i", "drop": [], "similar": [ "valid-mountain-array", "minimum-number-of-removals-to-make-mountain-array", "maximum-number-of-books-you-can-take" ], "flags": [], "comparison": "exact", "parameter_names": [ "heights" ], "tests": { "total": 184, "kept": 178, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= heights[i] <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= heights[i] <= 10**(9)", "1 <= heights[i] <= 10**(9)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= heights[i] <= 10**(9)", "1 <= heights[i] <= 10**(9)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= heights[i] <= 10**(9)" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= heights[i] <= 10**(9)" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= heights[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try all the possible indices i as the peak.", "If i is the peak, i-1^th element, and heights[j] = min(heights[j], heights[j + 1]) for 0 <= j < i", "If i is the peak, start from i+1^th element, heights[j] = min(heights[j], heights[j - 1]) for i < j < heights.size()" ] }, { "question_id": 2866, "task_id": "beautiful-towers-ii", "drop": [], "similar": [ "minimum-number-of-removals-to-make-mountain-array", "maximum-number-of-books-you-can-take" ], "flags": [], "comparison": "exact", "parameter_names": [ "maxHeights" ], "tests": { "total": 111, "kept": 110, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 84, "end_line": 84, "violates": [ "1 <= maxHeights[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try all the possible indices i as the peak.", "Let left[i] be the maximum sum of heights for the prefix 0, \u2026, i when index i is the peak.", "Let right[i] be the maximum sum of heights for suffix i, \u2026, (n - 1) when i is the peak", "Compute values of left[i] from left to right using DP. For each i from 0 to n - 1, left[i] = maxHeights * (i - j) + answer[j], where j is the rightmost index to the left of i such that maxHeights[j] < maxHeights[i] .", "For each i from n - 1 to 0, right[i] = maxHeights * (j - i) + answer[j], where j is the leftmost index to the right of i such that maxHeights[j] < maxHeights[i] ." ] }, { "question_id": 2867, "task_id": "count-valid-paths-in-a-tree", "drop": [], "similar": [ "count-paths-that-can-form-a-palindrome-in-a-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 34, "kept": 33, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "edges.length == n - 1" ] } ], "unchecked_constraints": [ "The input is generated such that edges represent a valid tree." ], "public_tests": 2, "hints": [ "Use the sieve of Eratosthenes to find all prime numbers in the range [1, n].****", "Root the tree at any node.", "Let dp[i][0] = the number of vertical paths starting from i containing no prime nodes , and dp[i][1] = the number of vertical paths starting from i containing one prime node .", "If i is not prime, dp[i][0] = sum(dp[child][0]) + 1, and dp[i][1] = sum(dp[child][1]) for each child of i in the rooted tree.", "If i is prime, dp[i][0] = 0, and dp[i][1] = sum(dp[child][0]) + 1 for each child of i in the rooted tree.", "For each node i, and using the computed dp matrix, count the number of unordered pairs (a,b) such that lca(a,b) = i, and there exists exactly one prime number on the path from a to b." ] }, { "question_id": 2868, "task_id": "the-wording-game", "drop": [ "premium" ] }, { "question_id": 2869, "task_id": "minimum-operations-to-collect-elements", "drop": [], "similar": [ "build-an-array-with-stack-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 100, "kept": 93, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= nums.length" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= nums.length" ] } ], "unchecked_constraints": [ "The input is generated such that you can collect elements 1, 2, ..., k." ], "public_tests": 3, "hints": [ "Use an occurrence array.", "Iterate over the elements in reverse order.", "If the current element nums[i] is not marked in the occurrence array and nums[i] <= k, mark nums[i].", "Keep track of how many integers you have marked.", "Return the current index as soon as the number of marked integers becomes equal to k." ] }, { "question_id": 2870, "task_id": "minimum-number-of-operations-to-make-array-empty", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 107, "kept": 107, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 2871, "task_id": "split-array-into-maximum-number-of-subarrays", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 103, "kept": 92, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= nums[i] <= 10**(6)" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= nums[i] <= 10**(6)" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= nums[i] <= 10**(6)" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= nums[i] <= 10**(6)" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= nums[i] <= 10**(6)" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= nums[i] <= 10**(6)" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 96, "end_line": 96, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The minimum score will always be the bitwise AND of all elements of the array.", "If the minimum score is not equal to 0, the only possible split will be to keep all elements in one subarray.", "Otherwise, all of the subarrays should have a score of 0, we can greedily split the array while trying to make each subarray as small as possible." ] }, { "question_id": 2872, "task_id": "maximum-number-of-k-divisible-components", "drop": [], "similar": [ "create-components-with-same-value" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "values", "k" ], "tests": { "total": 78, "kept": 76, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "values.length == n" ] }, { "line": 76, "end_line": 76, "violates": [ "values.length == n" ] } ], "unchecked_constraints": [ "Sum of values is divisible by k.", "The input is generated such that edges represents a valid tree." ], "public_tests": 2, "hints": [ "Root the tree at node 0.", "If a leaf node is not divisible by k, it must be in the same component as its parent node so we merge it with its parent node.", "If a leaf node is divisible by k, it will be in its own components so we separate it from its parent node.", "In each step, we either cut a leaf node down or merge a leaf node. The number of nodes on the tree reduces by one. Repeat this process until only one node is left." ] }, { "question_id": 2873, "task_id": "maximum-value-of-an-ordered-triplet-i", "drop": [], "similar": [ "number-of-arithmetic-triplets", "minimum-sum-of-mountain-triplets-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 126, "kept": 121, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use three nested loops to find all the triplets." ] }, { "question_id": 2874, "task_id": "maximum-value-of-an-ordered-triplet-ii", "drop": [], "similar": [ "trapping-rain-water", "sum-of-beauty-in-the-array", "minimum-sum-of-mountain-triplets-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 119, "kept": 113, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Preprocess the prefix maximum array, prefix_max[i] = max(nums[0], nums[1], \u2026, nums[i]) and the suffix maximum array, suffix_max[i] = max(nums[i], nums[i + 1], \u2026, nums[n - 1]).", "For each index j, find two indices i and k such that i < j < k and (nums[i] - nums[j]) * nums[k] is the maximum, using the prefix and suffix maximum arrays.", "For index j, the maximum triplet value is (prefix_max[j - 1] - nums[j]) * suffix_max[j + 1]." ] }, { "question_id": 2875, "task_id": "minimum-size-subarray-in-infinite-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 117, "kept": 114, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Notice that, target is either: A subarray of nums, or prefix_sum[i] + k * sum(nums) + suffix_sum[j] for some i, j, k.", "You can solve the problem for those two separate cases using hash map and prefix sums." ] }, { "question_id": 2876, "task_id": "count-visited-nodes-in-a-directed-graph", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges" ], "tests": { "total": 91, "kept": 54, "dropped": { "constraint_violation": 37 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "edges[i] != i" ] }, { "line": 4, "end_line": 4, "violates": [ "edges[i] != i" ] }, { "line": 7, "end_line": 7, "violates": [ "edges[i] != i" ] }, { "line": 9, "end_line": 9, "violates": [ "edges[i] != i" ] }, { "line": 20, "end_line": 20, "violates": [ "edges[i] != i" ] }, { "line": 23, "end_line": 23, "violates": [ "edges[i] != i" ] }, { "line": 24, "end_line": 24, "violates": [ "edges[i] != i" ] }, { "line": 25, "end_line": 25, "violates": [ "edges[i] != i" ] }, { "line": 26, "end_line": 26, "violates": [ "edges[i] != i" ] }, { "line": 30, "end_line": 30, "violates": [ "edges[i] != i" ] }, { "line": 31, "end_line": 31, "violates": [ "edges[i] != i" ] }, { "line": 33, "end_line": 33, "violates": [ "edges[i] != i" ] }, { "line": 34, "end_line": 34, "violates": [ "edges[i] != i" ] }, { "line": 43, "end_line": 43, "violates": [ "edges[i] != i" ] }, { "line": 44, "end_line": 44, "violates": [ "edges[i] != i" ] }, { "line": 46, "end_line": 46, "violates": [ "edges[i] != i" ] }, { "line": 47, "end_line": 47, "violates": [ "edges[i] != i" ] }, { "line": 49, "end_line": 49, "violates": [ "edges[i] != i" ] }, { "line": 50, "end_line": 50, "violates": [ "edges[i] != i" ] }, { "line": 52, "end_line": 52, "violates": [ "edges[i] != i" ] }, { "line": 57, "end_line": 57, "violates": [ "edges[i] != i" ] }, { "line": 58, "end_line": 58, "violates": [ "edges[i] != i" ] }, { "line": 62, "end_line": 62, "violates": [ "edges[i] != i" ] }, { "line": 63, "end_line": 63, "violates": [ "edges[i] != i" ] }, { "line": 65, "end_line": 65, "violates": [ "edges[i] != i" ] }, { "line": 67, "end_line": 67, "violates": [ "edges[i] != i" ] }, { "line": 68, "end_line": 68, "violates": [ "edges[i] != i" ] }, { "line": 72, "end_line": 72, "violates": [ "edges[i] != i" ] }, { "line": 73, "end_line": 73, "violates": [ "edges[i] != i" ] }, { "line": 78, "end_line": 78, "violates": [ "edges[i] != i" ] }, { "line": 79, "end_line": 79, "violates": [ "edges[i] != i" ] }, { "line": 81, "end_line": 81, "violates": [ "edges[i] != i" ] }, { "line": 86, "end_line": 86, "violates": [ "edges[i] != i" ] }, { "line": 88, "end_line": 88, "violates": [ "edges[i] != i" ] }, { "line": 90, "end_line": 90, "violates": [ "edges[i] != i" ] }, { "line": 91, "end_line": 91, "violates": [ "edges[i] != i" ] }, { "line": 92, "end_line": 92, "violates": [ "edges[i] != i" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider if the graph was only one cycle, what will be the answer for each node?", "The actual graph will always consist of at least one cycle and some other nodes.", "Calculate the answer for nodes in cycles the same way as in hint 1. How do you calculate the answer for the remaining nodes?" ] }, { "question_id": 2892, "task_id": "minimizing-array-after-replacing-pairs-with-their-product", "drop": [ "premium" ] }, { "question_id": 2894, "task_id": "divisible-and-non-divisible-sums-difference", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "m" ], "tests": { "total": 93, "kept": 93, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "With arithmetic progression we know that the sum of integers in the range [1, n] is n * (n + 1) / 2 ." ] }, { "question_id": 2895, "task_id": "minimum-processing-time", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "processorTime", "tasks" ], "tests": { "total": 85, "kept": 25, "dropped": { "constraint_violation": 60 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "tasks.length == 4 * n" ] }, { "line": 3, "end_line": 3, "violates": [ "tasks.length == 4 * n" ] }, { "line": 4, "end_line": 4, "violates": [ "1 <= tasks[i] <= 10**(9)", "tasks.length == 4 * n" ] }, { "line": 5, "end_line": 5, "violates": [ "tasks.length == 4 * n" ] }, { "line": 6, "end_line": 6, "violates": [ "tasks.length == 4 * n" ] }, { "line": 7, "end_line": 7, "violates": [ "tasks.length == 4 * n" ] }, { "line": 8, "end_line": 8, "violates": [ "tasks.length == 4 * n" ] }, { "line": 10, "end_line": 10, "violates": [ "tasks.length == 4 * n" ] }, { "line": 12, "end_line": 12, "violates": [ "tasks.length == 4 * n" ] }, { "line": 13, "end_line": 13, "violates": [ "tasks.length == 4 * n" ] }, { "line": 15, "end_line": 15, "violates": [ "tasks.length == 4 * n" ] }, { "line": 17, "end_line": 17, "violates": [ "tasks.length == 4 * n" ] }, { "line": 19, "end_line": 19, "violates": [ "tasks.length == 4 * n" ] }, { "line": 20, "end_line": 20, "violates": [ "tasks.length == 4 * n" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= tasks[i] <= 10**(9)", "tasks.length == 4 * n" ] }, { "line": 22, "end_line": 22, "violates": [ "tasks.length == 4 * n" ] }, { "line": 23, "end_line": 23, "violates": [ "tasks.length == 4 * n" ] }, { "line": 24, "end_line": 24, "violates": [ "tasks.length == 4 * n" ] }, { "line": 25, "end_line": 25, "violates": [ "tasks.length == 4 * n" ] }, { "line": 26, "end_line": 26, "violates": [ "tasks.length == 4 * n" ] }, { "line": 28, "end_line": 28, "violates": [ "tasks.length == 4 * n" ] }, { "line": 29, "end_line": 29, "violates": [ "tasks.length == 4 * n" ] }, { "line": 30, "end_line": 30, "violates": [ "tasks.length == 4 * n" ] }, { "line": 31, "end_line": 31, "violates": [ "tasks.length == 4 * n" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= tasks[i] <= 10**(9)", "tasks.length == 4 * n" ] }, { "line": 35, "end_line": 35, "violates": [ "tasks.length == 4 * n" ] }, { "line": 36, "end_line": 36, "violates": [ "tasks.length == 4 * n" ] }, { "line": 38, "end_line": 38, "violates": [ "tasks.length == 4 * n" ] }, { "line": 39, "end_line": 39, "violates": [ "tasks.length == 4 * n" ] }, { "line": 40, "end_line": 40, "violates": [ "tasks.length == 4 * n" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= processorTime[i] <= 10**(9)", "1 <= tasks[i] <= 10**(9)", "tasks.length == 4 * n" ] }, { "line": 42, "end_line": 42, "violates": [ "tasks.length == 4 * n" ] }, { "line": 47, "end_line": 47, "violates": [ "tasks.length == 4 * n" ] }, { "line": 48, "end_line": 48, "violates": [ "tasks.length == 4 * n" ] }, { "line": 49, "end_line": 49, "violates": [ "tasks.length == 4 * n" ] }, { "line": 50, "end_line": 50, "violates": [ "tasks.length == 4 * n" ] }, { "line": 51, "end_line": 51, "violates": [ "tasks.length == 4 * n" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= processorTime[i] <= 10**(9)", "tasks.length == 4 * n" ] }, { "line": 54, "end_line": 54, "violates": [ "tasks.length == 4 * n" ] }, { "line": 55, "end_line": 55, "violates": [ "tasks.length == 4 * n" ] }, { "line": 56, "end_line": 56, "violates": [ "tasks.length == 4 * n" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= tasks[i] <= 10**(9)", "tasks.length == 4 * n" ] }, { "line": 58, "end_line": 58, "violates": [ "tasks.length == 4 * n" ] }, { "line": 59, "end_line": 59, "violates": [ "tasks.length == 4 * n" ] }, { "line": 61, "end_line": 61, "violates": [ "tasks.length == 4 * n" ] }, { "line": 65, "end_line": 65, "violates": [ "tasks.length == 4 * n" ] }, { "line": 66, "end_line": 66, "violates": [ "tasks.length == 4 * n" ] }, { "line": 67, "end_line": 67, "violates": [ "tasks.length == 4 * n" ] }, { "line": 68, "end_line": 68, "violates": [ "tasks.length == 4 * n" ] }, { "line": 69, "end_line": 69, "violates": [ "tasks.length == 4 * n" ] }, { "line": 70, "end_line": 70, "violates": [ "tasks.length == 4 * n" ] }, { "line": 71, "end_line": 71, "violates": [ "tasks.length == 4 * n" ] }, { "line": 74, "end_line": 74, "violates": [ "tasks.length == 4 * n" ] }, { "line": 77, "end_line": 77, "violates": [ "tasks.length == 4 * n" ] }, { "line": 78, "end_line": 78, "violates": [ "tasks.length == 4 * n" ] }, { "line": 80, "end_line": 80, "violates": [ "tasks.length == 4 * n" ] }, { "line": 81, "end_line": 81, "violates": [ "tasks.length == 4 * n" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= processorTime[i] <= 10**(9)" ] }, { "line": 84, "end_line": 84, "violates": [ "tasks.length == 4 * n" ] }, { "line": 85, "end_line": 85, "violates": [ "tasks.length == 4 * n" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It\u2019s optimal to make the processor with earlier process time run 4 longer tasks.****", "The largest processTime[i] + tasks[j] (when matched) is the answer." ] }, { "question_id": 2896, "task_id": "apply-operations-to-make-two-strings-equal", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "s2", "x" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Save all the indices that have different characters on s1 and s2 into a list, and work only with this list.", "Try to use dynamic programming on this list to solve the problem. What will be the states and transitions of this dp?" ] }, { "question_id": 2897, "task_id": "apply-operations-on-array-to-maximize-sum-of-squares", "drop": [], "similar": [ "minimize-or-of-remaining-elements-using-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 98, "kept": 88, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The operation described only transfers some bits from one element to another in their binary representation.", "To have a maximum sum of squares, it is optimal to greedily make each number as big as possible." ] }, { "question_id": 2898, "task_id": "maximum-linear-stock-score", "drop": [ "premium" ] }, { "question_id": 2899, "task_id": "last-visited-integers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 261, "kept": 260, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "nums[i] == -1 or 1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It is sufficient to implement what the description is stating." ] }, { "question_id": 2900, "task_id": "longest-unequal-adjacent-groups-subsequence-i", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "words", "groups" ], "tests": { "total": 207, "kept": 196, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= n == words.length == groups.length <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 164, "end_line": 164, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 199, "end_line": 199, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 207, "end_line": 207, "violates": [ "1 <= words[i].length <= 10" ] } ], "unchecked_constraints": [ "words consists of distinct strings." ], "public_tests": 2, "hints": [ "This problem can be solved greedily.", "Begin by constructing the answer starting with the first number in groups.", "For each index i in the range [1, n - 1], add i to the answer if groups[i] != groups[i - 1]." ] }, { "question_id": 2901, "task_id": "longest-unequal-adjacent-groups-subsequence-ii", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "words", "groups" ], "tests": { "total": 310, "kept": 306, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 130, "end_line": 130, "violates": [ "1 <= groups[i] <= n" ] }, { "line": 160, "end_line": 160, "violates": [ "1 <= groups[i] <= n" ] }, { "line": 171, "end_line": 171, "violates": [ "1 <= groups[i] <= n" ] }, { "line": 284, "end_line": 284, "violates": [ "1 <= groups[i] <= n" ] } ], "unchecked_constraints": [ "words consists of distinct strings." ], "public_tests": 2, "hints": [ "Let dp[i] represent the length of the longest subsequence ending with words[i] that satisfies the conditions.", "dp[i] = (maximum value of dp[j]) + 1 for indices j < i, where groups[i] != groups[j], words[i] and words[j] are equal in length, and the hamming distance between words[i] and words[j] is exactly 1.", "Keep track of the j values used to achieve the maximum dp[i] for each index i.", "The expected array's length is max(dp[0:n]), and starting from the index having the maximum value in dp, we can trace backward to get the words." ] }, { "question_id": 2902, "task_id": "count-of-sub-multisets-with-bounded-sum", "drop": [], "similar": [ "coin-change", "coin-change-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "l", "r" ], "tests": { "total": 89, "kept": 86, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "0 <= l <= r <= 2 * 10**(4)" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= l <= r <= 2 * 10**(4)" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= l <= r <= 2 * 10**(4)" ] } ], "unchecked_constraints": [ "Sum of nums does not exceed 2 * 10**(4)." ], "public_tests": 3, "hints": [ "Since the sum of numsis at most 20000, the number of distinct elements of nums is 200.", "Let dp[x] be the number of submultisets of nums with sum x.", "The answer to the problem is dp[l] + dp[l+1] + \u2026 + dp[r].", "Use coin change dp to transition between states." ] }, { "question_id": 2903, "task_id": "find-indices-with-index-and-value-difference-i", "drop": [], "similar": [ "minimum-absolute-difference-between-elements-with-constraint", "find-indices-with-index-and-value-difference-ii" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "nums", "indexDifference", "valueDifference" ], "tests": { "total": 137, "kept": 92, "dropped": { "constraint_violation": 45 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= nums[i] <= 50", "0 <= nums[i] <= 50" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= nums[i] <= 50", "0 <= valueDifference <= 50" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 72, "end_line": 72, "violates": [ "0 <= nums[i] <= 50", "0 <= nums[i] <= 50" ] }, { "line": 73, "end_line": 73, "violates": [ "0 <= nums[i] <= 50", "0 <= valueDifference <= 50" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= nums[i] <= 50", "0 <= valueDifference <= 50" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 83, "end_line": 83, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 89, "end_line": 89, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 99, "end_line": 99, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= nums[i] <= 50", "0 <= valueDifference <= 50" ] }, { "line": 109, "end_line": 109, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 113, "end_line": 113, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 118, "end_line": 118, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 120, "end_line": 120, "violates": [ "0 <= nums[i] <= 50", "0 <= valueDifference <= 50" ] }, { "line": 122, "end_line": 122, "violates": [ "0 <= nums[i] <= 50", "0 <= valueDifference <= 50" ] }, { "line": 123, "end_line": 123, "violates": [ "0 <= nums[i] <= 50", "0 <= valueDifference <= 50" ] }, { "line": 124, "end_line": 124, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 126, "end_line": 126, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 127, "end_line": 127, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 128, "end_line": 128, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 133, "end_line": 133, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 135, "end_line": 135, "violates": [ "0 <= nums[i] <= 50", "0 <= valueDifference <= 50" ] }, { "line": 137, "end_line": 137, "violates": [ "0 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use bruteforce.", "You can use a nested loop to compare each pair of indices (i, j) and check if the conditions are satisfied." ] }, { "question_id": 2904, "task_id": "shortest-and-lexicographically-smallest-beautiful-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 119, "kept": 116, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 48, "end_line": 48, "violates": [ "1 <= s.length <= 100" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= s.length <= 100" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Notice that if we consider that index i is the leftmost index of a beautiful substring, it has only one candidate j, such that s[i:j] is beautiful and shortest too.", "We can iterate over all possibilities of leftmost index i take s[i:j] and compare with the shortest and the lexicographically smallest beautiful string we could get before index i." ] }, { "question_id": 2905, "task_id": "find-indices-with-index-and-value-difference-ii", "drop": [], "similar": [ "minimum-absolute-difference-between-elements-with-constraint", "find-indices-with-index-and-value-difference-i" ], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "nums", "indexDifference", "valueDifference" ], "tests": { "total": 126, "kept": 123, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 50, "end_line": 50, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 72, "end_line": 72, "violates": [ "0 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each index i >= indexDifference, keep the indices j_1 and j_2 in the range [0, i - indexDifference] such that nums[j_1] and nums[j_2] are the minimum and maximum values in the index range.", "Check if abs(nums[i] - nums[j_1]) >= valueDifference or abs(nums[i] - nums[j_2]) >= valueDifference.", "j_1 and j_2 can be updated dynamically, or they can be pre-computed since they are just prefix minimum and maximum." ] }, { "question_id": 2906, "task_id": "construct-product-matrix", "drop": [], "similar": [ "product-of-array-except-self" ], "flags": [], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 82, "kept": 78, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= grid[i][j] <= 10**(9)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= grid[i][j] <= 10**(9)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= grid[i][j] <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= grid[i][j] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to solve this without using the '/' (division operation).", "Create two 2D arrays for suffix and prefix product, and use them to find the product for each position." ] }, { "question_id": 2907, "task_id": "maximum-profitable-triplets-with-increasing-prices-i", "drop": [ "premium" ] }, { "question_id": 2908, "task_id": "minimum-sum-of-mountain-triplets-i", "drop": [], "similar": [ "3sum", "number-of-arithmetic-triplets", "maximum-value-of-an-ordered-triplet-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 118, "kept": 112, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 55, "end_line": 55, "violates": [ "3 <= nums.length <= 50" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Bruteforce over all possible triplets." ] }, { "question_id": 2909, "task_id": "minimum-sum-of-mountain-triplets-ii", "drop": [], "similar": [ "3sum", "maximum-value-of-an-ordered-triplet-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 110, "kept": 104, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 10**(8)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 10**(8)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10**(8)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 10**(8)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 10**(8)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= nums[i] <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If you fix index j, i will be the smallest integer to the left of j, and k the largest integer to the right of j.", "To find i and k, preprocess the prefix minimum array prefix_min[i] = min(nums[0], nums[1], ..., nums[i]), and the suffix minimum array suffix_min[i] = min(nums[i], nums[i + 1], ..., nums[i - 1])." ] }, { "question_id": 2911, "task_id": "minimum-changes-to-make-k-semi-palindromes", "drop": [], "similar": [ "palindrome-partitioning-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 119, "kept": 119, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 1, "hints": [ "Define dp[i][j] as the minimum count of letter changes needed to split the suffix of string s starting from s[i] into j valid parts.", "We have dp[i][j] = min(dp[x + 1][j - 1] + v[i][x]). Here v[i][x] is the minimum number of letter changes to change substring s[i..x] into semi-palindrome.", "v[i][j] can be calculated separately by brute-force. We can create a table of v[i][j] independently to improve the complexity. Also note that semi-palindrome\u2019s length is at least 2." ] }, { "question_id": 2912, "task_id": "number-of-ways-to-reach-destination-in-the-grid", "drop": [ "premium" ] }, { "question_id": 2913, "task_id": "subarrays-distinct-element-sum-of-squares-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 105, "kept": 104, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a set/heap to keep track of distinct element counts." ] }, { "question_id": 2914, "task_id": "minimum-number-of-changes-to-make-binary-string-beautiful", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 116, "kept": 116, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s has an even length." ], "public_tests": 3, "hints": [ "For any valid partition, since each part consists of an even number of the same characters, we can further partition each part into lengths of exactly 2.", "After noticing the first hint, we can decompose the whole string into disjoint blocks of size 2 and find the minimum number of changes required to make those blocks beautiful." ] }, { "question_id": 2915, "task_id": "length-of-the-longest-subsequence-that-sums-to-target", "drop": [], "similar": [ "coin-change", "coin-change-ii", "find-the-maximum-length-of-valid-subsequence-i", "find-the-maximum-length-of-valid-subsequence-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 110, "kept": 92, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= target <= 1000" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= target <= 1000" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= target <= 1000" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= target <= 1000" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= target <= 1000" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= target <= 1000" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= target <= 1000", "1 <= target <= 1000" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= target <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= target <= 1000", "1 <= target <= 1000" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= target <= 1000", "1 <= target <= 1000" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= target <= 1000" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 1000", "1 <= target <= 1000" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= target <= 1000" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= target <= 1000" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= target <= 1000" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= target <= 1000", "1 <= target <= 1000" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= target <= 1000" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= target <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming.", "Let dp[i][j] be the maximum length of any subsequence of nums[0..i - 1] that sums to j.", "dp[0][0] = 1, and dp[0][j] = 1 for all target \u2265 j > 0.", "dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - nums[i -1]) for all n \u2265 i > 0 and target \u2265 j > nums[i - 1]." ] }, { "question_id": 2916, "task_id": "subarrays-distinct-element-sum-of-squares-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider the sum of the count of distinct values of subarrays ending with index i, let\u2019s call it sum. Now if you need the sum of all subarrays ending with index i + 1 think how it can be related to sum and what extra will be needed to add to this.", "You can find that extra sum using the segment tree." ] }, { "question_id": 2917, "task_id": "find-the-k-or-of-an-array", "drop": [], "similar": [ "counting-bits", "sum-of-values-at-indices-with-k-set-bits" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 92, "kept": 89, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "0 <= nums[i] < 2**(31)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= nums[i] < 2**(31)" ] } ], "unchecked_constraints": [], "public_tests": 1, "hints": [ "Fix a bit from the range [0, 31], then count the number of elements of nums that have bit set in them.", "bit is set in integer x if and only if 2^bit AND x == 2^bit, where AND is the bitwise AND operation." ] }, { "question_id": 2918, "task_id": "minimum-equal-sum-of-two-arrays-after-replacing-zeros", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 104, "kept": 102, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "0 <= nums1[i], nums2[i] <= 10**(6)" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= nums1[i], nums2[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider we replace all the 0\u2019s with 1\u2019s on both arrays, the answer will be -1 if there was no 0 in the array with the smaller sum of elements.", "Otherwise, how can you update the value of exactly one of these 1\u2019s to make the sum of the two arrays equal?" ] }, { "question_id": 2919, "task_id": "minimum-increment-operations-to-make-array-beautiful", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 118, "kept": 118, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "There needs to be at least one value among 3 consecutive values in the array that is greater than or equal to k.", "The problem can be solved using dynamic programming.", "Let dp[i] be the minimum number of increment operations required to make the subarray consisting of the first i values beautiful, while also having the value at nums[i] >= k.", "dp[0] = max(0, k - nums[0]), dp[1] = max(0, k - nums[1]), and dp[2] = max(0, k - nums[2]).", "dp[i] = max(0, k - nums[i]) + min(dp[i - 1], dp[i - 2], dp[i - 3]) for i in the range [3, n - 1].", "The answer to the problem is min(dp[n - 1], dp[n - 2], dp[n - 3])." ] }, { "question_id": 2920, "task_id": "maximum-points-after-collecting-coins-from-all-nodes", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges", "coins", "k" ], "tests": { "total": 55, "kept": 50, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "edges.length == n - 1" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= coins[i] <= 10**(4)" ] }, { "line": 27, "end_line": 27, "violates": [ "edges.length == n - 1" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= coins[i] <= 10**(4)" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= coins[i] <= 10**(4)", "edges.length == n - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let dp[x][t] be the maximum points we can get from the subtree rooted at node x and the second operation has been used t times in its ancestors.", "Note that the value of each node <= 10^4, so when t >= 14 dp[x][t] is always 0.", "General equation will be: dp[x][t] = max((coins[x] >> t) - k + sigma(dp[y][t]), (coins[x] >> (t + 1)) + sigma(dp[y][t + 1])) where nodes denoted by y in the sigma, are the direct children of node x." ] }, { "question_id": 2921, "task_id": "maximum-profitable-triplets-with-increasing-prices-ii", "drop": [ "premium" ] }, { "question_id": 2923, "task_id": "find-champion-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 56, "kept": 56, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "For all i grid[i][i] is 0.", "For all i, j that i != j, grid[i][j] != grid[j][i].", "The input is generated such that if team a is stronger than team b and team b is stronger than team c, then team a is stronger than team c." ], "public_tests": 2, "hints": [ "The champion should be stronger than all the other teams." ] }, { "question_id": 2924, "task_id": "find-champion-ii", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 78, "kept": 77, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 42, "end_line": 42, "violates": [ "edges[i][0] != edges[i][1]" ] } ], "unchecked_constraints": [ "0 <= edge[i][j] <= n - 1", "The input is generated such that if team a is stronger than team b, team b is not stronger than team a.", "The input is generated such that if team a is stronger than team b and team b is stronger than team c, then team a is stronger than team c." ], "public_tests": 2, "hints": [ "The champion(s) should have in-degree 0 in the DAG." ] }, { "question_id": 2925, "task_id": "maximum-score-after-applying-operations-on-a-tree", "drop": [], "similar": [ "sum-of-distances-in-tree", "collect-coins-in-a-tree", "find-the-maximum-sum-of-node-values" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges", "values" ], "tests": { "total": 47, "kept": 39, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "values.length == n" ] }, { "line": 10, "end_line": 10, "violates": [ "values.length == n" ] }, { "line": 18, "end_line": 18, "violates": [ "values.length == n" ] }, { "line": 22, "end_line": 22, "violates": [ "values.length == n" ] }, { "line": 25, "end_line": 25, "violates": [ "values.length == n" ] }, { "line": 31, "end_line": 31, "violates": [ "values.length == n" ] }, { "line": 39, "end_line": 39, "violates": [ "values.length == n" ] }, { "line": 44, "end_line": 44, "violates": [ "values.length == n" ] } ], "unchecked_constraints": [ "The input is generated such that edges represents a valid tree." ], "public_tests": 2, "hints": [ "Let dp[i] be the maximum score we can get on the subtree rooted at i and sum[i] be the sum of all the values of the subtree rooted at i.", "If we don\u2019t take value[i] into the final score, we can take all the nodes of the subtrees rooted at i\u2019s children.", "If we take value[i] into the score, then each subtree rooted at its children should satisfy the constraints.", "dp[x] = max(value[x] + sigma(dp[y]), sigma(sum[y])), where y is a direct child of x." ] }, { "question_id": 2926, "task_id": "maximum-balanced-subsequence-sum", "drop": [], "similar": [ "number-of-pairs-satisfying-inequality" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 159, "kept": 156, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 55, "end_line": 55, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 105, "end_line": 105, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let dp[x] represent the maximum sum of a balanced subsequence ending at x.", "Rewriting the formula nums[i_j] - nums[i_{j-1}] >= i_j - i_{j-1} gives nums[i_j] - i_j >= nums[i_{j-1}] - i_{j-1}.", "So, for some index x, we need to find an index y, y < x, such that dp[x] = nums[x] + dp[y] is maximized, and nums[x] - x >= nums[y] - y.", "There are many ways to achieve this. One method involves sorting the values of nums[x] - x for all indices x and using a segment/Fenwick tree with coordinate compression.", "Hence, using a dictionary or map, let's call it dict, where dict[nums[x] - x] represents the position of the value, nums[x] - x, in the segment tree.", "The tree is initialized with zeros initially.", "For indices x in order from [0, n - 1], dp[x] = max(nums[x], nums[x] + the maximum query from the tree in the range [0, dict[nums[x] - x]]), and if dp[x] is greater than the value in the tree at position dict[nums[x] - x], we update the value in the tree.", "The answer to the problem is the maximum value in dp." ] }, { "question_id": 2927, "task_id": "distribute-candies-among-children-iii", "drop": [ "premium" ] }, { "question_id": 2928, "task_id": "distribute-candies-among-children-i", "drop": [], "similar": [ "count-ways-to-distribute-candies" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "limit" ], "tests": { "total": 71, "kept": 71, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use three nested for loops to check all the triplets." ] }, { "question_id": 2929, "task_id": "distribute-candies-among-children-ii", "drop": [], "similar": [ "count-ways-to-distribute-candies" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "limit" ], "tests": { "total": 90, "kept": 90, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We can enumerate the number of candies of one particular child, let it be i which means 0 <= i <= min(limit, n).", "Suppose the 2nd child gets j candies. Then 0 <= j <= limit and i + j <= n.", "The 3rd child will hence get n - i - j candies and we should have 0 <= n - i - j <= limit.", "After some transformations, for each i, we have max(0, n - i - limit) <= j <= min(limit, n - i), each j corresponding to a solution. So the number of solutions for some i is max(min(limit, n - i) - max(0, n - i - limit) + 1, 0). Sum the expression for every i in [0, min(n, limit)]." ] }, { "question_id": 2930, "task_id": "number-of-strings-which-can-be-rearranged-to-contain-substring", "drop": [], "similar": [ "count-vowels-permutation" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 21, "kept": 21, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "A good string must contain at least one l, one t, and two e.", "Divide the problem into subproblems and use Dynamic Programming." ] }, { "question_id": 2931, "task_id": "maximum-spending-after-buying-items", "drop": [], "similar": [ "maximum-points-you-can-obtain-from-cards", "maximum-score-from-performing-multiplication-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "values" ], "tests": { "total": 97, "kept": 72, "dropped": { "constraint_violation": 25 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= m == values.length <= 10" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= values[i][j] <= 10**(6)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= values[i][j] <= 10**(6)" ] } ], "unchecked_constraints": [ "values[i] are sorted in non-increasing order." ], "public_tests": 2, "hints": [ "Iterate on days 1 to m * n.", "On each day, buy the product that minimizes values[i][values[i].length - 1], and pop it from values[i]." ] }, { "question_id": 2932, "task_id": "maximum-strong-pair-xor-i", "drop": [], "similar": [ "maximum-xor-of-two-numbers-in-an-array", "maximum-xor-with-an-element-from-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 125, "kept": 68, "dropped": { "constraint_violation": 57 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= nums[i] <= 100", "1 <= nums[i] <= 100" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 100", "1 <= nums[i] <= 100" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The constraints are small enough to make brute-force solutions pass." ] }, { "question_id": 2933, "task_id": "high-access-employees", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "access_times" ], "tests": { "total": 120, "kept": 114, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "access_times[i][0] consists only of English small letters." ] }, { "line": 67, "end_line": 67, "violates": [ "access_times[i][0] consists only of English small letters." ] }, { "line": 72, "end_line": 72, "violates": [ "access_times[i][0] consists only of English small letters." ] }, { "line": 77, "end_line": 77, "violates": [ "access_times[i][0] consists only of English small letters." ] }, { "line": 112, "end_line": 112, "violates": [ "access_times[i][0] consists only of English small letters." ] }, { "line": 115, "end_line": 115, "violates": [ "access_times[i][0] consists only of English small letters." ] } ], "unchecked_constraints": [ "access_times[i][1] is in 24-hour time format." ], "public_tests": 3, "hints": [ "Sort the access times in each person\u2019s list.", "A person\u2019s name should be in the answer list if there are 2 access times in his/her access time list (after sorting), where the index difference is at least 2 and the time difference is strictly less than 60 minutes." ] }, { "question_id": 2934, "task_id": "minimum-operations-to-maximize-last-elements-in-arrays", "drop": [], "similar": [ "minimum-swaps-to-make-sequences-increasing" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 130, "kept": 128, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 40, "end_line": 40, "violates": [ "1 <= nums2[i] <= 10**(9)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums1[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Consider how to calculate the minimum number of operations when nums1[n - 1] and nums2[n - 1] are fixed (they are not swapped).", "For each index i, there are only 3 possibilities:\n- nums1[i] <= nums1[n - 1] && nums2[i] <= nums2[n - 1]. We don't need to swap them.\n- nums1[i] <= nums2[n - 1] && nums2[i] <= nums1[n - 1]. We have to swap them.\n- Otherwise, there is no solution.", "There are 2 cases to determine the minimum number of operations:\n- The first case is the number of indices that need to be swapped when nums1[n - 1] and nums2[n - 1] are fixed.\n- The second case is 1 + the number of indices that need to be swapped when nums1[n - 1] and nums2[n - 1] are swapped.", "The answer is the minimum of both cases or -1 if there is no solution in either case." ] }, { "question_id": 2935, "task_id": "maximum-strong-pair-xor-ii", "drop": [], "similar": [ "maximum-xor-of-two-numbers-in-an-array", "maximum-xor-with-an-element-from-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 127, "kept": 112, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= nums[i] <= 2**(20) - 1", "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 2**(20) - 1", "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= nums[i] <= 2**(20) - 1" ] }, { "line": 128, "end_line": 128, "violates": [ "1 <= nums[i] <= 2**(20) - 1" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the array, now let x <= y which means |x - y| <= min(x, y) can now be written as y - x <= x or in other words, y <= 2 * x.", "If x and y have the same number of bits, try makingy\u2019s bits different from x if possible for each bit starting from the second most significant bit.", "If y has 1 more bit than x and y <= 2 * x use the idea about Digit DP to make y\u2019s prefix smaller than 2 * x + 1 as well as trying to make each bit different from x using a Hashmap.", "Alternatively, use Trie data structure to find the pair with maximum XOR." ] }, { "question_id": 2937, "task_id": "make-three-strings-equal", "drop": [], "similar": [ "delete-operation-for-two-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "s1", "s2", "s3" ], "tests": { "total": 126, "kept": 125, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 97, "end_line": 97, "violates": [ "1 <= s1.length, s2.length, s3.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Calculate the length of the longest common prefix of the 3 strings." ] }, { "question_id": 2938, "task_id": "separate-black-and-white-balls", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 152, "kept": 152, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Every 1 in the string s should be swapped with every 0 on its right side.", "Iterate right to left and count the number of 0 that have already occurred, whenever you iterate on 1 add that counter to the answer." ] }, { "question_id": 2939, "task_id": "maximum-xor-product", "drop": [], "similar": [ "maximum-xor-after-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "a", "b", "n" ], "tests": { "total": 74, "kept": 72, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "0 <= a, b < 2**(50)" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= a, b < 2**(50)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Iterate over bits from most significant to least significant.", "For the i^th bit, if both a and b have the same value, we can always make x\u2019s i^th bit different from a and b, so a ^ x and b ^ x both have the i^th bit set.", "Otherwise, we can only set the i^th bit of one of a ^ x or b ^ x. Depending on the previous bits of a ^ x or b ^ x, we should set the smaller value\u2019s i^th bit." ] }, { "question_id": 2940, "task_id": "find-building-where-alice-and-bob-can-meet", "drop": [], "similar": [ "number-of-visible-people-in-a-queue", "furthest-building-you-can-reach" ], "flags": [], "comparison": "exact", "parameter_names": [ "heights", "queries" ], "tests": { "total": 111, "kept": 111, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each query [x, y], if x > y, swap x and y. Now, we can assume that x <= y.", "For each query [x, y], if x == y or heights[x] < heights[y], then the answer is y since x \u2264 y.", "Otherwise, we need to find the smallest index t such that y < t and heights[x] < heights[t]. Note that heights[y] <= heights[x], so heights[x] < heights[t] is a sufficient condition.", "To find index t for each query, sort the queries in descending order of y. Iterate over the queries while maintaining a monotonic stack which we can binary search over to find index t." ] }, { "question_id": 2941, "task_id": "maximum-gcd-sum-of-a-subarray", "drop": [ "premium" ] }, { "question_id": 2942, "task_id": "find-words-containing-character", "drop": [], "similar": [ "find-target-indices-after-sorting-array" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "words", "x" ], "tests": { "total": 141, "kept": 139, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 122, "end_line": 122, "violates": [ "1 <= words[i].length <= 50" ] }, { "line": 140, "end_line": 140, "violates": [ "words[i] consists only of lowercase English letters." ] } ], "unchecked_constraints": [ "x is a lowercase English letter." ], "public_tests": 3, "hints": [ "Use two nested loops." ] }, { "question_id": 2943, "task_id": "maximize-area-of-square-hole-in-grid", "drop": [], "similar": [ "maximal-square", "maximum-square-area-by-removing-fences-from-a-field" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "m", "hBars", "vBars" ], "tests": { "total": 100, "kept": 91, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "2 <= vBars[i] <= m + 1" ] }, { "line": 33, "end_line": 33, "violates": [ "2 <= vBars[i] <= m + 1" ] }, { "line": 53, "end_line": 53, "violates": [ "2 <= hBars[i] <= n + 1", "2 <= vBars[i] <= m + 1" ] }, { "line": 54, "end_line": 54, "violates": [ "2 <= vBars[i] <= m + 1" ] }, { "line": 69, "end_line": 69, "violates": [ "2 <= vBars[i] <= m + 1" ] }, { "line": 71, "end_line": 71, "violates": [ "2 <= vBars[i] <= m + 1" ] }, { "line": 75, "end_line": 75, "violates": [ "2 <= vBars[i] <= m + 1" ] }, { "line": 76, "end_line": 76, "violates": [ "2 <= vBars[i] <= m + 1" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= hBars.length <= 100", "1 <= vBars.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort hBars and vBars and consider them separately.", "Compute the longest sequence of consecutive integer values in each array, denoted as [hx, hy] and [vx, vy], respectively.", "The maximum square length we can get is min(hy - hx + 2, vy - vx + 2).", "Square the maximum square length to get the area." ] }, { "question_id": 2944, "task_id": "minimum-number-of-coins-for-fruits", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "prices" ], "tests": { "total": 122, "kept": 113, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= prices[i] <= 10**(5)" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= prices[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The intended solution uses Dynamic Programming.", "Let dp[i] denote the minimum number of coins, such that we bought i^th fruit and acquired all the fruits in the range [i...n].", "dp[i] = min(dp[i], dp[j] + prices[i]) , where j is in the range [i + 1, i + 1 + i]." ] }, { "question_id": 2945, "task_id": "find-maximum-non-decreasing-array-length", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 111, "kept": 111, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let dp[i] be the maximum number of elements in the increasing sequence after processing the first i elements of the original array.", "We have dp[0] = 0. dp[i + 1] >= dp[i] (since if we have the solution for the first i elements, we can always merge the last one of the first i + 1 elements which is nums[i] into the solution of the first i elements.", "For i > 0, we want to dp[i] = max(dp[j] + 1) where sum(nums[i - 1] + nums[i - 2] +\u2026 + nums[j]) >= v[j] and v[j] is the last element of the solution ending with nums[j - 1]." ] }, { "question_id": 2946, "task_id": "matrix-similarity-after-cyclic-shifts", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat", "k" ], "tests": { "total": 99, "kept": 86, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= mat[i][j] <= 25" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= k <= 50" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= mat[i][j] <= 25" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= mat[i][j] <= 25" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= mat[i][j] <= 25" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= mat[i][j] <= 25" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= k <= 50" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= mat[i][j] <= 25" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= mat[i][j] <= 25" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= mat[i][j] <= 25" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= k <= 50" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= mat[i][j] <= 25" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= k <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "You can reduce k shifts to (k % n) shifts as after n shifts the matrix will become similar to the initial matrix." ] }, { "question_id": 2947, "task_id": "count-beautiful-substrings-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 90, "kept": 88, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= s.length <= 1000" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= s.length <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Iterate over all substrings and maintain the frequencies of vowels and consonants." ] }, { "question_id": 2948, "task_id": "make-lexicographically-smallest-array-by-swapping-elements", "drop": [], "similar": [ "smallest-string-with-swaps", "minimize-hamming-distance-after-swap-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "limit" ], "tests": { "total": 138, "kept": 132, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= limit <= 10**(9)" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= limit <= 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= limit <= 10**(9)" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 128, "end_line": 128, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Construct a virtual graph where all elements in nums are nodes and the pairs satisfying the condition have an edge between them.", "Instead of constructing all edges, we only care about the connected components.", "Can we use DSU?", "Sort nums. Now we just need to consider if the consecutive elements have an edge to check if they belong to the same connected component. Hence, all connected components become a list of position-consecutive elements after sorting.", "For each index of nums from 0 to nums.length - 1 we can change it to the current minimum value we have in its connected component and remove that value from the connected component." ] }, { "question_id": 2949, "task_id": "count-beautiful-substrings-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 91, "kept": 89, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= s.length <= 5 * 10**(4)" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= s.length <= 5 * 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For the given k find all the x integers such that x^2 % k == 0. Notice, that there aren\u2019t many such candidates.", "We can iterate over all such x values and count the number of substrings such that vowels == consonants == x.", "This can be done with prefix sums and hash map." ] }, { "question_id": 2950, "task_id": "number-of-divisible-substrings", "drop": [ "premium" ], "similar_to_test": [ "3448 count-substrings-divisible-by-last-digit" ] }, { "question_id": 2951, "task_id": "find-the-peaks", "drop": [], "similar": [ "find-peak-element", "find-a-peak-element-ii" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "mountain" ], "tests": { "total": 115, "kept": 113, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 47, "end_line": 47, "violates": [ "1 <= mountain[i] <= 100" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= mountain[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If nums[i] > num[i - 1] and nums[i] > nums[i + 1] nums[i] is a peak." ] }, { "question_id": 2952, "task_id": "minimum-number-of-coins-to-be-added", "drop": [], "similar": [ "coin-change", "most-expensive-item-that-can-not-be-bought" ], "flags": [], "comparison": "exact", "parameter_names": [ "coins", "target" ], "tests": { "total": 110, "kept": 106, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= target <= 10**(5)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= target <= 10**(5)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= coins[i] <= target" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= target <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the coins array and maintain the smallest sum that is unobtainable by induction.", "If we don\u2019t use any coins, the smallest integer that we cannot obtain by sum is 1. Suppose currently, for a fixed set of the first several coins the smallest integer that we cannot obtain is x + 1, namely we can form all integers in the range [1, x] but not x + 1.", "If the next unused coin\u2019s value is NOT x + 1 (note the array is sorted), we have to add x + 1 to the array. After this addition, we can form all values from x + 1 to 2 * x + 1 by adding x + 1 in [1, x]'s formations. So now we can form all the numbers of [1, 2 * x + 1]. After this iteration the new value of x becomes 2 * x + 1." ] }, { "question_id": 2953, "task_id": "count-complete-substrings", "drop": [], "similar": [ "number-of-substrings-containing-all-three-characters", "count-substrings-without-repeating-character" ], "flags": [], "comparison": "exact", "parameter_names": [ "word", "k" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "There are at most 26 different lengths of the complete substrings: k *1, k * 2, \u2026 k * 26.****", "For each length, we can use sliding window to count the frequency of each letter in the window.", "We still need to check for all characters in the window that abs(word[i] - word[i - 1]) <= 2. We do this by maintaining the values of abs(word[i] - word[i - 1]) in the sliding window dynamically in an ordered multiset or priority queue, so that we know the maximum value at each iteration." ] }, { "question_id": 2955, "task_id": "number-of-same-end-substrings", "drop": [ "premium" ] }, { "question_id": 2956, "task_id": "find-common-elements-between-two-arrays", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 102, "kept": 101, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= nums1[i], nums2[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Since the constraints are small, you can use brute force to solve the problem.", "For each element i in nums1, iterate over all elements of nums2 to find if it occurs." ] }, { "question_id": 2957, "task_id": "remove-adjacent-almost-equal-characters", "drop": [], "similar": [ "minimum-changes-to-make-alternating-binary-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 95, "kept": 91, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= word.length <= 100" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= word.length <= 100" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= word.length <= 100" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= word.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For i > 0, if word[i] and word[i - 1] are adjacent, we will change word[i] to another character. Which character should we change it to?", "We will change word[i] to some character that is not adjacent to word[i - 1] nor word[i + 1] (if it exists). Such a character always exists. However, since the problem does not ask for the final state of the string, It is enough to prove that the character exists and we do not need to find it." ] }, { "question_id": 2958, "task_id": "length-of-longest-subarray-with-at-most-k-frequency", "drop": [], "similar": [ "longest-substring-with-at-least-k-repeating-characters" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 107, "kept": 103, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each index i, find the rightmost index j >= i such that the frequency of each element in the subarray [i, j] is at most k.", "We can use 2 pointers / sliding window to achieve it." ] }, { "question_id": 2959, "task_id": "number-of-possible-sets-of-closing-branches", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "maxDistance", "roads" ], "tests": { "total": 86, "kept": 85, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 85, "end_line": 85, "violates": [ "1 <= wi <= 1000" ] } ], "unchecked_constraints": [ "All branches are reachable from each other by traveling some roads." ], "public_tests": 3, "hints": [ "Try all the possibilities of closing branches.", "On the vertices that are not closed, use Floyd-Warshall algorithm to find the shortest paths." ] }, { "question_id": 2960, "task_id": "count-tested-devices-after-test-operations", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "batteryPercentages" ], "tests": { "total": 107, "kept": 107, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "One solution is simulating the operations as explained in the problem statement, and it works in O(n^2) time.", "While going through the devices, you can maintain the number of previously tested devices, and the current device can be tested if batteryPercentages[i] is greater than the number of tested devices." ] }, { "question_id": 2962, "task_id": "count-subarrays-where-max-element-appears-at-least-k-times", "drop": [], "similar": [ "find-the-number-of-subarrays-where-boundary-elements-are-maximum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 90, "kept": 89, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 2964, "task_id": "number-of-divisible-triplet-sums", "drop": [ "premium" ] }, { "question_id": 2965, "task_id": "find-missing-and-repeated-values", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 69, "kept": 66, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "2 <= n == grid.length == grid[i].length <= 50" ] }, { "line": 36, "end_line": 36, "violates": [ "2 <= n == grid.length == grid[i].length <= 50" ] }, { "line": 38, "end_line": 38, "violates": [ "2 <= n == grid.length == grid[i].length <= 50" ] } ], "unchecked_constraints": [ "For all x that 1 <= x <= n * n there is exactly one x that is not equal to any of the grid members.", "For all x that 1 <= x <= n * n there is exactly one x that is equal to exactly two of the grid members.", "For all x that 1 <= x <= n * n except two of them there is exactly one pair of i, j that 0 <= i, j <= n - 1 and grid[i][j] == x." ], "public_tests": 2, "hints": [] }, { "question_id": 2966, "task_id": "divide-array-into-arrays-with-max-difference", "drop": [], "similar": [], "flags": [ "multiple_answers" ], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 95, "kept": 82, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 62, "end_line": 62, "violates": [ "n is a multiple of 3" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= k <= 10**(5)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= k <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try to use a greedy approach.", "Sort the array and try to group each 3 consecutive elements." ] }, { "question_id": 2967, "task_id": "minimum-cost-to-make-array-equalindromic", "drop": [], "similar": [ "minimum-moves-to-equal-array-elements-ii", "minimum-cost-to-make-array-equal", "minimum-operations-to-make-every-element-palindromic" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 117, "kept": 116, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [ "1 <= n <= 10**(5)" ], "public_tests": 3, "hints": [ "Find the median of nums after sorting it (if the length is even, we can select any number from the two in the middle). Let\u2019s call it m.", "Try the smallest palindromic number that is larger than or equal to m (if any) and the largest palindromic number that is smaller than or equal to m (if any). These two values are the candidate palindromic numbers for values of all indices.", "We can use math constructions to construct the two palindromic numbers in O(log(m) / 2) time or we can do it using brute-force by starting from m and checking smaller and larger values in O(sqrt(10^{log(m)})).", "It is also possible to just generate all palindromic numbers using recursion in O(sqrt(10^9log(10^9))." ] }, { "question_id": 2968, "task_id": "apply-operations-to-maximize-frequency-score", "drop": [], "similar": [ "frequency-of-the-most-frequent-element" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If you sort the original array, it is optimal to apply the operations on one subarray such that all the elements of that subarray become equal.", "You can use binary search to find the longest subarray where we can make the elements equal in at most k operations." ] }, { "question_id": 2969, "task_id": "minimum-number-of-coins-for-fruits-ii", "drop": [ "premium" ] }, { "question_id": 2970, "task_id": "count-the-number-of-incremovable-subarrays-i", "drop": [], "similar": [ "shortest-subarray-to-be-removed-to-make-array-sorted", "number-of-subarrays-that-match-a-pattern-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 123, "kept": 121, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use two loops to check all the subarrays." ] }, { "question_id": 2971, "task_id": "find-polygon-with-the-largest-perimeter", "drop": [], "similar": [ "3sum-smaller", "valid-triangle-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 95, "kept": 95, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "3 <= n <= 10**(5)" ], "public_tests": 3, "hints": [ "Sort the array.", "Use greedy algorithm. If we select an edge as the longest side, it is always better to pick up all the edges with length no longer than this longest edge.", "Note that the number of edges should not be less than 3." ] }, { "question_id": 2972, "task_id": "count-the-number-of-incremovable-subarrays-ii", "drop": [], "similar": [ "shortest-subarray-to-be-removed-to-make-array-sorted" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 153, "kept": 152, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Calculate the largest x such that nums[0..x] is strictly increasing.", "Calculate the smallest y such that nums[y..nums.length-1] is strictly increasing.", "For each i in [0, x], select the smallest j in [y, nums.length - 1]. Then we can keep the prefix with any suffix of [j, nums.length - 1] (including the empty one).", "Note that when i increases, j won\u2019t decrease. Use two-pointers.", "Note that we cannot delete an empty array, but we can delete the whole array." ] }, { "question_id": 2973, "task_id": "find-number-of-coins-to-place-in-tree-nodes", "drop": [], "similar": [ "collect-coins-in-a-tree", "find-the-maximum-sum-of-node-values" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges", "cost" ], "tests": { "total": 47, "kept": 41, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "cost.length == n" ] }, { "line": 24, "end_line": 24, "violates": [ "cost.length == n" ] }, { "line": 25, "end_line": 25, "violates": [ "cost.length == n" ] }, { "line": 28, "end_line": 28, "violates": [ "cost.length == n" ] }, { "line": 32, "end_line": 32, "violates": [ "cost.length == n" ] }, { "line": 38, "end_line": 38, "violates": [ "cost.length == n" ] } ], "unchecked_constraints": [ "1 <= |cost[i]| <= 10**(4)", "The input is generated such that edges represents a valid tree." ], "public_tests": 3, "hints": [ "Use DFS on the whole tree, for each subtree, save the largest three positive costs and the smallest three non-positive costs. This can be done by using two Heaps with the size of at most three.", "You need to store at most six values at each subtree.", "If there are more than three values in total, we can sort them. Let\u2019s call the resultant array A, the maximum product of three is max(A[0] * A[1] * A[n - 1], A[n - 1] * A[n - 2] * A[n - 3]). Don\u2019t forget to set the result to 0 if the value is negative.", "If there are less than three values for a subtree, set its result to 1." ] }, { "question_id": 2974, "task_id": "minimum-number-game", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 91, "kept": 87, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the array in increasing order and then swap the adjacent elements." ] }, { "question_id": 2975, "task_id": "maximum-square-area-by-removing-fences-from-a-field", "drop": [], "similar": [ "maximize-area-of-square-hole-in-grid" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n", "hFences", "vFences" ], "tests": { "total": 101, "kept": 90, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 38, "end_line": 38, "violates": [ "1 < vFences[i] < n" ] }, { "line": 42, "end_line": 42, "violates": [ "1 < vFences[i] < n" ] }, { "line": 45, "end_line": 45, "violates": [ "1 < hFences[i] < m" ] }, { "line": 46, "end_line": 46, "violates": [ "3 <= m, n <= 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 < vFences[i] < n" ] }, { "line": 65, "end_line": 65, "violates": [ "1 < vFences[i] < n" ] }, { "line": 69, "end_line": 69, "violates": [ "3 <= m, n <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 < vFences[i] < n" ] }, { "line": 95, "end_line": 95, "violates": [ "1 < vFences[i] < n" ] }, { "line": 98, "end_line": 98, "violates": [ "1 < vFences[i] < n" ] }, { "line": 99, "end_line": 99, "violates": [ "1 < vFences[i] < n" ] } ], "unchecked_constraints": [ "hFences and vFences are unique." ], "public_tests": 2, "hints": [ "Put 1 and m into hFences. The differences of any two values in the new hFences can be a horizontal edge of a rectangle.", "Similarly put 1 and n into vFences. The differences of any two values in the new vFences can be a vertical edge of a rectangle.", "Our goal is to find the maximum common value in both parts." ] }, { "question_id": 2976, "task_id": "minimum-cost-to-convert-string-i", "drop": [], "similar": [ "can-convert-string-in-k-moves", "minimum-moves-to-convert-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "source", "target", "original", "changed", "cost" ], "tests": { "total": 94, "kept": 61, "dropped": { "constraint_violation": 33 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= source.length == target.length <= 10**(5)" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= cost.length == original.length == changed.length <= 2000" ] }, { "line": 14, "end_line": 14, "violates": [ "original[i] != changed[i]" ] }, { "line": 15, "end_line": 15, "violates": [ "original[i] != changed[i]" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= source.length == target.length <= 10**(5)" ] }, { "line": 20, "end_line": 20, "violates": [ "original[i] != changed[i]" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= source.length == target.length <= 10**(5)" ] }, { "line": 28, "end_line": 28, "violates": [ "original[i] != changed[i]" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= source.length == target.length <= 10**(5)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= source.length == target.length <= 10**(5)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= cost.length == original.length == changed.length <= 2000" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= source.length == target.length <= 10**(5)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= source.length == target.length <= 10**(5)", "1 <= cost.length == original.length == changed.length <= 2000" ] }, { "line": 39, "end_line": 39, "violates": [ "original[i] != changed[i]" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= source.length == target.length <= 10**(5)", "original[i] != changed[i]" ] }, { "line": 42, "end_line": 42, "violates": [ "original[i] != changed[i]" ] }, { "line": 50, "end_line": 50, "violates": [ "original[i] != changed[i]" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= source.length == target.length <= 10**(5)", "original[i] != changed[i]" ] }, { "line": 54, "end_line": 54, "violates": [ "original[i] != changed[i]" ] }, { "line": 59, "end_line": 59, "violates": [ "original[i] != changed[i]" ] }, { "line": 61, "end_line": 61, "violates": [ "original[i] != changed[i]" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= source.length == target.length <= 10**(5)", "original[i] != changed[i]" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= source.length == target.length <= 10**(5)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= source.length == target.length <= 10**(5)" ] }, { "line": 73, "end_line": 73, "violates": [ "original[i] != changed[i]" ] }, { "line": 75, "end_line": 75, "violates": [ "original[i] != changed[i]" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= cost[i] <= 10**(6)", "original[i] != changed[i]" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= cost.length == original.length == changed.length <= 2000", "1 <= cost[i] <= 10**(6)", "original[i] != changed[i]" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= source.length == target.length <= 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= source.length == target.length <= 10**(5)" ] }, { "line": 89, "end_line": 89, "violates": [ "original[i] != changed[i]" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= source.length == target.length <= 10**(5)" ] }, { "line": 94, "end_line": 94, "violates": [ "original[i] != changed[i]" ] } ], "unchecked_constraints": [ "original[i], changed[i] are lowercase English letters." ], "public_tests": 3, "hints": [ "Construct a graph with each letter as a node, and construct an edge (a, b) with weight c if we can change from character a to letter b with cost c. (Keep the one with the smallest cost in case there are multiple edges between a and b).", "Calculate the shortest path for each pair of characters (source[i], target[i]). The sum of cost over all i in the range [0, source.length - 1]. If there is no path between source[i] and target[i], the answer is -1.", "Any shortest path algorithms will work since we only have 26 nodes. Since we only have at most 26 * 26 pairs, we can save the result to avoid re-calculation.", "We can also use Floyd Warshall's algorithm to precompute all the results." ] }, { "question_id": 2977, "task_id": "minimum-cost-to-convert-string-ii", "drop": [], "similar": [ "can-convert-string-in-k-moves", "minimum-moves-to-convert-string", "minimum-number-of-valid-strings-to-form-target-ii", "minimum-number-of-valid-strings-to-form-target-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "source", "target", "original", "changed", "cost" ], "tests": { "total": 91, "kept": 55, "dropped": { "constraint_violation": 36 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= source.length == target.length <= 1000" ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= source.length == target.length <= 1000", "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= source.length == target.length <= 1000" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= source.length == target.length <= 1000", "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= source.length == target.length <= 1000" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= source.length == target.length <= 1000", "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= source.length == target.length <= 1000" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= source.length == target.length <= 1000" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= source.length == target.length <= 1000", "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 50, "end_line": 50, "violates": [ "original[i] != changed[i]" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= source.length == target.length <= 1000" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= source.length == target.length <= 1000" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= original[i].length == changed[i].length <= source.length", "1 <= cost[i] <= 10**(6)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= cost.length == original.length == changed.length <= 100" ] }, { "line": 64, "end_line": 64, "violates": [ "original[i] != changed[i]" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= source.length == target.length <= 1000", "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= source.length == target.length <= 1000", "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= source.length == target.length <= 1000" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= source.length == target.length <= 1000", "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= source.length == target.length <= 1000" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= source.length == target.length <= 1000", "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= source.length == target.length <= 1000", "1 <= original[i].length == changed[i].length <= source.length" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= source.length == target.length <= 1000", "1 <= original[i].length == changed[i].length <= source.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Give each unique string in original and changed arrays a unique id. There are at most 2 * m unique strings in total where m is the length of the arrays. We can put them into a hash map to assign ids.", "We can pre-compute the smallest costs between all pairs of unique strings using Floyd Warshall algorithm in O(m ^ 3) time complexity.", "Let dp[i] be the smallest cost to change the first i characters (prefix) of source into target, leaving the suffix untouched. We have dp[0] = 0. dp[i] = min( dp[i - 1] if (source[i - 1] == target[i - 1]), dp[j-1] + cost[x][y] where x is the id of source[j..(i - 1)] and y is the id of target e[j..(i - 1)]) ). If neither of the two conditions is satisfied, dp[i] = infinity.", "We can use Trie to check for the second condition in O(1).", "The answer is dp[n] where n is source.length." ], "similar_to_test": [ "3291 minimum-number-of-valid-strings-to-form-target-i", "3292 minimum-number-of-valid-strings-to-form-target-ii" ] }, { "question_id": 2979, "task_id": "most-expensive-item-that-can-not-be-bought", "drop": [ "premium" ] }, { "question_id": 2980, "task_id": "check-if-bitwise-or-has-trailing-zeros", "drop": [], "similar": [ "count-odd-numbers-in-an-interval-range", "remove-trailing-zeros-from-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 119, "kept": 78, "dropped": { "constraint_violation": 41 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= nums[i] <= 100", "1 <= nums[i] <= 100" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 100", "1 <= nums[i] <= 100" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Bitwise OR can never unset a bit. If there is a solution, there must be a solution with only a pair of elements.", "We can brute force the solution: enumerate all the pairs.", "As the least significant bit must stay unset, the question is whether the array has at least two even elements." ] }, { "question_id": 2981, "task_id": "find-longest-special-substring-that-occurs-thrice-i", "drop": [], "similar": [ "longest-substring-without-repeating-characters", "longest-substring-with-at-least-k-repeating-characters" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 95, "kept": 87, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "3 <= s.length <= 50" ] }, { "line": 66, "end_line": 66, "violates": [ "3 <= s.length <= 50" ] }, { "line": 71, "end_line": 71, "violates": [ "3 <= s.length <= 50" ] }, { "line": 74, "end_line": 74, "violates": [ "3 <= s.length <= 50" ] }, { "line": 77, "end_line": 77, "violates": [ "3 <= s.length <= 50" ] }, { "line": 78, "end_line": 78, "violates": [ "3 <= s.length <= 50" ] }, { "line": 85, "end_line": 85, "violates": [ "3 <= s.length <= 50" ] }, { "line": 95, "end_line": 95, "violates": [ "3 <= s.length <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The constraints are small.", "Brute force checking all substrings." ] }, { "question_id": 2982, "task_id": "find-longest-special-substring-that-occurs-thrice-ii", "drop": [], "similar": [ "longest-substring-without-repeating-characters", "longest-substring-with-at-least-k-repeating-characters" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 22, "kept": 22, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let len[i] be the length of the longest special string ending with s[i].", "If i > 0 and s[i] == s[i - 1], len[i] = len[i - 1] + 1. Otherwise len[i] == 1.", "Group all the len[i] by s[i]. We have at most 26 groups.", "The maximum value of the third largest len[i] in each group is the answer.", "We only need to maintain the top three values for each group. You can use sorting, heap, or brute-force comparison to find the third largest value in each group." ] }, { "question_id": 2983, "task_id": "palindrome-rearrangement-queries", "drop": [], "similar": [ "longest-chunked-palindrome-decomposition" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "queries" ], "tests": { "total": 51, "kept": 29, "dropped": { "constraint_violation": 22 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "n is even." ] }, { "line": 7, "end_line": 7, "violates": [ "n is even." ] }, { "line": 9, "end_line": 9, "violates": [ "n / 2 <= ci <= di < n" ] }, { "line": 10, "end_line": 10, "violates": [ "n is even." ] }, { "line": 11, "end_line": 11, "violates": [ "n / 2 <= ci <= di < n" ] }, { "line": 13, "end_line": 13, "violates": [ "n / 2 <= ci <= di < n" ] }, { "line": 14, "end_line": 14, "violates": [ "n / 2 <= ci <= di < n", "n is even." ] }, { "line": 17, "end_line": 17, "violates": [ "n / 2 <= ci <= di < n" ] }, { "line": 18, "end_line": 18, "violates": [ "n / 2 <= ci <= di < n" ] }, { "line": 19, "end_line": 19, "violates": [ "n / 2 <= ci <= di < n" ] }, { "line": 20, "end_line": 20, "violates": [ "n / 2 <= ci <= di < n", "n is even." ] }, { "line": 21, "end_line": 21, "violates": [ "n / 2 <= ci <= di < n" ] }, { "line": 26, "end_line": 26, "violates": [ "n / 2 <= ci <= di < n" ] }, { "line": 27, "end_line": 27, "violates": [ "n / 2 <= ci <= di < n" ] }, { "line": 32, "end_line": 32, "violates": [ "n is even." ] }, { "line": 35, "end_line": 35, "violates": [ "n / 2 <= ci <= di < n" ] }, { "line": 36, "end_line": 36, "violates": [ "n / 2 <= ci <= di < n", "n is even." ] }, { "line": 41, "end_line": 41, "violates": [ "n / 2 <= ci <= di < n", "n is even." ] }, { "line": 42, "end_line": 42, "violates": [ "n / 2 <= ci <= di < n" ] }, { "line": 43, "end_line": 43, "violates": [ "n / 2 <= ci <= di < n" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= ai <= bi < n / 2", "n / 2 <= ci <= di < n" ] }, { "line": 52, "end_line": 52, "violates": [ "n is even." ] } ], "unchecked_constraints": [ "ai == queries[i][0], bi == queries[i][1]", "ci == queries[i][2], di == queries[i][3]" ], "public_tests": 3, "hints": [ "Consider two indices, x on the left side and its symmetrical index y on the right side.", "Store the frequencies of all of the letters in both intervals [a_i, b_i] and [c_i, d_i] in a query.", "If x is not in [a_i, b_i] and y is not in [c_i, d_i], they must be the same.", "If x is in [a_i, b_i] and y is not in [c_i, d_i], remove one occurrence of the character at index y from the frequency array on the left side.", "Similarly, if x is not in [a_i, b_i] and y is in [c_i, d_i], remove one occurrence of the character at index x from the frequency array on the right side.", "Finally, check whether the two frequency arrays are the same, and the indices that don't fall into any of the intervals are the same as well.", "Use prefix-sum + hashing to improve the time complexity." ] }, { "question_id": 2992, "task_id": "number-of-self-divisible-permutations", "drop": [ "premium" ] }, { "question_id": 2996, "task_id": "smallest-missing-integer-greater-than-sequential-prefix-sum", "drop": [], "similar": [ "longest-common-prefix", "first-missing-positive", "next-greater-element-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 123, "kept": 117, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "To find the longest sequential prefix, iterate from left to right. For a fixed i, if nums[i] != nums[i - 1] + 1 then the longest sequential prefix ends at i - 1." ] }, { "question_id": 2997, "task_id": "minimum-number-of-operations-to-make-array-xor-equal-to-k", "drop": [], "similar": [ "minimum-bit-flips-to-convert-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 115, "kept": 87, "dropped": { "constraint_violation": 28 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 35, "end_line": 35, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 58, "end_line": 58, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 73, "end_line": 73, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 104, "end_line": 104, "violates": [ "0 <= k <= 10**(6)" ] }, { "line": 105, "end_line": 105, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] }, { "line": 110, "end_line": 110, "violates": [ "0 <= nums[i] <= 10**(6)" ] }, { "line": 116, "end_line": 116, "violates": [ "0 <= nums[i] <= 10**(6)", "0 <= k <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Calculate the bitwise XOR of all elements of the original array and compare it to k in their binary representation.", "For each different bit between the bitwise XOR of elements of the original array and k we have to flip exactly one bit of an element in nums to make that bit equal." ] }, { "question_id": 2998, "task_id": "minimum-number-of-operations-to-make-x-and-y-equal", "drop": [], "similar": [ "shortest-bridge", "minimum-moves-to-spread-stones-over-grid" ], "flags": [], "comparison": "exact", "parameter_names": [ "x", "y" ], "tests": { "total": 133, "kept": 133, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The only way to make x larger is to increase it by 1 so if y >= x the answer is y - x.", "For y < x, x - y is always a candidate answer since we can repeatedly decrease x by one to reach y.", "We can also increase x and then use the division operations. For example, if x = 10 and y = 1, we can increment x by 1 then divide it by 11.", "Find an upper bound U on the maximum value of x we will reach an optimal solution. Since all values of x will be in the range [1, U], we can use BFS to find the answer.", "One possible upper bound on x is U = x + (x - y) . To reach any number strictly greater than U from x, we will need more than x - y operations which is not optimal since we can always reach y in x - y operations." ] }, { "question_id": 2999, "task_id": "count-the-number-of-powerful-integers", "drop": [], "similar": [ "powerful-integers", "numbers-with-repeated-digits" ], "flags": [], "comparison": "exact", "parameter_names": [ "start", "finish", "limit", "s" ], "tests": { "total": 147, "kept": 134, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 34, "end_line": 34, "violates": [ "1 <= start <= finish <= 10**(15)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= start <= finish <= 10**(15)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= start <= finish <= 10**(15)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= start <= finish <= 10**(15)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= start <= finish <= 10**(15)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= start <= finish <= 10**(15)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= start <= finish <= 10**(15)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= start <= finish <= 10**(15)" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= start <= finish <= 10**(15)" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= start <= finish <= 10**(15)" ] }, { "line": 130, "end_line": 130, "violates": [ "1 <= start <= finish <= 10**(15)" ] }, { "line": 137, "end_line": 137, "violates": [ "1 <= start <= finish <= 10**(15)" ] }, { "line": 138, "end_line": 138, "violates": [ "1 <= start <= finish <= 10**(15)" ] } ], "unchecked_constraints": [ "1 <= s.length <= floor(log10(finish)) + 1", "s does not have leading zeros." ], "public_tests": 3, "hints": [ "We can use digit DP to count powerful integers in the range [1, x].", "Let dp[i][j] be the number of integers that have i digits (with allowed leading 0s) and j refers to the comparison between the current number and the prefix of x, j == 0 if the i-digit number formed currently is identical to the leftmost i digits of x, else if j ==1 it means the i-digit number is smaller than the leftmost i digits of x.", "The answer is count[finish] - count[start - 1], where count[i] refers to the number of powerful integers in the range [1..i]." ] }, { "question_id": 3000, "task_id": "maximum-area-of-longest-diagonal-rectangle", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "dimensions" ], "tests": { "total": 107, "kept": 106, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 107, "end_line": 107, "violates": [ "1 <= dimensions[i][0], dimensions[i][1] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Diagonal of rectangle is sqrt(length^2 + width^2)." ] }, { "question_id": 3001, "task_id": "minimum-moves-to-capture-the-queen", "drop": [], "similar": [ "available-captures-for-rook", "queens-that-can-attack-the-king" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "a", "b", "c", "d", "e", "f" ], "tests": { "total": 89, "kept": 88, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= a, b, c, d, e, f <= 8" ] } ], "unchecked_constraints": [ "No two pieces are on the same square." ], "public_tests": 2, "hints": [ "The minimum number of moves can be either 1 or 2.", "The answer will be 1 if the queen is on the path of the rook or bishop and none of them is in between." ] }, { "question_id": 3002, "task_id": "maximum-size-of-a-set-after-removals", "drop": [], "similar": [ "intersection-of-two-arrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 103, "kept": 100, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "n is even." ] }, { "line": 54, "end_line": 54, "violates": [ "n == nums1.length == nums2.length" ] }, { "line": 62, "end_line": 62, "violates": [ "n == nums1.length == nums2.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Removing n / 2 elements from each array is the same as keeping n / 2 elements in each array.", "Think of a greedy algorithm.", "For each array, we will greedily keep the elements that are only in that array. Once we run out of such elements, we will keep the elements that are common to both arrays." ] }, { "question_id": 3003, "task_id": "maximize-the-number-of-partitions-after-operations", "drop": [], "similar": [ "can-make-palindrome-from-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each position, try to brute-force the replacements.", "To speed up the brute-force solution, we can precompute the following (without changing any index) using prefix sums and binary search:\n- pref[i]: The number of resulting partitions from the operations by performing the operations on s[0:i].\n- suff[i]: The number of resulting partitions from the operations by performing the operations on s[i:n - 1], where n == s.length.\n- partition_start[i]: The start index of the partition containing the i^th index after performing the operations.", "Now, for a position i, we can try all possible 25 replacements:\nFor a replacement, using prefix sums and binary search, we need to find the rightmost index, r, such that the number of distinct characters in the range [partition_start[i], r] is at most k.\nThere are 2 cases:\n- r >= i: the number of resulting partitions in this case is 1 + pref[partition_start[i] - 1] + suff[r + 1].\n- Otherwise, we need to find the rightmost index r_2 such that the number of distinct characters in the range [r:r_2] is at most k. The answer in this case is 2 + pref[partition_start[i] - 1] + suff[r_2 + 1]", "The answer is the maximum among all replacements." ] }, { "question_id": 3004, "task_id": "maximum-subtree-of-the-same-color", "drop": [ "premium" ] }, { "question_id": 3005, "task_id": "count-elements-with-maximum-frequency", "drop": [], "similar": [ "maximum-frequency-of-an-element-after-performing-operations-i", "maximum-frequency-of-an-element-after-performing-operations-ii", "maximum-difference-between-even-and-odd-frequency-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 116, "kept": 116, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Find frequencies of all elements of the array.", "Find the elements that have the maximum frequencies and count their total occurrences." ], "similar_to_test": [ "3346 maximum-frequency-of-an-element-after-performing-operations-i", "3347 maximum-frequency-of-an-element-after-performing-operations-ii", "3445 maximum-difference-between-even-and-odd-frequency-ii" ] }, { "question_id": 3006, "task_id": "find-beautiful-indices-in-the-given-array-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "a", "b", "k" ], "tests": { "total": 115, "kept": 113, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 58, "end_line": 58, "violates": [ "1 <= a.length, b.length <= 10" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= a.length, b.length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each i, you can iterate over all js and determine if i is beautiful or not." ] }, { "question_id": 3007, "task_id": "maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k", "drop": [], "similar": [], "flags": [ "figure_reference" ], "comparison": "exact", "parameter_names": [ "k", "x" ], "tests": { "total": 126, "kept": 126, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Binary search the answer.", "In each step of the binary search you should calculate the number of the set bits in the i^th position. Then calculate the sum of them." ] }, { "question_id": 3008, "task_id": "find-beautiful-indices-in-the-given-array-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "a", "b", "k" ], "tests": { "total": 122, "kept": 120, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "1 <= k <= s.length <= 5 * 10**(5)" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= k <= s.length <= 5 * 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use KMP or string hashing." ] }, { "question_id": 3009, "task_id": "maximum-number-of-intersections-on-the-chart", "drop": [ "premium" ] }, { "question_id": 3010, "task_id": "divide-an-array-into-subarrays-with-minimum-cost-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 116, "kept": 108, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 50" ] } ], "unchecked_constraints": [ "3 <= n <= 50" ], "public_tests": 3, "hints": [] }, { "question_id": 3011, "task_id": "find-if-array-can-be-sorted", "drop": [], "similar": [ "sort-integers-by-the-number-of-1-bits" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 135, "kept": 109, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 125, "end_line": 125, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 128, "end_line": 128, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 129, "end_line": 129, "violates": [ "1 <= nums[i] <= 2**(8)" ] }, { "line": 135, "end_line": 135, "violates": [ "1 <= nums[i] <= 2**(8)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Split the array into segments. Each segment contains consecutive elements with the same number of set bits.", "From left to right, the previous segment\u2019s largest element should be smaller than the current segment\u2019s smallest element." ] }, { "question_id": 3012, "task_id": "minimize-length-of-array-using-operations", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 136, "kept": 134, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The problem can be solved by considering different cases.", "Let the minimum value in nums be x; we can consider the following cases:", "If x occurs once: The minimum length of nums achievable in this case is 1, since every other value, y, can be paired with x, resulting in deleting x and y, and inserting x % y == x, since x < y. So, only x remains after the operations.", "If there is a value y in nums such that y % x is not equal to 0: The minimum achievable length in this case is 1 as well, because inserting y % x creates a new minimum, since y % x < x, returning to the first case.", "If neither of the previous cases holds, and x occurs cnt times: The minimum length of nums achievable in this case is ceil(cnt / 2)." ] }, { "question_id": 3013, "task_id": "divide-an-array-into-subarrays-with-minimum-cost-ii", "drop": [], "similar": [ "minimum-cost-to-cut-a-stick", "minimum-cost-to-split-an-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k", "dist" ], "tests": { "total": 193, "kept": 190, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [ "3 <= n <= 10**(5)", "3 <= k <= n", "k - 2 <= dist <= n - 2" ], "public_tests": 3, "hints": [ "For each i > 0, try each nums[i] as the first element of the second subarray. We need to find the sum of k - 2 smallest values in the index range [i + 1, min(i + dist, n - 1)].", "Typically, we use a max heap to maintain the top k - 2 smallest values dynamically. Here we also have a sliding window, which is the index range [i + 1, min(i + dist, n - 1)]. We can use another min heap to put unselected values for future use.", "Update the two heaps when iteration over i. Ordered/Tree sets are also a good choice since we have to delete elements.", "If the max heap\u2019s size is less than k - 2, use the min heap\u2019s value to fill it. If the maximum value in the max heap is larger than the smallest value in the min heap, swap them in the two heaps." ] }, { "question_id": 3014, "task_id": "minimum-number-of-pushes-to-type-word-i", "drop": [], "similar": [ "letter-combinations-of-a-phone-number" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 202, "kept": 189, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= word.length <= 26" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= word.length <= 26" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= word.length <= 26" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= word.length <= 26" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= word.length <= 26" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= word.length <= 26" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= word.length <= 26" ] }, { "line": 125, "end_line": 125, "violates": [ "1 <= word.length <= 26" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= word.length <= 26" ] }, { "line": 157, "end_line": 157, "violates": [ "1 <= word.length <= 26", "word consists of lowercase English letters." ] }, { "line": 159, "end_line": 159, "violates": [ "1 <= word.length <= 26" ] }, { "line": 173, "end_line": 173, "violates": [ "1 <= word.length <= 26" ] }, { "line": 182, "end_line": 182, "violates": [ "1 <= word.length <= 26" ] } ], "unchecked_constraints": [ "All letters in word are distinct." ], "public_tests": 2, "hints": [ "We have 8 keys in total. We can type 8 characters with one push each, 8 different characters with two pushes each, and so on.", "The optimal way is to map letters to keys evenly." ] }, { "question_id": 3015, "task_id": "count-the-number-of-houses-at-a-certain-distance-i", "drop": [], "similar": [ "walls-and-gates" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "x", "y" ], "tests": { "total": 114, "kept": 114, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Start from each house, run a BFS to get all the distances from this house to all the other houses." ] }, { "question_id": 3016, "task_id": "minimum-number-of-pushes-to-type-word-ii", "drop": [], "similar": [ "letter-combinations-of-a-phone-number" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 47, "kept": 47, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "We have 8 keys in total. We can type 8 characters with one push each, 8 different characters with two pushes each, and so on.", "The optimal way is to map letters to keys evenly.", "Sort the letters by frequencies in the word in non-increasing order." ] }, { "question_id": 3017, "task_id": "count-the-number-of-houses-at-a-certain-distance-ii", "drop": [], "similar": [ "walls-and-gates" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "x", "y" ], "tests": { "total": 87, "kept": 87, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If there were no additional street connecting house x to house y, there would be 2 * (n - i) pairs of houses at distance i.", "The shortest distance between house i and house j (j < i) is along one of these paths: - i -> j - i -> y---x -> j", "Try to change the distances calculated by path i ->j to the other path.", "Can we use prefix sums to compute the answer?" ] }, { "question_id": 3018, "task_id": "maximum-number-of-removal-queries-that-can-be-processed-i", "drop": [ "premium" ] }, { "question_id": 3019, "task_id": "number-of-changing-keys", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 78, "kept": 72, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= s.length <= 100" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= s.length <= 100" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= s.length <= 100" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= s.length <= 100" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= s.length <= 100" ] }, { "line": 76, "end_line": 76, "violates": [ "s consists of only upper case and lower case English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Change all the characters to lowercase and then return the number of indices where the character does not match with the last index character." ] }, { "question_id": 3020, "task_id": "find-the-maximum-number-of-elements-in-subset", "drop": [], "similar": [ "longest-consecutive-sequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 86, "kept": 56, "dropped": { "constraint_violation": 30 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "2 <= nums.length <= 10**(5)" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= nums[i] <= 10**(9)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We can select an odd number of 1\u2019s.", "Put all the values into a HashSet. We can start from each x > 1 as the smallest chosen value and we can find the longest subset by checking the new values (which are the square of the previous value) in the set by brute force.", "Note when x > 1, x^2, x^4, x^8, \u2026 increases very fast, the longest subset with smallest value x cannot be very long. (The length is O(log(log(10^9))).", "Hence we can directly check all lengths less than 10 for all values of x." ] }, { "question_id": 3021, "task_id": "alice-and-bob-playing-flower-game", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "m" ], "tests": { "total": 66, "kept": 64, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "1 <= n, m <= 10**(5)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= n, m <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "(x, y) is valid if and only if they have different parities." ] }, { "question_id": 3022, "task_id": "minimize-or-of-remaining-elements-using-operations", "drop": [], "similar": [ "maximum-xor-after-operations", "apply-operations-on-array-to-maximize-sum-of-squares" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 109, "kept": 102, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "0 <= k < nums.length" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= k < nums.length" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= nums[i] < 2**(30)" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= nums[i] < 2**(30)", "0 <= k < nums.length" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= k < nums.length" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= nums[i] < 2**(30)" ] }, { "line": 110, "end_line": 110, "violates": [ "0 <= nums[i] < 2**(30)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "From the most significant bit to the least significant bit, maintain the bits that will not be included in the final answer in a variable mask.", "For a fixed bit, add it to mask then check if there exists some sequence of k operations such that mask & answer == 0 where answer is the bitwise-or of the remaining elements of nums. If there is no such sequence of operations, remove the current bit from mask. How can we perform this check?", "Let x be the bitwise-and of all elements of nums. If x AND mask != 0, there is no sequence of operations that satisfies the condition in the previous hint. This is because even if we perform this operation n - 1 times on the array, we will end up with x as the final element.", "Otherwise, there exists at least one such sequence. It is sufficient to check if the number of operations in such a sequence is less than k. Let\u2019s calculate the minimum number of operations in such a sequence.", "Iterate over the array from left to right, if nums[i] & mask != 0, apply the operation on index i.", "After iterating over all elements, let x be the bitwise-and of all elements of nums. If x == 0, then we have found the minimum number of operations. Otherwise, It can be proven that we need exactly one more operation so that x == 0.", "The condition in the second hint is satisfied if and only if the minimum number of operations is less than or equal to k." ] }, { "question_id": 3024, "task_id": "type-of-triangle", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 96, "kept": 95, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The condition for a valid triangle is that for any two sides, the sum of their lengths must be greater than the third side.", "Simply count the number of unique edge lengths after checking it\u2019s a valid triangle." ] }, { "question_id": 3025, "task_id": "find-the-number-of-ways-to-place-people-i", "drop": [], "similar": [ "rectangle-area" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "points" ], "tests": { "total": 111, "kept": 105, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "0 <= points[i][0], points[i][1] <= 50" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= points[i][0], points[i][1] <= 50" ] }, { "line": 66, "end_line": 66, "violates": [ "All points[i] are distinct." ] }, { "line": 81, "end_line": 81, "violates": [ "0 <= points[i][0], points[i][1] <= 50" ] }, { "line": 94, "end_line": 94, "violates": [ "All points[i] are distinct." ] }, { "line": 103, "end_line": 103, "violates": [ "0 <= points[i][0], points[i][1] <= 50" ] } ], "unchecked_constraints": [ "2 <= n <= 50" ], "public_tests": 3, "hints": [ "We can enumerate all the upper-left and lower-right corners.", "If the upper-left corner is (x1, y1) and lower-right corner is (x2, y2), check that there is no point (x, y) such that x1 <= x <= x2 and y2 <= y <= y1." ] }, { "question_id": 3026, "task_id": "maximum-good-subarray-sum", "drop": [], "similar": [ "maximum-subarray", "maximum-sum-of-distinct-subarrays-with-length-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 116, "kept": 101, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 6, "end_line": 6, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 7, "end_line": 7, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= k <= 10**(9)", "1 <= k <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= k <= 10**(9)", "1 <= k <= 10**(9)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Save all the prefix sums into a HashMap.", "For the index i store the element at index i + 1 as the key and the prefix sum till i as the value.", "For each prefix sum ending at nums[i], try finding nums[i] - k and nums[i] + k in the HashMap and update the answer." ] }, { "question_id": 3027, "task_id": "find-the-number-of-ways-to-place-people-ii", "drop": [], "similar": [ "rectangle-area" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "points" ], "tests": { "total": 120, "kept": 118, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 87, "end_line": 87, "violates": [ "All points[i] are distinct." ] }, { "line": 88, "end_line": 88, "violates": [ "All points[i] are distinct." ] } ], "unchecked_constraints": [ "2 <= n <= 1000" ], "public_tests": 3, "hints": [ "Sort the points by x-coordinate in non-decreasing order and break the tie by sorting the y-coordinate in non-increasing order.", "Now consider two points upper-left corner points[i] and lower-right corner points[j], such that i < j and points[i][0] <= points[j][0] and points[i][1] >= points[j][1].", "Instead of brute force looping, we can save the largest y-coordinate that is no larger than points[i][1] when looping on j, say the value is m. And if m < points[j][1], the upper-left and lower-right corner pair is valid.", "The actual values don\u2019t matter, we can compress all x-coordinates and y-coordinates to the range [1, n]. Can we use prefix sum now?" ] }, { "question_id": 3028, "task_id": "ant-on-the-boundary", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 123, "kept": 109, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 11, "end_line": 11, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 26, "end_line": 26, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 30, "end_line": 30, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 45, "end_line": 45, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 59, "end_line": 59, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 68, "end_line": 68, "violates": [ "nums[i] != 0" ] }, { "line": 77, "end_line": 77, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 80, "end_line": 80, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 87, "end_line": 87, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 89, "end_line": 89, "violates": [ "nums[i] != 0" ] }, { "line": 102, "end_line": 102, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 112, "end_line": 112, "violates": [ "-10 <= nums[i] <= 10" ] }, { "line": 123, "end_line": 123, "violates": [ "-10 <= nums[i] <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Define a variable and add nums[i] to it in each step." ] }, { "question_id": 3029, "task_id": "minimum-time-to-revert-word-to-initial-state-i", "drop": [], "similar": [ "longest-happy-prefix" ], "flags": [], "comparison": "exact", "parameter_names": [ "word", "k" ], "tests": { "total": 108, "kept": 108, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the longest suffix which is also a prefix and the length is multiple of k." ] }, { "question_id": 3030, "task_id": "find-the-grid-of-region-average", "drop": [], "similar": [ "range-sum-query-2d-immutable", "k-radius-subarray-averages" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "image", "threshold" ], "tests": { "total": 90, "kept": 90, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "3 <= n, m <= 500" ], "public_tests": 3, "hints": [ "Try all the 3 * 3 sub-grids to find all the regions.", "Keep two 2-D arrays sum and num, for each position (x, y) in a region, increase sum[x][y] by the average sum of the region and increase num[x][y] by 1.", "For each position (x, y), sum[x][y] / num[x][y] is the answer. Note when num[x][y] == 0, we use the original value in image instead." ] }, { "question_id": 3031, "task_id": "minimum-time-to-revert-word-to-initial-state-ii", "drop": [], "similar": [ "longest-happy-prefix" ], "flags": [], "comparison": "exact", "parameter_names": [ "word", "k" ], "tests": { "total": 108, "kept": 108, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the longest suffix which is also a prefix and whose length is a multiple of K in O(N).", "Use Z-function." ] }, { "question_id": 3032, "task_id": "count-numbers-with-unique-digits-ii", "drop": [ "premium" ] }, { "question_id": 3033, "task_id": "modify-the-matrix", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "matrix" ], "tests": { "total": 85, "kept": 82, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "-1 <= matrix[i][j] <= 100" ] }, { "line": 13, "end_line": 13, "violates": [ "-1 <= matrix[i][j] <= 100" ] }, { "line": 69, "end_line": 69, "violates": [ "-1 <= matrix[i][j] <= 100" ] } ], "unchecked_constraints": [ "The input is generated such that each column contains at least one non-negative integer." ], "public_tests": 2, "hints": [] }, { "question_id": 3034, "task_id": "number-of-subarrays-that-match-a-pattern-i", "drop": [], "similar": [ "count-the-number-of-incremovable-subarrays-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "pattern" ], "tests": { "total": 112, "kept": 109, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Iterate over all indices i then, using a second loop, check if the subarray starting at index i matches the pattern." ] }, { "question_id": 3035, "task_id": "maximum-palindromes-after-operations", "drop": [], "similar": [ "valid-palindrome" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 95, "kept": 95, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "We can redistribute all the letters freely among the words.", "Calculate the frequency of each letter and total the number of matching letter pairs that can be formed from the letters, i.e., total = sum(freq[ch] / 2) for all 'a' <= ch <= 'z'.", "We can greedily try making palindromes from words[i] with the smallest length to words[i] with the longest length.", "For the current index, i, we try to make words[i] a palindrome. We need len(words[i]) / 2 matching character pairs, and the letter in the middle (if it exists) can be freely chosen afterward.", "We can check if we have enough pairs for index i; if we do, we increase the number of palindromes we can make and decrease the number of pairs we have. Otherwise, we end the loop at this index.", "The answer is the number of palindromes we were able to make in the end." ] }, { "question_id": 3036, "task_id": "number-of-subarrays-that-match-a-pattern-ii", "drop": [], "similar": [ "match-substring-after-replacement" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "pattern" ], "tests": { "total": 111, "kept": 111, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Create a second array nums2 such that nums2[i] = 1 if nums[i + 1] > nums[i], nums2[i] = 0 if nums[i + 1] == nums[i], and nums2[i] = -1 if nums[i + 1] < nums[i].", "The problem becomes: \u201cCount the number of subarrays in nums2 that are equal to pattern.", "Use Knuth-Morris-Pratt or Z-Function algorithms." ] }, { "question_id": 3038, "task_id": "maximum-number-of-operations-with-the-same-score-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 109, "kept": 103, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 3039, "task_id": "apply-operations-to-make-string-empty", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 40, "kept": 40, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Before the last operation, only the most frequent characters in the original string will remain.", "Keep only the last occurence of each of the most frequent characters." ] }, { "question_id": 3040, "task_id": "maximum-number-of-operations-with-the-same-score-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 116, "kept": 114, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "After the first operation, the score of other operations is fixed.", "For the fixed score use dynamic programming dp[l][r] to find a maximum number of operations on the subarray nums[l..r]." ] }, { "question_id": 3041, "task_id": "maximize-consecutive-elements-in-an-array-after-modification", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 144, "kept": 144, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the array and try using dynamic programming.", "Let dp[i] be the length of the longest consecutive elements ending at element at index i in the sorted array." ] }, { "question_id": 3042, "task_id": "count-prefix-and-suffix-pairs-i", "drop": [], "similar": [ "implement-trie-prefix-tree", "design-add-and-search-words-data-structure" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 119, "kept": 86, "dropped": { "constraint_violation": 33 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= words[i].length <= 10" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= words[i].length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Iterate through all index pairs (i, j), such that i < j, and check isPrefixAndSuffix(words[i], words[j]).", "The answer is the total number of pairs where isPrefixAndSuffix(words[i], words[j]) == true." ] }, { "question_id": 3043, "task_id": "find-the-length-of-the-longest-common-prefix", "drop": [], "similar": [ "longest-common-prefix", "longest-common-suffix-queries" ], "flags": [], "comparison": "exact", "parameter_names": [ "arr1", "arr2" ], "tests": { "total": 121, "kept": 65, "dropped": { "constraint_violation": 56 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= arr1[i], arr2[i] <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Put all the possible prefixes of each element in arr1 into a HashSet.", "For all the possible prefixes of each element in arr2, check if it exists in the HashSet." ] }, { "question_id": 3044, "task_id": "most-frequent-prime", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "mat" ], "tests": { "total": 81, "kept": 52, "dropped": { "constraint_violation": 29 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= m, n <= 6", "1 <= mat[i][j] <= 9" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= m, n <= 6", "1 <= mat[i][j] <= 9" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= mat[i][j] <= 9" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= m, n <= 6" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= m, n <= 6" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= mat[i][j] <= 9" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= mat[i][j] <= 9" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= mat[i][j] <= 9" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= m, n <= 6", "1 <= mat[i][j] <= 9" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= m, n <= 6" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= mat[i][j] <= 9" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= m, n <= 6", "1 <= mat[i][j] <= 9" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= mat[i][j] <= 9" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= m, n <= 6" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= mat[i][j] <= 9" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= m, n <= 6", "1 <= mat[i][j] <= 9" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= mat[i][j] <= 9" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= m, n <= 6" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= mat[i][j] <= 9" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= m, n <= 6" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= m, n <= 6", "1 <= mat[i][j] <= 9" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= m, n <= 6", "1 <= mat[i][j] <= 9" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= mat[i][j] <= 9" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= m, n <= 6" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= mat[i][j] <= 9" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= m, n <= 6" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= mat[i][j] <= 9" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= m, n <= 6", "1 <= mat[i][j] <= 9" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= mat[i][j] <= 9" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use recursion to find all possible numbers for each cell and then check for prime." ] }, { "question_id": 3045, "task_id": "count-prefix-and-suffix-pairs-ii", "drop": [], "similar": [ "implement-trie-prefix-tree", "design-add-and-search-words-data-structure" ], "flags": [], "comparison": "exact", "parameter_names": [ "words" ], "tests": { "total": 69, "kept": 69, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The sum of the lengths of all words[i] does not exceed 5 * 10**(5)." ], "public_tests": 3, "hints": [ "We can use a trie to solve it.", "Process all words[i] from left to right. The trie stores the pair (words[i][j], words[i][words[i].length - j - 1]) as a single character; we process all the words in this way.", "During insertion, keep a counter in each trie node, as in a normal trie. If the current node is the end of a word (namely, the pair on that node is (words[i][words[i].length - 1], words[i][0])), increase the node's counter by 1.", "From left to right, insert each word into the trie, and increase our final result by each node's counter when going down the trie during insertion. This means there was at least one word that is both a prefix and a suffix of the current word before." ] }, { "question_id": 3046, "task_id": "split-the-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 110, "kept": 104, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "nums.length % 2 == 0" ] }, { "line": 56, "end_line": 56, "violates": [ "nums.length % 2 == 0" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 65, "end_line": 65, "violates": [ "nums.length % 2 == 0" ] }, { "line": 68, "end_line": 68, "violates": [ "nums.length % 2 == 0" ] }, { "line": 97, "end_line": 97, "violates": [ "nums.length % 2 == 0" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It\u2019s impossible if the same number occurs more than twice. So just check the frequency of each value." ] }, { "question_id": 3047, "task_id": "find-the-largest-area-of-square-inside-two-rectangles", "drop": [], "similar": [ "rectangle-area" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "bottomLeft", "topRight" ], "tests": { "total": 102, "kept": 102, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Brute Force the intersection area of each pair of rectangles.", "Two rectangles will not overlap when the bottom left x coordinate of one rectangle is greater than the top right x coordinate of the other rectangle. The same is true for the y coordinate.", "The intersection area (if any) is also a rectangle. Find its corners." ] }, { "question_id": 3048, "task_id": "earliest-second-to-mark-indices-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "changeIndices" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Consider using binary search.", "Suppose the answer <= x; we can mark each index as late as possible. Namely, mark each index at the last occurrence in the array changeIndices[1..x].", "When marking an index, which is the last occurrence at the second i, we check whether we have a sufficient number of decrement operations to mark all the previous indices whose last occurrences have already been marked, and the current index, i.e., i - sum_of_marked_indices_values - cnt_of_marked_indices >= nums[changeIndices[i]].", "The answer is the earliest second when all indices can be marked after running the binary search or -1 if there is no such second." ] }, { "question_id": 3062, "task_id": "winner-of-the-linked-list-game", "drop": [ "premium" ] }, { "question_id": 3063, "task_id": "linked-list-frequency", "drop": [ "premium" ] }, { "question_id": 3065, "task_id": "minimum-operations-to-exceed-threshold-value-i", "drop": [], "similar": [ "search-insert-position", "majority-element", "number-of-employees-who-met-the-target" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 104, "kept": 102, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 91, "end_line": 91, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums.length <= 50" ] } ], "unchecked_constraints": [ "The input is generated such that there is at least one index i such that nums[i] >= k." ], "public_tests": 3, "hints": [ "Iterate over nums and count the number of elements less than k." ] }, { "question_id": 3066, "task_id": "minimum-operations-to-exceed-threshold-value-ii", "drop": [], "similar": [ "minimum-operations-to-halve-array-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 103, "kept": 95, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= k <= 10**(9)" ] } ], "unchecked_constraints": [ "The input is generated such that an answer always exists. That is, after performing some number of operations, all elements of the array are greater than or equal to k." ], "public_tests": 2, "hints": [ "Use priority queue to keep track of minimum elements.", "Remove the minimum two elements, perform the operation, and insert the resulting number into the priority queue." ] }, { "question_id": 3067, "task_id": "count-pairs-of-connectable-servers-in-a-weighted-tree-network", "drop": [], "similar": [ "minimum-height-trees", "sum-of-distances-in-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges", "signalSpeed" ], "tests": { "total": 92, "kept": 92, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The input is generated such that edges represents a valid tree." ], "public_tests": 2, "hints": [ "Take each node as the root of the tree, run DFS, and save for each node i, the number of nodes in the subtree rooted at i whose distance to the root is divisible by signalSpeed.", "If the root has m children named c_1, c_2, \u2026, c_m that respectively have num[c_1], num[c_2], \u2026, num[c_m] nodes in their subtrees whose distance is divisible by signalSpeed. Then, there are ((S - num[c_i]) * num[c_i]) / 2that are connectable through the root that we have fixed, where S is the sum of num[c_i]." ] }, { "question_id": 3068, "task_id": "find-the-maximum-sum-of-node-values", "drop": [], "similar": [ "maximum-score-after-applying-operations-on-a-tree", "find-number-of-coins-to-place-in-tree-nodes" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums", "k", "edges" ], "tests": { "total": 91, "kept": 87, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 63, "end_line": 63, "violates": [ "edges.length == n - 1" ] }, { "line": 87, "end_line": 87, "violates": [ "edges.length == n - 1" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [ "The input is generated such that edges represent a valid tree." ], "public_tests": 3, "hints": [ "Select any node as the root.", "Let dp[x][c] be the maximum sum we can get for the subtree rooted at node x, where c is a boolean representing whether the edge between node x and its parent (if any) is selected or not.", "dp[x][c] = max(sum(dp[y][cy]) + v(nums[x], sum(cy) + c)) where cy is 0 or 1. When sum(cy) + c is odd, v(nums[x], sum(cy) + c) = nums[x] XOR k. When sum(cy) + c is even, v(nums[x], sum(cy) + c) = nums[x].", "There\u2019s also an easier solution - does the parity of the number of elements where nums[i] XOR k > nums[i] help?" ] }, { "question_id": 3069, "task_id": "distribute-elements-into-two-arrays-i", "drop": [], "similar": [ "split-array-largest-sum", "divide-array-into-equal-pairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 107, "kept": 101, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "All elements in nums are distinct." ] }, { "line": 45, "end_line": 45, "violates": [ "All elements in nums are distinct." ] }, { "line": 72, "end_line": 72, "violates": [ "All elements in nums are distinct." ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 89, "end_line": 89, "violates": [ "All elements in nums are distinct." ] } ], "unchecked_constraints": [ "3 <= n <= 50" ], "public_tests": 2, "hints": [ "Divide the array into two arrays by keeping track of the last elements of both subarrays." ] }, { "question_id": 3070, "task_id": "count-submatrices-with-top-left-element-and-sum-less-than-k", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid", "k" ], "tests": { "total": 104, "kept": 99, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= k <= 10**(9)", "1 <= k <= 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= grid[i][j] <= 1000" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= k <= 10**(9)", "1 <= k <= 10**(9)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 3071, "task_id": "minimum-operations-to-write-the-letter-y-on-a-grid", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 76, "kept": 73, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "n == grid.length == grid[i].length" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= grid[i][j] <= 2" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= grid[i][j] <= 2" ] } ], "unchecked_constraints": [ "n is odd." ], "public_tests": 2, "hints": [] }, { "question_id": 3072, "task_id": "distribute-elements-into-two-arrays-ii", "drop": [], "similar": [ "split-array-largest-sum", "divide-array-into-equal-pairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 106, "kept": 106, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "3 <= n <= 10**(5)" ], "public_tests": 3, "hints": [ "We need a data structure that counts the number of integers greater than a given value x and supports insertion.", "Use Segment Tree or Binary Indexed Tree by compressing the numbers to the range [1,n]." ] }, { "question_id": 3073, "task_id": "maximum-increasing-triplet-value", "drop": [ "premium" ] }, { "question_id": 3074, "task_id": "apple-redistribution-into-boxes", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "apple", "capacity" ], "tests": { "total": 115, "kept": 110, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= apple[i], capacity[i] <= 50" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= m == capacity.length <= 50" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= m == capacity.length <= 50" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= apple[i], capacity[i] <= 50" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= m == capacity.length <= 50" ] } ], "unchecked_constraints": [ "The input is generated such that it's possible to redistribute packs of apples into boxes." ], "public_tests": 2, "hints": [ "Sort array capacity in non-decreasing order.", "Greedily select boxes with the largest capacities to redistribute apples optimally." ] }, { "question_id": 3075, "task_id": "maximize-happiness-of-selected-children", "drop": [], "similar": [ "maximum-candies-allocated-to-k-children" ], "flags": [], "comparison": "exact", "parameter_names": [ "happiness", "k" ], "tests": { "total": 100, "kept": 92, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= happiness[i] <= 10**(8)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= k <= n" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= happiness[i] <= 10**(8)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= happiness[i] <= 10**(8)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= happiness[i] <= 10**(8)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= happiness[i] <= 10**(8)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= happiness[i] <= 10**(8)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= happiness[i] <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Since all the unselected numbers are decreasing at the same rate, we should greedily select k largest values.", "The ith largest number (i = 1, 2, 3,\u2026k) should decrease by (i - 1) when it is picked.", "Add 0 if the decreased value is negative." ] }, { "question_id": 3076, "task_id": "shortest-uncommon-substring-in-an-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try a brute force solution where you check every substring.", "Use a Hash map to keep track of the substrings." ] }, { "question_id": 3077, "task_id": "maximum-strength-of-k-disjoint-subarrays", "drop": [], "similar": [ "partition-array-into-disjoint-intervals", "maximum-strength-of-a-group" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 108, "kept": 108, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= n <= 10**(4)", "1 <= k <= n", "1 <= n * k <= 10**(6)", "k is odd." ], "public_tests": 3, "hints": [ "Let dp[i][j][x == 0/1] be the maximum strength to select j disjoint subarrays from the original array\u2019s suffix (nums[i..(n - 1)]), x denotes whether we select the element or not.", "Initially dp[n][0][0] == 0.", "We have dp[i][j][1] = nums[i] * get(j) + max(dp[i + 1][j - 1][0], dp[i + 1][j][1]) where get(j) = j if j is odd, otherwise -j.", "We can select nums[i] as a separate subarray or select at least nums[i] and nums[i + 1] as the first subarray. dp[i][j][0] = max(dp[i + 1][j][0], dp[i][j][1]).", "The answer is dp[0][k][0]." ] }, { "question_id": 3078, "task_id": "match-alphanumerical-pattern-in-matrix-i", "drop": [ "premium" ] }, { "question_id": 3079, "task_id": "find-the-sum-of-encrypted-integers", "drop": [], "similar": [ "encrypt-and-decrypt-strings" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 102, "kept": 53, "dropped": { "constraint_violation": 49 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Encrypted numbers are of the form 11\u20261 * maxDigit." ] }, { "question_id": 3080, "task_id": "mark-elements-on-array-by-performing-queries", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 111, "kept": 98, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "0 <= indexi, ki <= n - 1" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= indexi, ki <= n - 1" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= indexi, ki <= n - 1" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= indexi, ki <= n - 1" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= indexi, ki <= n - 1" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= indexi, ki <= n - 1" ] }, { "line": 97, "end_line": 97, "violates": [ "0 <= indexi, ki <= n - 1" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use another array to keep track of marked indices.", "Sort the array nums to be able to find the smallest unmarked elements quickly in each query." ] }, { "question_id": 3081, "task_id": "replace-question-marks-in-string-to-minimize-its-value", "drop": [], "similar": [ "lexicographically-smallest-string-after-substring-operation" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 38, "kept": 38, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "s[i] is either a lowercase English letter or '?'." ], "public_tests": 2, "hints": [ "The cost does not depend on the order of characters. If a character c appears x times, the cost is exactly 0 + 1 + 2 + \u2026 + (x - 1) = x * (x - 1) / 2.", "We know the total number of question marks; for each one, we should select the letter with the minimum frequency to replace it.", "The letter selection can be achieved by a min-heap (or even by brute-forcing the 26 possibilities).", "So, we know the extra letters we need to replace finally. However, we must put those letters in order from left to right so that the resulting string is the lexicographically smallest one." ] }, { "question_id": 3082, "task_id": "find-the-sum-of-the-power-of-all-subsequences", "drop": [], "similar": [ "number-of-subsequences-that-satisfy-the-given-sum-condition" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 103, "kept": 77, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= k <= 100" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= k <= 100" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= k <= 100" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= k <= 100" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= k <= 100" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= k <= 100", "1 <= k <= 100" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= k <= 100", "1 <= k <= 100" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= k <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= k <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= k <= 100" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= k <= 100", "1 <= k <= 100" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= k <= 100", "1 <= k <= 100" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= k <= 100" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= k <= 100" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= k <= 100" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= k <= 100" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= k <= 100" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= k <= 100" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= k <= 100" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= k <= 100" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= k <= 100" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= k <= 100" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= k <= 100" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= k <= 100" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= k <= 100" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= k <= 100" ] } ], "unchecked_constraints": [ "1 <= n <= 100" ], "public_tests": 3, "hints": [ "If there is a subsequence of length j with the sum of elements k, it contributes 2^{n - j} to the answer.", "Let dp[i][j] represent the number of subsequences in the subarray nums[0..i] which have a sum of j.", "We can find the dp[i][k] for all 0 <= i <= n-1 and multiply them with 2^{n - j} to get final answer." ] }, { "question_id": 3083, "task_id": "existence-of-a-substring-in-a-string-and-its-reverse", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 122, "kept": 121, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 75, "end_line": 75, "violates": [ "s consists only of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Make a new string by reversing the string s.", "For every substring of length 2 in s, check if there is a corresponding substring in the reverse of s." ] }, { "question_id": 3084, "task_id": "count-substrings-starting-and-ending-with-given-character", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "c" ], "tests": { "total": 105, "kept": 104, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= s.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Count the number of characters 'c' in string s, let\u2019s call it m.", "We can select 2 numbers i and j such that i <= j are the start and end indices of substring. Note that i and j can be the same.", "The answer is m * (m + 1) / 2." ] }, { "question_id": 3085, "task_id": "minimum-deletions-to-make-string-k-special", "drop": [], "similar": [ "minimum-deletions-to-make-character-frequencies-unique" ], "flags": [], "comparison": "exact", "parameter_names": [ "word", "k" ], "tests": { "total": 53, "kept": 53, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Count the frequency of each letter.", "Suppose we select several characters as the final answer, and let x be the character with the smallest frequency in the answer. It can be shown that out of the selected characters, the optimal solution will never delete an occurrence of character x to obtain the answer.", "We will fix a character c and assume that it will be the character with the smallest frequency in the answer. Suppose its frequency is x.", "Then, for every other character, we will count the number of occurrences that will be deleted. Suppose that the current character has y occurrences.\n1. If y < x, we need to delete all of them.\n2. if y > x + k, we should delete y - x - k of such character.\n3. Otherwise we don\u2019t need to delete it." ] }, { "question_id": 3086, "task_id": "minimum-moves-to-pick-k-ones", "drop": [], "similar": [ "minimum-swaps-to-group-all-1s-together" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k", "maxChanges" ], "tests": { "total": 95, "kept": 95, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "2 <= n <= 10**(5)" ], "public_tests": 2, "hints": [ "Ones created using a change require 2 moves. Hence except for the immediate neighbors of the index where we move all the ones, we should try to use change operations.", "For some subset of ones, it is always better to move the ones to the median position.", "We only need to be concerned with the indices where nums[i] == 1." ] }, { "question_id": 3088, "task_id": "make-string-anti-palindrome", "drop": [ "premium" ] }, { "question_id": 3090, "task_id": "maximum-length-substring-with-two-occurrences", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 78, "kept": 75, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 44, "end_line": 44, "violates": [ "2 <= s.length <= 100" ] }, { "line": 67, "end_line": 67, "violates": [ "2 <= s.length <= 100" ] }, { "line": 73, "end_line": 73, "violates": [ "2 <= s.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We can try all substrings by brute-force since the constraints are very small." ] }, { "question_id": 3091, "task_id": "apply-operations-to-make-sum-of-array-greater-than-or-equal-to-k", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "k" ], "tests": { "total": 58, "kept": 58, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It is optimal to make all the increase operations first and all the duplicate operations last.", "Iterate over all possible number of increase operations that can be done and find the corresponding number of duplicate operations." ] }, { "question_id": 3092, "task_id": "most-frequent-ids", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "freq" ], "tests": { "total": 108, "kept": 107, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 109, "end_line": 109, "violates": [ "1 <= nums.length == freq.length <= 10**(5)" ] } ], "unchecked_constraints": [ "The input is generated such that the occurrences of an ID will not be negative in any step." ], "public_tests": 2, "hints": [ "Use an ordered set for maintaining the occurrences of each ID.", "After step i find the occurrences of nums[i].", "Change the occurrences of nums[i] in the ordered set." ] }, { "question_id": 3093, "task_id": "longest-common-suffix-queries", "drop": [], "similar": [ "longest-common-prefix", "find-the-length-of-the-longest-common-prefix" ], "flags": [], "comparison": "exact", "parameter_names": [ "wordsContainer", "wordsQuery" ], "tests": { "total": 84, "kept": 79, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= wordsContainer[i].length <= 5 * 10**(3)", "1 <= wordsQuery[i].length <= 5 * 10**(3)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= wordsContainer[i].length <= 5 * 10**(3)", "1 <= wordsQuery[i].length <= 5 * 10**(3)" ] }, { "line": 35, "end_line": 35, "violates": [ "wordsContainer[i] consists only of lowercase English letters.", "wordsQuery[i] consists only of lowercase English letters." ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= wordsQuery[i].length <= 5 * 10**(3)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= wordsContainer[i].length <= 5 * 10**(3)", "1 <= wordsQuery[i].length <= 5 * 10**(3)" ] } ], "unchecked_constraints": [ "Sum of wordsContainer[i].length is at most 5 * 10**(5).", "Sum of wordsQuery[i].length is at most 5 * 10**(5)." ], "public_tests": 2, "hints": [ "If we reverse the strings, the problem changes to finding the longest common prefix.", "Build a Trie, each node is a letter and only saves the best word\u2019s index in each node, based on the criteria." ] }, { "question_id": 3095, "task_id": "shortest-subarray-with-or-at-least-k-i", "drop": [], "similar": [ "minimum-size-subarray-sum", "shortest-subarray-with-sum-at-least-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 109, "kept": 73, "dropped": { "constraint_violation": 36 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "0 <= k < 64" ] }, { "line": 16, "end_line": 16, "violates": [ "0 <= k < 64" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= k < 64" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= k < 64" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 55, "end_line": 55, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 72, "end_line": 72, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 73, "end_line": 73, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 81, "end_line": 81, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 83, "end_line": 83, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 85, "end_line": 85, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 89, "end_line": 89, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= k < 64" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= k < 64" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 98, "end_line": 98, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 104, "end_line": 104, "violates": [ "0 <= nums[i] <= 50", "0 <= k < 64" ] }, { "line": 106, "end_line": 106, "violates": [ "0 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The constraints are small. Brute force checking all the subarrays." ] }, { "question_id": 3096, "task_id": "minimum-levels-to-gain-more-points", "drop": [], "similar": [ "minimum-rounds-to-complete-all-tasks" ], "flags": [], "comparison": "exact", "parameter_names": [ "possible" ], "tests": { "total": 114, "kept": 114, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Change all 0 in possible array into -1.", "We need to find the shortest non-empty prefix of the new possible array such that the sum of elements in it is strictly larger than the remaining part." ] }, { "question_id": 3097, "task_id": "shortest-subarray-with-or-at-least-k-ii", "drop": [], "similar": [ "maximum-size-subarray-sum-equals-k", "shortest-subarray-with-sum-at-least-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 95, "kept": 90, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "0 <= k <= 10**(9)" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= nums[i] <= 10**(9)", "0 <= k <= 10**(9)" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= nums[i] <= 10**(9)", "0 <= k <= 10**(9)" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= nums[i] <= 10**(9)", "0 <= k <= 10**(9)" ] }, { "line": 83, "end_line": 83, "violates": [ "0 <= nums[i] <= 10**(9)", "0 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each nums[i], we can maintain each subarray\u2019s bitwise OR result ending with it.", "The property of bitwise OR is that it never unsets any bits and only sets new bits", "So the number of different results for each nums[i] is at most the number of bits 32." ] }, { "question_id": 3098, "task_id": "find-the-sum-of-subsequence-powers", "drop": [], "similar": [ "number-of-subsequences-that-satisfy-the-given-sum-condition", "closest-subsequence-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 120, "kept": 113, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "2 <= n == nums.length <= 50" ] }, { "line": 10, "end_line": 10, "violates": [ "-10**(8) <= nums[i] <= 10**(8)" ] }, { "line": 27, "end_line": 27, "violates": [ "-10**(8) <= nums[i] <= 10**(8)" ] }, { "line": 33, "end_line": 33, "violates": [ "-10**(8) <= nums[i] <= 10**(8)" ] }, { "line": 38, "end_line": 38, "violates": [ "-10**(8) <= nums[i] <= 10**(8)" ] }, { "line": 42, "end_line": 42, "violates": [ "-10**(8) <= nums[i] <= 10**(8)" ] }, { "line": 69, "end_line": 69, "violates": [ "2 <= n == nums.length <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort nums.", "There are at most n^2 distinct differences.", "For a particular difference d, let dp[len][i][j] be the number of subsequences of length len in the subarray nums[0..i] where the last element picked was at index j.", "For each index, we can check if it can be picked if nums[i] - nums[j] <= d." ] }, { "question_id": 3099, "task_id": "harshad-number", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "x" ], "tests": { "total": 53, "kept": 22, "dropped": { "constraint_violation": 31 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= x <= 100" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= x <= 100" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= x <= 100" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= x <= 100" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= x <= 100" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= x <= 100" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= x <= 100" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= x <= 100" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= x <= 100" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= x <= 100" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= x <= 100" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= x <= 100" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= x <= 100" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= x <= 100" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= x <= 100" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= x <= 100" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= x <= 100" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= x <= 100" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= x <= 100" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= x <= 100" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= x <= 100" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= x <= 100" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= x <= 100" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= x <= 100" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= x <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= x <= 100" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= x <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= x <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= x <= 100" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= x <= 100" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= x <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a while loop and divide x by 10 to find the sum of the digits of x." ] }, { "question_id": 3100, "task_id": "water-bottles-ii", "drop": [], "similar": [ "water-bottles" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "numBottles", "numExchange" ], "tests": { "total": 86, "kept": 86, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simulate the process step by step. At each step, drink numExchange bottles of water then exchange them for a full bottle. Keep repeating this step until you cannot exchange bottles anymore." ] }, { "question_id": 3101, "task_id": "count-alternating-subarrays", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 110, "kept": 110, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try using dynamic programming.", "Let dp[i] be the number of alternating subarrays ending at index i.", "The final answer is the sum of dp[i] over all indices i from 0 to n - 1." ] }, { "question_id": 3102, "task_id": "minimize-manhattan-distances", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "points" ], "tests": { "total": 155, "kept": 152, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= points[i][0], points[i][1] <= 10**(8)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= points[i][0], points[i][1] <= 10**(8)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= points[i][0], points[i][1] <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Notice that the Manhattan distance between two points [x_i, y_i] and [x_j, y_j] is max({x_i - x_j + y_i - y_j, x_i - x_j - y_i + y_j, - x_i + x_j + y_i - y_j, - x_i + x_j - y_i + y_j}).", "If you replace points as [x_i - y_i, x_i + y_i] then the Manhattan distance is max(max(x_i) - min(x_i), max(y_i) - min(y_i)) over all i.", "After those observations, the problem just becomes a simulation. Create multiset of points [x_i - y_i, x_i + y_i], you can iterate on a point you might remove and get the maximum Manhattan distance over all other points." ] }, { "question_id": 3104, "task_id": "find-longest-self-contained-substring", "drop": [ "premium" ], "similar_to_test": [ "3458 select-k-disjoint-special-substrings" ] }, { "question_id": 3105, "task_id": "longest-strictly-increasing-or-strictly-decreasing-subarray", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 139, "kept": 138, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 130, "end_line": 130, "violates": [ "1 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 3106, "task_id": "lexicographically-smallest-string-after-operations-with-constraint", "drop": [], "similar": [ "lexicographically-smallest-string-after-substring-operation" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 110, "kept": 110, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The problem can be approached greedily.", "For each index in order from 0 to n - 1, we try all letters from 'a' to 'z', selecting the first one as long as the current total distance accumulated is not larger than k." ] }, { "question_id": 3107, "task_id": "minimum-operations-to-make-median-of-array-equal-to-k", "drop": [], "similar": [ "find-median-from-data-stream", "sliding-window-median" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 87, "kept": 83, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort nums in non-descending order.", "For all the smaller values on the left side of the median, change them to k if they are larger than k.", "For all the larger values on the right side of the median, change them to k if they are smaller than k." ] }, { "question_id": 3108, "task_id": "minimum-cost-walk-in-weighted-graph", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "query" ], "tests": { "total": 95, "kept": 90, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "si != ti" ] }, { "line": 12, "end_line": 12, "violates": [ "si != ti" ] }, { "line": 44, "end_line": 44, "violates": [ "si != ti" ] }, { "line": 57, "end_line": 57, "violates": [ "si != ti" ] }, { "line": 94, "end_line": 94, "violates": [ "si != ti" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The intended solution uses Disjoint Set Union.", "Notice that, if u and v are not connected then the answer is -1, otherwise we can use all the edges from the connected component where both belong to." ] }, { "question_id": 3109, "task_id": "find-the-index-of-permutation", "drop": [ "premium" ] }, { "question_id": 3110, "task_id": "score-of-a-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 87, "kept": 85, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "2 <= s.length <= 100" ] }, { "line": 63, "end_line": 63, "violates": [ "s consists only of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sum the difference between all the adjacent characters by just taking the absolute difference of their ASCII values." ] }, { "question_id": 3111, "task_id": "minimum-rectangles-to-cover-points", "drop": [], "similar": [ "minimum-area-rectangle", "k-closest-points-to-origin" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "points", "w" ], "tests": { "total": 118, "kept": 118, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "All pairs (xi, yi) are distinct." ], "public_tests": 3, "hints": [ "The y values don't matter; only the x values matter.", "Sort all the points by x_i.", "Each time, select the smallest x value, x_0, from the unselected points, and then select all the points with x values not larger than x_0 + w." ] }, { "question_id": 3112, "task_id": "minimum-time-to-visit-disappearing-nodes", "drop": [], "similar": [ "find-the-last-marked-nodes-in-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "disappear" ], "tests": { "total": 103, "kept": 103, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use Dijkstra\u2019s algorithm, but only visit nodes if you can reach them before disappearance." ], "similar_to_test": [ "3313 find-the-last-marked-nodes-in-tree" ] }, { "question_id": 3113, "task_id": "find-the-number-of-subarrays-where-boundary-elements-are-maximum", "drop": [], "similar": [ "number-of-subarrays-with-bounded-maximum", "count-subarrays-with-fixed-bounds", "count-subarrays-where-max-element-appears-at-least-k-times" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 110, "kept": 110, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each element nums[i], we can count the number of valid subarrays ending with it.", "For each index i, find the nearest index j on its left (j < i) such that nums[j] < nums[i]. This can be done via a monotonic stack.", "For each index i, find the number of indices k in the window [j + 1, i] such that nums[k] == nums[i], this is the number of the valid subarrays ending with nums[i]. This can be done by sliding window.", "Sum the answer of all the indices i to get the final result.", "Is it possible to use DSU as an alternate solution?" ] }, { "question_id": 3114, "task_id": "latest-time-you-can-obtain-after-replacing-characters", "drop": [], "similar": [ "latest-time-by-replacing-hidden-digits" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 121, "kept": 73, "dropped": { "constraint_violation": 48 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "s.length == 5" ] }, { "line": 13, "end_line": 13, "violates": [ "s.length == 5" ] }, { "line": 14, "end_line": 14, "violates": [ "s.length == 5" ] }, { "line": 16, "end_line": 16, "violates": [ "s.length == 5" ] }, { "line": 20, "end_line": 20, "violates": [ "s.length == 5" ] }, { "line": 23, "end_line": 23, "violates": [ "s.length == 5" ] }, { "line": 31, "end_line": 31, "violates": [ "s.length == 5" ] }, { "line": 34, "end_line": 34, "violates": [ "s.length == 5" ] }, { "line": 36, "end_line": 36, "violates": [ "s.length == 5" ] }, { "line": 38, "end_line": 38, "violates": [ "s.length == 5" ] }, { "line": 41, "end_line": 41, "violates": [ "s.length == 5" ] }, { "line": 45, "end_line": 45, "violates": [ "s.length == 5" ] }, { "line": 46, "end_line": 46, "violates": [ "s.length == 5" ] }, { "line": 47, "end_line": 47, "violates": [ "s.length == 5" ] }, { "line": 48, "end_line": 48, "violates": [ "s.length == 5" ] }, { "line": 51, "end_line": 51, "violates": [ "s.length == 5" ] }, { "line": 52, "end_line": 52, "violates": [ "s.length == 5" ] }, { "line": 54, "end_line": 54, "violates": [ "s.length == 5" ] }, { "line": 55, "end_line": 55, "violates": [ "s.length == 5" ] }, { "line": 56, "end_line": 56, "violates": [ "s.length == 5" ] }, { "line": 59, "end_line": 59, "violates": [ "s.length == 5" ] }, { "line": 63, "end_line": 63, "violates": [ "s.length == 5" ] }, { "line": 65, "end_line": 65, "violates": [ "s.length == 5" ] }, { "line": 66, "end_line": 66, "violates": [ "s.length == 5" ] }, { "line": 72, "end_line": 72, "violates": [ "s.length == 5" ] }, { "line": 75, "end_line": 75, "violates": [ "s.length == 5" ] }, { "line": 76, "end_line": 76, "violates": [ "s.length == 5" ] }, { "line": 81, "end_line": 81, "violates": [ "s.length == 5" ] }, { "line": 85, "end_line": 85, "violates": [ "s.length == 5" ] }, { "line": 87, "end_line": 87, "violates": [ "s.length == 5" ] }, { "line": 88, "end_line": 88, "violates": [ "s.length == 5" ] }, { "line": 91, "end_line": 91, "violates": [ "s.length == 5" ] }, { "line": 93, "end_line": 93, "violates": [ "s.length == 5" ] }, { "line": 98, "end_line": 98, "violates": [ "s.length == 5" ] }, { "line": 99, "end_line": 99, "violates": [ "s.length == 5" ] }, { "line": 100, "end_line": 100, "violates": [ "s.length == 5" ] }, { "line": 101, "end_line": 101, "violates": [ "s.length == 5" ] }, { "line": 102, "end_line": 102, "violates": [ "s.length == 5" ] }, { "line": 103, "end_line": 103, "violates": [ "s.length == 5" ] }, { "line": 104, "end_line": 104, "violates": [ "s.length == 5" ] }, { "line": 106, "end_line": 106, "violates": [ "s.length == 5" ] }, { "line": 108, "end_line": 108, "violates": [ "s.length == 5" ] }, { "line": 110, "end_line": 110, "violates": [ "s.length == 5" ] }, { "line": 111, "end_line": 111, "violates": [ "s.length == 5" ] }, { "line": 115, "end_line": 115, "violates": [ "s.length == 5" ] }, { "line": 116, "end_line": 116, "violates": [ "s.length == 5" ] }, { "line": 118, "end_line": 118, "violates": [ "s.length == 5" ] }, { "line": 119, "end_line": 119, "violates": [ "s.length == 5" ] } ], "unchecked_constraints": [ "s[2] is equal to the character \":\".", "All characters except s[2] are digits or \"?\" characters.", "The input is generated such that there is at least one time between \"00:00\" and \"11:59\" that you can obtain after replacing the \"?\" characters." ], "public_tests": 2, "hints": [ "Try using a brute force approach.", "Iterate over all possible times that can be generated from the string and find the latest one." ] }, { "question_id": 3115, "task_id": "maximum-prime-difference", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 53, "kept": 39, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [ "The input is generated such that the number of prime numbers in the nums is at least one." ], "public_tests": 2, "hints": [ "Find all prime numbers in the nums.", "Find the first and the last prime number in the nums." ] }, { "question_id": 3116, "task_id": "kth-smallest-amount-with-single-denomination-combination", "drop": [], "similar": [ "kth-smallest-number-in-multiplication-table", "find-the-number-of-possible-ways-for-an-event" ], "flags": [], "comparison": "exact", "parameter_names": [ "coins", "k" ], "tests": { "total": 110, "kept": 58, "dropped": { "constraint_violation": 52 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 4, "end_line": 4, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 6, "end_line": 6, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= coins[i] <= 25", "1 <= coins[i] <= 25" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= coins[i] <= 25", "1 <= coins[i] <= 25" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= coins[i] <= 25" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= coins[i] <= 25" ] } ], "unchecked_constraints": [ "coins contains pairwise distinct integers." ], "public_tests": 2, "hints": [ "Binary search the answer x.", "Use the inclusion-exclusion principle to count the number of distinct amounts that can be made up to x." ], "similar_to_test": [ "3317 find-the-number-of-possible-ways-for-an-event" ] }, { "question_id": 3117, "task_id": "minimum-sum-of-values-by-dividing-array", "drop": [], "similar": [ "minimum-cost-to-split-an-array", "split-with-minimum-sum", "find-subarray-with-bitwise-or-closest-to-k", "find-x-value-of-array-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "andValues" ], "tests": { "total": 170, "kept": 144, "dropped": { "constraint_violation": 26 } }, "dropped_tests": [ { "line": 45, "end_line": 45, "violates": [ "1 <= m == andValues.length <= min(n, 10)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= m == andValues.length <= min(n, 10)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= m == andValues.length <= min(n, 10)", "1 <= nums[i] < 10**(5)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= m == andValues.length <= min(n, 10)" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 124, "end_line": 124, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 138, "end_line": 138, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 140, "end_line": 140, "violates": [ "1 <= m == andValues.length <= min(n, 10)" ] }, { "line": 152, "end_line": 152, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 154, "end_line": 154, "violates": [ "1 <= m == andValues.length <= min(n, 10)" ] }, { "line": 156, "end_line": 156, "violates": [ "1 <= m == andValues.length <= min(n, 10)", "1 <= nums[i] < 10**(5)" ] }, { "line": 159, "end_line": 159, "violates": [ "1 <= m == andValues.length <= min(n, 10)", "1 <= nums[i] < 10**(5)" ] }, { "line": 160, "end_line": 160, "violates": [ "1 <= m == andValues.length <= min(n, 10)" ] }, { "line": 161, "end_line": 161, "violates": [ "1 <= nums[i] < 10**(5)" ] }, { "line": 171, "end_line": 171, "violates": [ "1 <= nums[i] < 10**(5)", "0 <= andValues[j] < 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let dp[i][j] be the optimal answer to split nums[0..(i - 1)] into the first j andValues.", "dp[i][j] = min(dp[(i - z)][j - 1]) + nums[i - 1] over all x <= z <= y and dp[0][0] = 0, where x and y are the longest and shortest subarrays ending with nums[i - 1] and the bitwise-and of all the values in it is andValues[j - 1].", "The answer is dp[n][m].", "To calculate x and y, we can use binary search (or sliding window). Note that the more values we have, the smaller the AND value is.", "To calculate the result, we need to support RMQ (range minimum query). Segment tree is one way to do it in O(log(n)). But we can use Monotonic Queue since the ranges are indeed \u201csliding to right\u201d which can be reduced to the classical minimum value in sliding window problem, for a O(n) solution." ] }, { "question_id": 3119, "task_id": "maximum-number-of-potholes-that-can-be-fixed", "drop": [ "premium" ] }, { "question_id": 3120, "task_id": "count-the-number-of-special-characters-i", "drop": [], "similar": [ "detect-capital", "greatest-english-letter-in-upper-and-lower-case", "count-the-number-of-special-characters-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 159, "kept": 101, "dropped": { "constraint_violation": 58 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= word.length <= 50" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= word.length <= 50" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= word.length <= 50" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= word.length <= 50" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= word.length <= 50" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= word.length <= 50" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= word.length <= 50" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= word.length <= 50" ] }, { "line": 34, "end_line": 34, "violates": [ "word consists of only lowercase and uppercase English letters." ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= word.length <= 50" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= word.length <= 50" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= word.length <= 50" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= word.length <= 50" ] }, { "line": 49, "end_line": 49, "violates": [ "word consists of only lowercase and uppercase English letters." ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= word.length <= 50" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= word.length <= 50" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= word.length <= 50" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= word.length <= 50" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= word.length <= 50" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= word.length <= 50" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= word.length <= 50" ] }, { "line": 75, "end_line": 75, "violates": [ "word consists of only lowercase and uppercase English letters." ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= word.length <= 50" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= word.length <= 50" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= word.length <= 50" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= word.length <= 50" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= word.length <= 50" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= word.length <= 50" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= word.length <= 50" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= word.length <= 50" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= word.length <= 50" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= word.length <= 50" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= word.length <= 50" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= word.length <= 50" ] }, { "line": 98, "end_line": 98, "violates": [ "word consists of only lowercase and uppercase English letters." ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= word.length <= 50" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= word.length <= 50" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= word.length <= 50" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= word.length <= 50" ] }, { "line": 110, "end_line": 110, "violates": [ "word consists of only lowercase and uppercase English letters." ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= word.length <= 50" ] }, { "line": 116, "end_line": 116, "violates": [ "word consists of only lowercase and uppercase English letters." ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= word.length <= 50" ] }, { "line": 128, "end_line": 128, "violates": [ "1 <= word.length <= 50" ] }, { "line": 129, "end_line": 129, "violates": [ "1 <= word.length <= 50" ] }, { "line": 130, "end_line": 130, "violates": [ "1 <= word.length <= 50" ] }, { "line": 134, "end_line": 134, "violates": [ "1 <= word.length <= 50" ] }, { "line": 139, "end_line": 139, "violates": [ "1 <= word.length <= 50" ] }, { "line": 140, "end_line": 140, "violates": [ "1 <= word.length <= 50" ] }, { "line": 142, "end_line": 142, "violates": [ "1 <= word.length <= 50" ] }, { "line": 144, "end_line": 144, "violates": [ "1 <= word.length <= 50" ] }, { "line": 145, "end_line": 145, "violates": [ "word consists of only lowercase and uppercase English letters." ] }, { "line": 146, "end_line": 146, "violates": [ "1 <= word.length <= 50" ] }, { "line": 148, "end_line": 148, "violates": [ "1 <= word.length <= 50" ] }, { "line": 153, "end_line": 153, "violates": [ "1 <= word.length <= 50" ] }, { "line": 154, "end_line": 154, "violates": [ "1 <= word.length <= 50" ] }, { "line": 155, "end_line": 155, "violates": [ "word consists of only lowercase and uppercase English letters." ] }, { "line": 158, "end_line": 158, "violates": [ "1 <= word.length <= 50", "word consists of only lowercase and uppercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The constraints are small. For all 52 characters, check if they are present in word." ] }, { "question_id": 3121, "task_id": "count-the-number-of-special-characters-ii", "drop": [], "similar": [ "detect-capital", "greatest-english-letter-in-upper-and-lower-case", "count-the-number-of-special-characters-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 100, "kept": 100, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each character c, store the first occurrence of its uppercase and the last occurrence of its lowercase." ] }, { "question_id": 3122, "task_id": "minimum-number-of-operations-to-satisfy-conditions", "drop": [], "similar": [ "candy", "distribute-candies", "minimum-cost-of-buying-candies-with-discount" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 108, "kept": 108, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "1 <= n, m <= 1000" ], "public_tests": 3, "hints": [] }, { "question_id": 3123, "task_id": "find-edges-in-shortest-paths", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 67, "kept": 67, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "There are no repeated edges." ], "public_tests": 2, "hints": [ "Find all the shortest paths starting from nodes 0 and n - 1 to all other nodes.", "How to use the above calculated shortest paths to check if an edge is part of at least one shortest path from 0 to n - 1?" ] }, { "question_id": 3125, "task_id": "maximum-number-that-makes-result-of-bitwise-and-zero", "drop": [ "premium" ] }, { "question_id": 3127, "task_id": "make-a-square-with-the-same-color", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 10, "kept": 10, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "It is impossible to create 2 x 2 square with the same color by changing the color of at most one cell when the number of \u2018W' or 'B\u2019 in all squares is 2." ] }, { "question_id": 3128, "task_id": "right-triangles", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 67, "kept": 67, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If grid[x][y] is 1, it can form a right triangle with an element of grid with value 1 in the same row and an element of grid with value 1 in the same column.", "So we just need to count the number of 1s in each row and column.", "For each x, y with grid[x][y] = 1 if there are row[x] 1s in the row x and col[y] 1s in column y, the answer should be added by (row[x] - 1) * (col[y] - 1)." ] }, { "question_id": 3129, "task_id": "find-all-possible-stable-binary-arrays-i", "drop": [], "similar": [ "contiguous-array", "binary-subarrays-with-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "zero", "one", "limit" ], "tests": { "total": 128, "kept": 128, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let dp[a][b][c = 0/1][d] be the number of stable arrays with exactly a 0s, b 1s and consecutive d value of c\u2019s at the end.", "Try each case by appending a 0/1 at last to get the inductions." ] }, { "question_id": 3130, "task_id": "find-all-possible-stable-binary-arrays-ii", "drop": [], "similar": [ "contiguous-array", "binary-subarrays-with-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "zero", "one", "limit" ], "tests": { "total": 66, "kept": 66, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let dp[x][y][z = 0/1] be the number of stable arrays with exactly x zeros, y ones, and the last element is z. (0 or 1). dp[x][y][0] + dp[x][y][1] is the answer for given (x, y).", "If we have already placed x 1 and y 0, if we place a group of k 0, the number of ways is dp[x-k][y][1]. We can place a group with size i, where i varies from 1 to min(limit, zero - x). Similarly, we can solve by placing a group of ones.", "Speed up the calculation using prefix arrays to store the sum of dp states." ] }, { "question_id": 3131, "task_id": "find-the-integer-added-to-array-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 100, "kept": 97, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 59, "end_line": 59, "violates": [ "0 <= nums1[i], nums2[i] <= 1000" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= nums1[i], nums2[i] <= 1000" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= nums1[i], nums2[i] <= 1000" ] } ], "unchecked_constraints": [ "The test cases are generated in a way that there is an integer x such that nums1 can become equal to nums2 by adding x to each element of nums1." ], "public_tests": 3, "hints": [ "Notice that, after sorting both arrays, there should be a one-to-one correspondence between every element.", "Thus x = min(nums2) - min(nums1)." ] }, { "question_id": 3132, "task_id": "find-the-integer-added-to-array-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2" ], "tests": { "total": 165, "kept": 29, "dropped": { "constraint_violation": 136 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 5, "end_line": 5, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 6, "end_line": 6, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 7, "end_line": 7, "violates": [ "nums2.length == nums1.length - 2", "nums2.length == nums1.length - 2" ] }, { "line": 9, "end_line": 9, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 10, "end_line": 10, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 11, "end_line": 11, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 12, "end_line": 12, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 14, "end_line": 14, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 15, "end_line": 15, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 16, "end_line": 16, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 17, "end_line": 17, "violates": [ "nums2.length == nums1.length - 2", "nums2.length == nums1.length - 2" ] }, { "line": 19, "end_line": 19, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 20, "end_line": 20, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 21, "end_line": 21, "violates": [ "nums2.length == nums1.length - 2", "0 <= nums1[i], nums2[i] <= 1000" ] }, { "line": 22, "end_line": 22, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 24, "end_line": 24, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 25, "end_line": 25, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 27, "end_line": 27, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 28, "end_line": 28, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 29, "end_line": 29, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 30, "end_line": 30, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 31, "end_line": 31, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 33, "end_line": 33, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 34, "end_line": 34, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 35, "end_line": 35, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 37, "end_line": 37, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 38, "end_line": 38, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 39, "end_line": 39, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 40, "end_line": 40, "violates": [ "nums2.length == nums1.length - 2", "nums2.length == nums1.length - 2" ] }, { "line": 41, "end_line": 41, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 42, "end_line": 42, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 43, "end_line": 43, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 44, "end_line": 44, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 45, "end_line": 45, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 47, "end_line": 47, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 48, "end_line": 48, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 50, "end_line": 50, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 51, "end_line": 51, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 52, "end_line": 52, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 54, "end_line": 54, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 55, "end_line": 55, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 56, "end_line": 56, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 57, "end_line": 57, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 60, "end_line": 60, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 61, "end_line": 61, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 62, "end_line": 62, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 63, "end_line": 63, "violates": [ "nums2.length == nums1.length - 2", "0 <= nums1[i], nums2[i] <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "nums2.length == nums1.length - 2", "nums2.length == nums1.length - 2" ] }, { "line": 65, "end_line": 65, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 66, "end_line": 66, "violates": [ "nums2.length == nums1.length - 2", "nums2.length == nums1.length - 2" ] }, { "line": 67, "end_line": 67, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 68, "end_line": 68, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 69, "end_line": 69, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 70, "end_line": 70, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 71, "end_line": 71, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 72, "end_line": 72, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 73, "end_line": 73, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 74, "end_line": 74, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 75, "end_line": 75, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 76, "end_line": 76, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 78, "end_line": 78, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 79, "end_line": 79, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 80, "end_line": 80, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 83, "end_line": 83, "violates": [ "nums2.length == nums1.length - 2", "nums2.length == nums1.length - 2" ] }, { "line": 84, "end_line": 84, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 85, "end_line": 85, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 86, "end_line": 86, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 87, "end_line": 87, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 90, "end_line": 90, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 91, "end_line": 91, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 92, "end_line": 92, "violates": [ "nums2.length == nums1.length - 2", "nums2.length == nums1.length - 2" ] }, { "line": 93, "end_line": 93, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 94, "end_line": 94, "violates": [ "nums2.length == nums1.length - 2", "nums2.length == nums1.length - 2" ] }, { "line": 95, "end_line": 95, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 96, "end_line": 96, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 97, "end_line": 97, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 99, "end_line": 99, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 100, "end_line": 100, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 101, "end_line": 101, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 102, "end_line": 102, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 103, "end_line": 103, "violates": [ "nums2.length == nums1.length - 2", "nums2.length == nums1.length - 2" ] }, { "line": 104, "end_line": 104, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 105, "end_line": 105, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 106, "end_line": 106, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 107, "end_line": 107, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 109, "end_line": 109, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 111, "end_line": 111, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 112, "end_line": 112, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 113, "end_line": 113, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 114, "end_line": 114, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 115, "end_line": 115, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 116, "end_line": 116, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 117, "end_line": 117, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 118, "end_line": 118, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 119, "end_line": 119, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 121, "end_line": 121, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 123, "end_line": 123, "violates": [ "0 <= nums1[i], nums2[i] <= 1000" ] }, { "line": 124, "end_line": 124, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 125, "end_line": 125, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 126, "end_line": 126, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 127, "end_line": 127, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 128, "end_line": 128, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 129, "end_line": 129, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 130, "end_line": 130, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 131, "end_line": 131, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 132, "end_line": 132, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 133, "end_line": 133, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 135, "end_line": 135, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 136, "end_line": 136, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 137, "end_line": 137, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 138, "end_line": 138, "violates": [ "nums2.length == nums1.length - 2", "nums2.length == nums1.length - 2" ] }, { "line": 139, "end_line": 139, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 140, "end_line": 140, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 141, "end_line": 141, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 142, "end_line": 142, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 143, "end_line": 143, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 144, "end_line": 144, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 145, "end_line": 145, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 147, "end_line": 147, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 148, "end_line": 148, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 149, "end_line": 149, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 150, "end_line": 150, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 151, "end_line": 151, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 152, "end_line": 152, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 155, "end_line": 155, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 156, "end_line": 156, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 157, "end_line": 157, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 158, "end_line": 158, "violates": [ "nums2.length == nums1.length - 2", "0 <= nums1[i], nums2[i] <= 1000" ] }, { "line": 159, "end_line": 159, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 160, "end_line": 160, "violates": [ "nums2.length == nums1.length - 2", "0 <= nums1[i], nums2[i] <= 1000" ] }, { "line": 161, "end_line": 161, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 163, "end_line": 163, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 164, "end_line": 164, "violates": [ "nums2.length == nums1.length - 2" ] }, { "line": 165, "end_line": 165, "violates": [ "0 <= nums1[i], nums2[i] <= 1000" ] }, { "line": 166, "end_line": 166, "violates": [ "nums2.length == nums1.length - 2" ] } ], "unchecked_constraints": [ "It is guaranteed that nums2 is reachable from nums1 with at least one x." ], "public_tests": 2, "hints": [ "Try all possibilities to remove 2 elements from nums1.", "x should be equal to min(nums2) - min(nums1), check it naively." ] }, { "question_id": 3133, "task_id": "minimum-array-end", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "x" ], "tests": { "total": 106, "kept": 103, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= n, x <= 10**(8)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= n, x <= 10**(8)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= n, x <= 10**(8)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Each element of the array should be obtained by \u201cmerging\u201d x and v where v = 0, 1, 2, \u2026(n - 1).", "To merge x with another number v, keep the set bits of x untouched, for all the other bits, fill the set bits of v from right to left in order one by one.", "So the final answer is the \u201cmerge\u201d of x and n - 1." ] }, { "question_id": 3134, "task_id": "find-the-median-of-the-uniqueness-array", "drop": [], "similar": [ "find-k-th-smallest-pair-distance", "total-appeal-of-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 101, "kept": 101, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Binary search over the answer.", "For a given x, you need to check if x is the median, to the left of the median, or to the right of the median. You can do that by counting the number of sub-arrays nums[i\u2026j] such that distinct(num[i\u2026j]) <= x.", "Use the sliding window to solve the counting problem in the hint above." ] }, { "question_id": 3135, "task_id": "equalize-strings-by-adding-or-removing-characters-at-ends", "drop": [ "premium" ] }, { "question_id": 3136, "task_id": "valid-word", "drop": [ "too_few_tests" ], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 3, "kept": 3, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 3137, "task_id": "minimum-number-of-operations-to-make-word-k-periodic", "drop": [], "similar": [ "maximum-repeating-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "word", "k" ], "tests": { "total": 105, "kept": 104, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 83, "end_line": 83, "violates": [ "word consists only of lowercase English letters." ] } ], "unchecked_constraints": [ "k divides word.length." ], "public_tests": 2, "hints": [ "Calculate the frequency of each substring of length k that starts at an index that is divisible by k.", "The period of the final string will be the substring with the highest frequency." ] }, { "question_id": 3138, "task_id": "minimum-length-of-anagram-concatenation", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 73, "kept": 73, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The answer should be a divisor of s.length.", "Check each candidate naively." ] }, { "question_id": 3139, "task_id": "minimum-cost-to-equalize-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "cost1", "cost2" ], "tests": { "total": 122, "kept": 119, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 46, "end_line": 46, "violates": [ "1 <= cost2 <= 10**(6)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "How can you determine the minimum cost if you know the maximum value in the array once all values are made equal?", "If cost2 > cost1 * 2, we should just use cost1 to change all the values to the maximum one.", "Otherwise, it's optimal to choose the smallest two values and use cost2 to increase both of them.", "Since the maximum value is known, calculate the required increases to equalize all values, instead of naively simulating the operations.", "There are not a lot of candidates for the maximum; we can try all of them and choose which uses the minimum number of operations." ] }, { "question_id": 3141, "task_id": "maximum-hamming-distances", "drop": [ "premium" ] }, { "question_id": 3142, "task_id": "check-if-grid-satisfies-conditions", "drop": [], "similar": [ "candy", "distribute-candies", "minimum-cost-of-buying-candies-with-discount" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 116, "kept": 115, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 95, "end_line": 95, "violates": [ "0 <= grid[i][j] <= 9" ] } ], "unchecked_constraints": [ "1 <= n, m <= 10" ], "public_tests": 3, "hints": [ "Check if each column has same value in each cell.", "If the previous condition is satisfied, we can simply check the first cells in adjacent columns." ] }, { "question_id": 3143, "task_id": "maximum-points-inside-the-square", "drop": [], "similar": [ "maximize-the-distance-between-points-on-a-square" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "points", "s" ], "tests": { "total": 100, "kept": 76, "dropped": { "constraint_violation": 24 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "s.length == points.length" ] }, { "line": 33, "end_line": 33, "violates": [ "s.length == points.length" ] }, { "line": 34, "end_line": 34, "violates": [ "s.length == points.length" ] }, { "line": 35, "end_line": 35, "violates": [ "s.length == points.length" ] }, { "line": 36, "end_line": 36, "violates": [ "s.length == points.length" ] }, { "line": 41, "end_line": 41, "violates": [ "s.length == points.length" ] }, { "line": 43, "end_line": 43, "violates": [ "s.length == points.length" ] }, { "line": 44, "end_line": 44, "violates": [ "s.length == points.length" ] }, { "line": 52, "end_line": 52, "violates": [ "s.length == points.length" ] }, { "line": 53, "end_line": 53, "violates": [ "s.length == points.length" ] }, { "line": 59, "end_line": 59, "violates": [ "s.length == points.length" ] }, { "line": 60, "end_line": 60, "violates": [ "s.length == points.length" ] }, { "line": 62, "end_line": 62, "violates": [ "s.length == points.length" ] }, { "line": 63, "end_line": 63, "violates": [ "s.length == points.length" ] }, { "line": 64, "end_line": 64, "violates": [ "s.length == points.length" ] }, { "line": 65, "end_line": 65, "violates": [ "s.length == points.length" ] }, { "line": 67, "end_line": 67, "violates": [ "s.length == points.length" ] }, { "line": 68, "end_line": 68, "violates": [ "s.length == points.length" ] }, { "line": 69, "end_line": 69, "violates": [ "s.length == points.length" ] }, { "line": 70, "end_line": 70, "violates": [ "s.length == points.length" ] }, { "line": 76, "end_line": 76, "violates": [ "s.length == points.length" ] }, { "line": 92, "end_line": 92, "violates": [ "s.length == points.length" ] }, { "line": 95, "end_line": 95, "violates": [ "s.length == points.length" ] }, { "line": 101, "end_line": 101, "violates": [ "s.length == points.length" ] } ], "unchecked_constraints": [ "points consists of distinct coordinates." ], "public_tests": 3, "hints": [ "The smallest edge length of a square to include point (x, y) is max(abs(x), abs(y)) * 2.", "Sort the points by max(abs(x), abs(y)) and try each edge length, check the included point tags." ], "similar_to_test": [ "3464 maximize-the-distance-between-points-on-a-square" ] }, { "question_id": 3144, "task_id": "minimum-substring-partition-of-equal-character-frequency", "drop": [], "similar": [ "partition-array-for-maximum-sum", "partition-string-into-minimum-beautiful-substrings" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 72, "kept": 72, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let dp[i] be the minimum number of partitions for the prefix ending at index i + 1.", "dp[i] can be calculated as the min(dp[j]) over all j such that j < i and word[j+1\u2026i] is valid." ] }, { "question_id": 3146, "task_id": "permutation-difference-between-two-strings", "drop": [], "similar": [ "find-the-difference" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 80, "kept": 78, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= s.length <= 26" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= s.length <= 26" ] } ], "unchecked_constraints": [ "Each character occurs at most once in s.", "t is a permutation of s." ], "public_tests": 2, "hints": [ "For each character, find the indices of its occurrences in string s then in string t." ] }, { "question_id": 3147, "task_id": "taking-maximum-energy-from-the-mystic-dungeon", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "energy", "k" ], "tests": { "total": 120, "kept": 118, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 39, "end_line": 39, "violates": [ "-1000 <= energy[i] <= 1000" ] }, { "line": 50, "end_line": 50, "violates": [ "-1000 <= energy[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let dp[i] denote the energy we gain starting from index i.", "We can notice, that dp[i] = dp[i + k] + energy[i]." ] }, { "question_id": 3148, "task_id": "maximum-difference-score-in-a-grid", "drop": [], "similar": [ "maximum-score-from-grid-operations" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 83, "kept": 76, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= grid[i][j] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Any path from a cell (x1, y1) to another cell (x2, y2) will always have a score of grid[x2][y2] - grid[x1][y1].", "Let\u2019s say we fix the starting cell (x1, y1), how to the find a cell (x2, y2) such that the value grid[x2][y2] - grid[x1][y1] is the maximum possible?" ] }, { "question_id": 3149, "task_id": "find-the-minimum-cost-array-permutation", "drop": [], "similar": [ "shortest-path-visiting-all-nodes", "find-the-shortest-superstring" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 113, "kept": 96, "dropped": { "constraint_violation": 17 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 21, "end_line": 21, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 42, "end_line": 42, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 44, "end_line": 44, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 55, "end_line": 55, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 58, "end_line": 58, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 62, "end_line": 62, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 63, "end_line": 63, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 66, "end_line": 66, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 73, "end_line": 73, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 79, "end_line": 79, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 80, "end_line": 80, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 90, "end_line": 90, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 93, "end_line": 93, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 101, "end_line": 101, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 109, "end_line": 109, "violates": [ "2 <= n == nums.length <= 14" ] }, { "line": 114, "end_line": 114, "violates": [ "2 <= n == nums.length <= 14" ] } ], "unchecked_constraints": [ "nums is a permutation of [0, 1, 2, ..., n - 1]." ], "public_tests": 2, "hints": [ "The score function is cyclic, so we can always set perm[0] = 0 for the smallest lexical order.", "It\u2019s similar to the Traveling Salesman Problem. Use Dynamic Programming.", "Use a bitmask to track which elements have been assigned to perm." ] }, { "question_id": 3151, "task_id": "special-array-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 127, "kept": 118, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 128, "end_line": 128, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try to check the parity of each element and its previous element." ] }, { "question_id": 3152, "task_id": "special-array-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 83, "kept": 80, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 40, "end_line": 40, "violates": [ "0 <= queries[i][0] <= queries[i][1] <= nums.length - 1" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 10**(5)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 10**(5)", "0 <= queries[i][0] <= queries[i][1] <= nums.length - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to split the array into some non-intersected continuous special subarrays.", "For each query check that the first and the last elements of that query are in the same subarray or not." ] }, { "question_id": 3153, "task_id": "sum-of-digit-differences-of-all-pairs", "drop": [], "similar": [ "total-hamming-distance" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 105, "kept": 103, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] < 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] < 10**(9)" ] } ], "unchecked_constraints": [ "All integers in nums have the same number of digits." ], "public_tests": 2, "hints": [ "You can solve the problem for digits that are on the same position separately, and then sum up all the answers.", "For each position, count the number of occurences of each digit from 0 to 9 that appear on that position.", "Let c be the number of occurences of a digit on a position, that will contribute with c * (n - c) to the final answer, where n is the number of integers in nums." ] }, { "question_id": 3154, "task_id": "find-number-of-ways-to-reach-the-k-th-stair", "drop": [], "similar": [ "climbing-stairs", "min-cost-climbing-stairs" ], "flags": [], "comparison": "exact", "parameter_names": [ "k" ], "tests": { "total": 79, "kept": 78, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 47, "end_line": 47, "violates": [ "0 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "On using x operations of the second type and y operations of the first type, the stair 2^x - y is reached.", "Since first operations cannot be consecutive, there are exactly x + 1 positions (before and after each power of 2) to perform the second operation.", "Using combinatorics, we have ^{x + 1}C_y number of ways to select the positions of second operations." ] }, { "question_id": 3155, "task_id": "maximum-number-of-upgradable-servers", "drop": [ "premium" ] }, { "question_id": 3157, "task_id": "find-the-level-of-tree-with-minimum-sum", "drop": [ "premium" ] }, { "question_id": 3158, "task_id": "find-the-xor-of-numbers-which-appear-twice", "drop": [], "similar": [ "single-number", "single-number-ii", "single-number-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 120, "kept": 87, "dropped": { "constraint_violation": 33 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= nums.length <= 50" ] } ], "unchecked_constraints": [ "Each number in nums appears either once or twice." ], "public_tests": 3, "hints": [ "The constraints are small. Brute force checking each value in the array." ] }, { "question_id": 3159, "task_id": "find-occurrences-of-an-element-in-an-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries", "x" ], "tests": { "total": 81, "kept": 77, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i], x <= 10**(4)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i], x <= 10**(4)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= queries[i] <= 10**(5)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i], x <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Compress the array nums and save all the occurrences of each element in the separate arrays." ] }, { "question_id": 3160, "task_id": "find-the-number-of-distinct-colors-among-the-balls", "drop": [], "similar": [ "maximum-number-of-balls-in-a-box" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "limit", "queries" ], "tests": { "total": 47, "kept": 47, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use two HashMaps to maintain the color of each ball and the set of balls with each color." ] }, { "question_id": 3161, "task_id": "block-placement-queries", "drop": [], "similar": [ "building-boxes", "fruits-into-baskets-iii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "queries" ], "tests": { "total": 131, "kept": 131, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The input is generated such that for queries of type 1, no obstacle exists at distance x when the query is asked.", "The input is generated such that there is at least one query of type 2.", "1 <= x, sz <= min(5 * 10**(4), 3 * queries.length)" ], "public_tests": 2, "hints": [ "Let d[x] be the distance of the next obstacle after x.", "For each query of type 2, we just need to check if max(d[0], d[1], d[2], \u2026d[x - sz]) > sz.", "Use segment tree to maintain d[x]." ], "similar_to_test": [ "3479 fruits-into-baskets-iii" ] }, { "question_id": 3162, "task_id": "find-the-number-of-good-pairs-i", "drop": [], "similar": [ "count-array-pairs-divisible-by-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "k" ], "tests": { "total": 106, "kept": 26, "dropped": { "constraint_violation": 80 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums1[i], nums2[j] <= 50", "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums1[i], nums2[j] <= 50", "1 <= nums1[i], nums2[j] <= 50" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums1[i], nums2[j] <= 50" ] } ], "unchecked_constraints": [ "1 <= n, m <= 50" ], "public_tests": 2, "hints": [ "The constraints are small. Check all pairs." ] }, { "question_id": 3163, "task_id": "string-compression-iii", "drop": [], "similar": [ "string-compression", "string-compression-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 25, "kept": 24, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "word consists only of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Each time, just cut the same character in prefix up to at max 9 times. It\u2019s always better to cut a bigger prefix." ] }, { "question_id": 3164, "task_id": "find-the-number-of-good-pairs-ii", "drop": [], "similar": [ "count-array-pairs-divisible-by-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "k" ], "tests": { "total": 93, "kept": 83, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= nums1[i], nums2[j] <= 10**(6)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums1[i], nums2[j] <= 10**(6)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums1[i], nums2[j] <= 10**(6)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums1[i], nums2[j] <= 10**(6)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= k <= 10**(3)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= k <= 10**(3)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= k <= 10**(3)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= k <= 10**(3)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= k <= 10**(3)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= k <= 10**(3)" ] } ], "unchecked_constraints": [ "1 <= n, m <= 10**(5)" ], "public_tests": 2, "hints": [ "Let f[v] be the number of occurrences of v/k in nums2.", "For each value v in nums1, enumerating all its factors d (in sqrt(v) time) and sum up all the f[d] to get the final answer.", "It is also possible to improve the complexity from len(nums1) * sqrt(v) to len(nums1) * log(v) - How?" ] }, { "question_id": 3165, "task_id": "maximum-sum-of-subsequence-with-non-adjacent-elements", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 87, "kept": 85, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 67, "end_line": 67, "violates": [ "-10**(5) <= nums[i] <= 10**(5)", "-10**(5) <= xi <= 10**(5)" ] }, { "line": 71, "end_line": 71, "violates": [ "-10**(5) <= nums[i] <= 10**(5)", "-10**(5) <= xi <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can you solve each query in O(nums.length) with dynamic programming?", "In order to optimize, we will use segment tree where each node contains the maximum value of (front element has been chosen or not, back element has been chosen or not)." ] }, { "question_id": 3167, "task_id": "better-compression-of-string", "drop": [ "premium" ] }, { "question_id": 3168, "task_id": "minimum-number-of-chairs-in-a-waiting-room", "drop": [], "similar": [ "consecutive-characters" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 144, "kept": 139, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= s.length <= 50" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= s.length <= 50" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= s.length <= 50" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= s.length <= 50" ] }, { "line": 142, "end_line": 142, "violates": [ "1 <= s.length <= 50" ] } ], "unchecked_constraints": [ "s represents a valid sequence of entries and exits." ], "public_tests": 3, "hints": [ "Iterate from left to right over the string and keep track of the number of people in the waiting room using a variable that you will increment on every occurrence of \u2018E\u2019 and decrement on every occurrence of \u2018L\u2019.", "The answer is the maximum number of people in the waiting room at any instance." ] }, { "question_id": 3169, "task_id": "count-days-without-meetings", "drop": [], "similar": [ "merge-intervals" ], "flags": [], "comparison": "exact", "parameter_names": [ "days", "meetings" ], "tests": { "total": 90, "kept": 89, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 75, "end_line": 75, "violates": [ "1 <= meetings[i][0] <= meetings[i][1] <= days" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Merge the overlapping meetings and sort the new meetings timings.", "Return the sum of difference between the end time of a meeting and the start time of the next meeting for all adjacent pairs." ] }, { "question_id": 3170, "task_id": "lexicographically-minimum-string-after-removing-stars", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 70, "kept": 70, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The input is generated such that it is possible to delete all '*' characters." ], "public_tests": 2, "hints": [] }, { "question_id": 3171, "task_id": "find-subarray-with-bitwise-or-closest-to-k", "drop": [], "similar": [ "minimum-sum-of-values-by-dividing-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 124, "kept": 115, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= nums[i] <= 10**(9)", "1 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let dp[i] be the set of all the bitwise OR of all the subarrays ending at index i.", "We start from nums[i], taking the bitwise OR result by including elements one by one from i towards left. Notice that only unset bits can become set on adding an element, and set bits never become unset again.", "Hence dp[i] can contain at most 30 elements." ] }, { "question_id": 3173, "task_id": "bitwise-or-of-adjacent-elements", "drop": [ "premium" ] }, { "question_id": 3174, "task_id": "clear-digits", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 72, "kept": 69, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "1 <= s.length <= 100" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= s.length <= 100" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= s.length <= 100" ] } ], "unchecked_constraints": [ "The input is generated such that it is possible to delete all digits." ], "public_tests": 2, "hints": [ "Process string s from left to right, if s[i] is a digit, mark the nearest unmarked non-digit index to its left.", "Delete all digits and all marked characters." ] }, { "question_id": 3175, "task_id": "find-the-first-player-to-win-k-games-in-a-row", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "skills", "k" ], "tests": { "total": 128, "kept": 122, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "All integers in skills are unique." ] }, { "line": 52, "end_line": 52, "violates": [ "All integers in skills are unique." ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= skills[i] <= 10**(6)" ] }, { "line": 89, "end_line": 89, "violates": [ "All integers in skills are unique." ] }, { "line": 94, "end_line": 94, "violates": [ "All integers in skills are unique." ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= skills[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Suppose that k \u2265 n, there is exactly one player who can win k games in a row. Who is it?", "In case k < n, you can simulate the competition process described." ] }, { "question_id": 3176, "task_id": "find-the-maximum-length-of-a-good-subsequence-i", "drop": [], "similar": [ "longest-increasing-subsequence", "maximum-length-of-repeated-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 109, "kept": 108, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The absolute values in nums don\u2019t really matter. So we can remap the set of values to the range [0, n - 1].", "Let dp[i][j] be the length of the longest subsequence till index j with at most i positions such that seq[i] != seq[i + 1].", "For each value x from left to right, update dp[i][x] = max(dp[i][x] + 1, dp[i - 1][y] + 1), where y != x." ] }, { "question_id": 3177, "task_id": "find-the-maximum-length-of-a-good-subsequence-ii", "drop": [], "similar": [ "longest-increasing-subsequence", "maximum-length-of-repeated-subarray" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 107, "kept": 106, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "0 <= k <= min(50, nums.length)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The absolute values in nums don\u2019t really matter. So we can remap the set of values to the range [0, n - 1].", "Let dp[i][j] be the length of the longest subsequence till index j with at most i positions such that seq[i] != seq[i + 1].", "For each value x from left to right, update dp[i][x] = max(dp[i][x] + 1, dp[i - 1][y] + 1), where y != x." ] }, { "question_id": 3178, "task_id": "find-the-child-who-has-the-ball-after-k-seconds", "drop": [], "similar": [ "find-the-losers-of-the-circular-game" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 82, "kept": 18, "dropped": { "constraint_violation": 64 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= k <= 50" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= k <= 50" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= k <= 50" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= k <= 50" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= k <= 50" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= k <= 50" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= k <= 50" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= k <= 50" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= k <= 50" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= k <= 50" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= k <= 50" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= k <= 50" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= k <= 50" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= k <= 50" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= k <= 50" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= k <= 50" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= k <= 50" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= k <= 50" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= k <= 50" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= k <= 50" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= k <= 50" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= k <= 50" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= k <= 50" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= k <= 50" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= k <= 50" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= k <= 50" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= k <= 50" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= k <= 50" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= k <= 50" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= k <= 50" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= k <= 50" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= k <= 50" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= k <= 50" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= k <= 50" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= k <= 50" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= k <= 50" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= k <= 50" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= k <= 50" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= k <= 50" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= k <= 50" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= k <= 50" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= k <= 50" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= k <= 50" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= k <= 50" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= k <= 50" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= k <= 50" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= k <= 50" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= k <= 50" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= k <= 50" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= k <= 50" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= k <= 50" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= k <= 50" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= k <= 50" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= k <= 50" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= k <= 50" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= k <= 50" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= k <= 50" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= k <= 50" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= k <= 50" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= k <= 50" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= k <= 50" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= k <= 50" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= k <= 50" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= k <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The ball will go back to child 0 after 2 * (n - 1) seconds and everything is the same as time 0.", "So the answer for k is the same as the answer for k % (2 * (n - 1))." ] }, { "question_id": 3179, "task_id": "find-the-n-th-value-after-k-seconds", "drop": [], "similar": [ "left-and-right-sum-differences" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 63, "kept": 63, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Calculate the prefix sum array of nums, k times." ] }, { "question_id": 3180, "task_id": "maximum-total-reward-using-operations-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "rewardValues" ], "tests": { "total": 104, "kept": 102, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 56, "end_line": 56, "violates": [ "1 <= rewardValues[i] <= 2000" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= rewardValues[i] <= 2000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the rewards array first.", "If we decide to apply some rewards, it's always optimal to apply them in order.", "Let dp[i][j] (true/false) be the state after the first i rewards, indicating whether we can get exactly j points.", "The transition is given by: dp[i][j] = dp[i - 1][j - rewardValues[i]] if j - rewardValues[i] < rewardValues[i]." ] }, { "question_id": 3181, "task_id": "maximum-total-reward-using-operations-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "rewardValues" ], "tests": { "total": 87, "kept": 79, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 31, "end_line": 31, "violates": [ "1 <= rewardValues[i] <= 5 * 10**(4)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= rewardValues[i] <= 5 * 10**(4)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= rewardValues[i] <= 5 * 10**(4)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= rewardValues[i] <= 5 * 10**(4)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= rewardValues[i] <= 5 * 10**(4)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= rewardValues[i] <= 5 * 10**(4)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= rewardValues[i] <= 5 * 10**(4)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= rewardValues[i] <= 5 * 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the rewards array first.", "If we decide to apply some rewards, it's always optimal to apply them in order.", "The transition is given by: dp[i][j] = dp[i - 1][j - rewardValues[i]] if j - rewardValues[i] < rewardValues[i].", "Note that the dp array is a boolean array. We just need 1 bit per element, so we can use a bitset or something similar. We just need a \"stream\" of bits and apply bitwise operations to optimize the computations by a constant factor." ] }, { "question_id": 3183, "task_id": "the-number-of-ways-to-make-the-sum", "drop": [ "premium" ] }, { "question_id": 3184, "task_id": "count-pairs-that-form-a-complete-day-i", "drop": [], "similar": [ "check-if-array-pairs-are-divisible-by-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "hours" ], "tests": { "total": 83, "kept": 83, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Brute force all pairs (i, j) and check if they form a valid complete day. It is considered a complete day if (hours[i] + hours[j]) % 24 == 0." ] }, { "question_id": 3185, "task_id": "count-pairs-that-form-a-complete-day-ii", "drop": [], "similar": [ "pairs-of-songs-with-total-durations-divisible-by-60", "check-if-array-pairs-are-divisible-by-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "hours" ], "tests": { "total": 73, "kept": 71, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= hours[i] <= 10**(9)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= hours[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "A pair (i, j) forms a valid complete day if (hours[i] + hours[j]) % 24 == 0.", "Using an array or a map, for each index j moving from left to right, increase the answer by the count of (24 - hours[j]) % 24, and then increase the count of hours[j]." ] }, { "question_id": 3186, "task_id": "maximum-total-damage-with-spell-casting", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "power" ], "tests": { "total": 99, "kept": 99, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If we ever decide to use some spell with power x, then we will use all spells with power x.", "Think of dynamic programming.", "dp[i][j] represents the maximum damage considering up to the i-th unique spell and j represents the number of spells skipped (up to 3 as per constraints)." ] }, { "question_id": 3187, "task_id": "peaks-in-array", "drop": [], "similar": [ "peaks-in-array-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 86, "kept": 86, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "For all i that: queries[i][0] == 1: 0 <= queries[i][1] <= queries[i][2] <= nums.length - 1", "queries[i][0] == 2: 0 <= queries[i][1] <= nums.length - 1, 1 <= queries[i][2] <= 10**(5)" ], "public_tests": 2, "hints": [ "Let p[i] be whether nums[i] is a peak in the original array. Namely p[i] = nums[i] > nums[i - 1] && nums[i] > nums[i + 1].", "Updating nums[i], only affects p[i], p[i - 1] and p[i + 1]. We can recalculate the 3 values in constant time.", "The answer for [l_i, r_i] is p[l_i + 1] + p[l_i + 2] + \u2026 + p[r_i - 1] (note that l_i and r_i are not included).", "Use some data structures (i.e. segment tree or binary indexed tree) to maintain the subarray sum efficiently." ] }, { "question_id": 3189, "task_id": "minimum-moves-to-get-a-peaceful-board", "drop": [ "premium" ] }, { "question_id": 3190, "task_id": "find-minimum-operations-to-make-all-elements-divisible-by-three", "drop": [], "similar": [ "minimum-moves-to-equal-array-elements" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 117, "kept": 95, "dropped": { "constraint_violation": 22 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If x % 3 != 0 we can always increment or decrement x such that we only need 1 operation.", "Add min(nums[i] % 3, 3 - (nums[i] % 3)) to the count of operations." ] }, { "question_id": 3191, "task_id": "minimum-operations-to-make-binary-array-elements-equal-to-one-i", "drop": [], "similar": [ "minimum-number-of-k-consecutive-bit-flips" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 109, "kept": 109, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If nums[0] is 0, then the only way to change it to 1 is by doing an operation on the first 3 elements of the array.", "After Changing nums[0] to 1, use the same logic on the remaining array." ] }, { "question_id": 3192, "task_id": "minimum-operations-to-make-binary-array-elements-equal-to-one-ii", "drop": [], "similar": [ "minimum-suffix-flips" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 68, "kept": 68, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The only way to change nums[0] to 1 is by performing an operation with index i = 0.", "Iterate from left to right and perform an operation at each index i where nums[i] is 0, and keep track of how many operations are currently performed on the suffix." ] }, { "question_id": 3193, "task_id": "count-the-number-of-inversions", "drop": [], "similar": [ "k-inverse-pairs-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "requirements" ], "tests": { "total": 84, "kept": 84, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The input is generated such that there is at least one i such that endi == n - 1.", "The input is generated such that all endi are unique." ], "public_tests": 3, "hints": [ "Let dp[i][j] denote the number of arrays of length i with j inversions.", "dp[i][j] = dp[i - 1][j] + dp[i - 1][j - 1] + \u2026 + dp[i - 1][0].", "dp[i][j] = 0 if for some x, requirements[x][0] == i and requirements[x][1] != j." ] }, { "question_id": 3194, "task_id": "minimum-average-of-smallest-and-largest-elements", "drop": [], "similar": [ "number-of-distinct-averages" ], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "nums" ], "tests": { "total": 132, "kept": 107, "dropped": { "constraint_violation": 25 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 52, "end_line": 52, "violates": [ "n is even." ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 60, "end_line": 60, "violates": [ "n is even." ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 77, "end_line": 77, "violates": [ "n is even." ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 121, "end_line": 121, "violates": [ "n is even." ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 131, "end_line": 131, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If nums is sorted, then the elements of averages are (nums[i] + nums[n - i - 1]) / 2 for all i < n / 2." ] }, { "question_id": 3195, "task_id": "find-the-minimum-area-to-cover-all-ones-i", "drop": [], "similar": [ "smallest-rectangle-enclosing-black-pixels" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 76, "kept": 76, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The input is generated such that there is at least one 1 in grid." ], "public_tests": 2, "hints": [ "Find the minimum and maximum coordinates of a cell with a value of 1 in both directions." ] }, { "question_id": 3196, "task_id": "maximize-total-cost-of-alternating-subarrays", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 105, "kept": 103, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 57, "end_line": 57, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 74, "end_line": 74, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "The problem can be solved using dynamic programming.", "Since we can always start a new subarray, the problem is the same as selecting some elements in the array and flipping their signs to negative to maximize the sum. However, we cannot flip the signs of 2 consecutive elements, and the first element in the array cannot be negative.", "Let dp[i][0/1] be the largest sum we can get for prefix nums[0..i], where dp[i][0] is the maximum if the i^th element wasn't flipped, and dp[i][1] is the maximum if the i^th element was flipped.", "Based on the restriction:\ndp[i][0] = max(dp[i - 1][0], dp[i - 1][1]) + nums[i]\ndp[i][1] = dp[i - 1][0] - nums[i]", "The initial state is:\ndp[1][0] = nums[0] + nums[1]\ndp[1][1] = nums[0] - nums[1]\nand the answer is max(dp[n - 1][0], dp[n - 1][1]).", "Can you optimize the space complexity?" ] }, { "question_id": 3197, "task_id": "find-the-minimum-area-to-cover-all-ones-ii", "drop": [], "similar": [ "smallest-rectangle-enclosing-black-pixels" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 62, "kept": 62, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The input is generated such that there are at least three 1's in grid." ], "public_tests": 2, "hints": [ "Consider covering using 2 rectangles. As the rectangles don\u2019t overlap, one of the rectangles must either be vertically above or horizontally left to the other.", "To find the minimum area, check all possible vertical and horizontal splits.", "For 3 rectangles, extend the idea to first covering using one rectangle, and then try splitting leftover ones both horizontally and vertically." ] }, { "question_id": 3199, "task_id": "count-triplets-with-even-xor-set-bits-i", "drop": [ "premium" ] }, { "question_id": 3200, "task_id": "maximum-height-of-a-triangle", "drop": [], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "red", "blue" ], "tests": { "total": 67, "kept": 67, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Count the max height using both possibilities. That is, red ball as top and blue ball as top.", "For counting the max height, use a simple for loop and remove the number of balls required at this level." ] }, { "question_id": 3201, "task_id": "find-the-maximum-length-of-valid-subsequence-i", "drop": [], "similar": [ "longest-increasing-subsequence", "length-of-the-longest-subsequence-that-sums-to-target" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 115, "kept": 107, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= nums[i] <= 10**(7)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 10**(7)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 10**(7)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 10**(7)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 10**(7)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 10**(7)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums[i] <= 10**(7)" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= nums[i] <= 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The possible sequence either contains all even elements, all odd elements, alternate even odd, or alternate odd even elements.", "Considering only the parity of elements, there are only 4 possibilities and we can try all of them.", "When selecting an element with any parity, try to select the earliest one." ] }, { "question_id": 3202, "task_id": "find-the-maximum-length-of-valid-subsequence-ii", "drop": [], "similar": [ "longest-increasing-subsequence", "length-of-the-longest-subsequence-that-sums-to-target" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 125, "kept": 124, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= k <= 10**(3)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Fix the value of (subs[0] + subs[1]) % k from the k possible values. Let it be val.", "Let dp[i] store the maximum length of a subsequence with its last element x such that x % k == i.", "Answer for a subsequence ending at index y is dp[(k + val - (y % k)) % k] + 1." ] }, { "question_id": 3203, "task_id": "find-minimum-diameter-after-merging-two-trees", "drop": [], "similar": [ "minimum-height-trees", "tree-diameter", "maximize-the-number-of-target-nodes-after-connecting-trees-i", "maximize-the-number-of-target-nodes-after-connecting-trees-ii", "maximize-sum-of-weights-after-edge-removals" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges1", "edges2" ], "tests": { "total": 60, "kept": 58, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "0 <= ui, vi < m" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= ui, vi < m" ] } ], "unchecked_constraints": [ "The input is generated such that edges1 and edges2 represent valid trees.", "edges1[i].length == edges2[i].length == 2" ], "public_tests": 2, "hints": [ "Suppose that we connected node a in tree1 with node b in tree2. The diameter length of the resulting tree will be the largest of the following 3 values:\n1. The diameter of tree 1.\n2. The diameter of tree 2.\n3. The length of the longest path that starts at node a and that is completely within Tree 1 + The length of the longest path that starts at node b and that is completely within Tree 2 + 1.\n\nThe added one in the third value is due to the additional edge that we have added between trees 1 and 2.", "Values 1 and 2 are constant regardless of our choice of a and b. Therefore, we need to pick a and b in such a way that minimizes value 3.", "If we pick a and b optimally, they will be in the diameters of Tree 1 and Tree 2, respectively. Exactly which nodes of the diameter should we pick?", "a is the center of the diameter of tree 1, and b is the center of the diameter of tree 2." ], "similar_to_test": [ "3367 maximize-sum-of-weights-after-edge-removals", "3372 maximize-the-number-of-target-nodes-after-connecting-trees-i", "3373 maximize-the-number-of-target-nodes-after-connecting-trees-ii" ] }, { "question_id": 3205, "task_id": "maximum-array-hopping-score-i", "drop": [ "premium" ] }, { "question_id": 3206, "task_id": "alternating-groups-i", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "colors" ], "tests": { "total": 131, "kept": 131, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each tile, check that the previous and the next tile have different colors from that tile or not." ] }, { "question_id": 3207, "task_id": "maximum-points-after-enemy-battles", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "enemyEnergies", "currentEnergy" ], "tests": { "total": 104, "kept": 102, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "0 <= currentEnergy <= 10**(9)" ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= currentEnergy <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The problem can be solved greedily.", "Mark all the others except the smallest one first.", "Use the smallest one to increase the energy.", "Note that the initial energy should be no less than the smallest enemy." ] }, { "question_id": 3208, "task_id": "alternating-groups-ii", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "colors", "k" ], "tests": { "total": 103, "kept": 103, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try to find a tile that has the same color as its next tile (if it exists).", "Then try to find maximal alternating groups by starting a single for loop from that tile." ] }, { "question_id": 3209, "task_id": "number-of-subarrays-with-and-value-of-k", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 127, "kept": 125, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 46, "end_line": 46, "violates": [ "0 <= nums[i], k <= 10**(9)" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= nums[i], k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let\u2019s say we want to count the number of pairs (l, r) such that nums[l] & nums[l + 1] & \u2026 & nums[r] == k.", "Fix the left index l.", "Note that if you increase r for a fixed l, then the AND value of the subarray either decreases or remains unchanged.", "Therefore, consider using binary search.", "To calculate the AND value of a subarray, use sparse tables." ] }, { "question_id": 3210, "task_id": "find-the-encrypted-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 88, "kept": 85, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 49, "end_line": 49, "violates": [ "s consists only of lowercase English letters." ] }, { "line": 61, "end_line": 61, "violates": [ "s consists only of lowercase English letters." ] }, { "line": 80, "end_line": 80, "violates": [ "s consists only of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Make a new string such that for each character in s, character i will correspond to (i + k) % s.length character in the original string." ] }, { "question_id": 3211, "task_id": "generate-binary-strings-without-adjacent-zeros", "drop": [], "similar": [ "non-negative-integers-without-consecutive-ones" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "n" ], "tests": { "total": 12, "kept": 12, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If we have a string s of length x, we can generate all strings of length x + 1.", "If s has 0 as the last character, we can only append 1, whereas if the last character is 1, we can append both 0 and 1.", "We can use recursion and backtracking to generate all such strings." ] }, { "question_id": 3212, "task_id": "count-submatrices-with-equal-frequency-of-x-and-y", "drop": [], "similar": [ "maximum-equal-frequency", "count-submatrices-with-all-ones" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 45, "kept": 45, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Replace \u2019X\u2019 with 1, \u2019Y\u2019 with -1 and \u2019.\u2019 with 0.", "You need to find how many submatrices grid[0..x][0..y] have a sum of 0 and at least one \u2019X\u2019.", "Use prefix sum to calculate submatrices sum." ] }, { "question_id": 3213, "task_id": "construct-string-with-minimum-cost", "drop": [], "similar": [ "minimum-number-of-valid-strings-to-form-target-ii", "minimum-number-of-valid-strings-to-form-target-i" ], "flags": [], "comparison": "exact", "parameter_names": [ "target", "words", "costs" ], "tests": { "total": 123, "kept": 122, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 117, "end_line": 117, "violates": [ "1 <= words.length == costs.length <= 5 * 10**(4)" ] } ], "unchecked_constraints": [ "The total sum of words[i].length is less than or equal to 5 * 10**(4)." ], "public_tests": 2, "hints": [ "Use Dynamic Programming along with Aho-Corasick or Hashing." ], "similar_to_test": [ "3291 minimum-number-of-valid-strings-to-form-target-i", "3292 minimum-number-of-valid-strings-to-form-target-ii" ] }, { "question_id": 3215, "task_id": "count-triplets-with-even-xor-set-bits-ii", "drop": [ "premium" ] }, { "question_id": 3216, "task_id": "lexicographically-smallest-string-after-a-swap", "drop": [], "similar": [ "lexicographically-smallest-string-after-applying-operations" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 124, "kept": 124, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try all possible swaps satisfying the constraints and find the one that results in the lexicographically smallest string." ] }, { "question_id": 3217, "task_id": "delete-nodes-from-linked-list-present-in-array", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "remove-linked-list-elements", "delete-node-in-a-linked-list", "remove-nodes-from-linked-list" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums", "head" ], "tests": { "total": 6, "kept": 0, "dropped": { "unreadable": 6 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "unreadable": true }, { "line": 27, "end_line": 27, "unreadable": true }, { "line": 52, "end_line": 52, "unreadable": true }, { "line": 62, "end_line": 62, "unreadable": true }, { "line": 69, "end_line": 69, "unreadable": true }, { "line": 83, "end_line": 83, "unreadable": true } ], "unchecked_constraints": [ "The number of nodes in the given list is in the range [1, 10**(5)].", "1 <= Node.val <= 10**(5)", "The input is generated such that there is at least one node in the linked list that has a value not present in nums." ] }, { "question_id": 3218, "task_id": "minimum-cost-for-cutting-cake-i", "drop": [], "similar": [ "minimum-cost-for-cutting-cake-ii" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n", "horizontalCut", "verticalCut" ], "tests": { "total": 55, "kept": 25, "dropped": { "constraint_violation": 30 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "horizontalCut.length == m - 1" ] }, { "line": 15, "end_line": 15, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 18, "end_line": 18, "violates": [ "verticalCut.length == n - 1" ] }, { "line": 19, "end_line": 19, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 20, "end_line": 20, "violates": [ "verticalCut.length == n - 1" ] }, { "line": 21, "end_line": 21, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 22, "end_line": 22, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 23, "end_line": 23, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 24, "end_line": 24, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 25, "end_line": 25, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 27, "end_line": 27, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 28, "end_line": 28, "violates": [ "horizontalCut.length == m - 1" ] }, { "line": 29, "end_line": 29, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 30, "end_line": 30, "violates": [ "verticalCut.length == n - 1" ] }, { "line": 31, "end_line": 31, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 33, "end_line": 33, "violates": [ "verticalCut.length == n - 1" ] }, { "line": 35, "end_line": 35, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 36, "end_line": 36, "violates": [ "verticalCut.length == n - 1" ] }, { "line": 38, "end_line": 38, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 40, "end_line": 40, "violates": [ "horizontalCut.length == m - 1" ] }, { "line": 41, "end_line": 41, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 42, "end_line": 42, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 44, "end_line": 44, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 45, "end_line": 45, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] }, { "line": 46, "end_line": 46, "violates": [ "verticalCut.length == n - 1" ] }, { "line": 50, "end_line": 50, "violates": [ "horizontalCut.length == m - 1" ] }, { "line": 51, "end_line": 51, "violates": [ "verticalCut.length == n - 1" ] }, { "line": 52, "end_line": 52, "violates": [ "verticalCut.length == n - 1" ] }, { "line": 53, "end_line": 53, "violates": [ "verticalCut.length == n - 1" ] }, { "line": 56, "end_line": 56, "violates": [ "horizontalCut.length == m - 1", "verticalCut.length == n - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The intended solution uses Dynamic Programming.", "Let dp[sx][sy][tx][ty] denote the minimum cost to cut the rectangle into 1 x 1 pieces.", "Iterate on the row or column on which you will perform the next cut, after the cut, the current rectangle will be decomposed into two sub-rectangles." ] }, { "question_id": 3219, "task_id": "minimum-cost-for-cutting-cake-ii", "drop": [], "similar": [ "minimum-cost-for-cutting-cake-i" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n", "horizontalCut", "verticalCut" ], "tests": { "total": 27, "kept": 26, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "verticalCut.length == n - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The intended solution uses a Greedy approach.", "At each step, we will perform a cut on the line with the highest cost.", "If you perform a horizontal cut, can you count the contribution that it adds to each row cut that comes afterward?" ] }, { "question_id": 3221, "task_id": "maximum-array-hopping-score-ii", "drop": [ "premium" ] }, { "question_id": 3222, "task_id": "find-the-winning-player-in-coin-game", "drop": [], "similar": [ "can-i-win", "predict-the-winner" ], "flags": [], "comparison": "exact", "parameter_names": [ "x", "y" ], "tests": { "total": 104, "kept": 102, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 79, "end_line": 79, "violates": [ "1 <= x, y <= 100" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= x, y <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The only way to make 115 is to use one coin of value 75 and four coins of value 10. Each turn uses up these many coins.", "Hence the number of turns is min(x, y / 4).", "Determine the winner from its parity." ] }, { "question_id": 3223, "task_id": "minimum-length-of-string-after-operations", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 47, "kept": 47, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Only the frequency of each character matters in finding the final answer.", "If a character occurs less than 3 times, we cannot perform any process with it.", "Suppose there is a character that occurs at least 3 times in the string, we can repeatedly delete two of these characters until there are at most 2 occurrences left of it." ] }, { "question_id": 3224, "task_id": "minimum-array-changes-to-make-differences-equal", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 101, "kept": 95, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "n is even." ] }, { "line": 23, "end_line": 23, "violates": [ "n is even." ] }, { "line": 26, "end_line": 26, "violates": [ "n is even." ] }, { "line": 46, "end_line": 46, "violates": [ "n is even." ] }, { "line": 53, "end_line": 53, "violates": [ "n is even." ] }, { "line": 81, "end_line": 81, "violates": [ "n is even." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "There are at most k + 1 possible values of the integer X.", "How do we calculate the minimum number of changes efficiently if we fix the value of X before applying any changes?" ] }, { "question_id": 3225, "task_id": "maximum-score-from-grid-operations", "drop": [], "similar": [ "maximum-difference-score-in-a-grid" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 75, "kept": 71, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "n == grid[i].length" ] }, { "line": 42, "end_line": 42, "violates": [ "n == grid[i].length" ] }, { "line": 63, "end_line": 63, "violates": [ "n == grid[i].length" ] }, { "line": 73, "end_line": 73, "violates": [ "n == grid[i].length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use dynamic programming.", "Solve the problem in O(N^4) using a 3-states dp.", "Let dp[i][lastHeight][beforeLastHeight] denote the maximum score if the grid was limited to column i, and the height of column i - 1 is lastHeight and the height of column i - 2 is beforeLastHeight.", "The third state, beforeLastHeight, is used to determine which values of column i - 1 will be added to the score. We can replace this state with another state that only takes two values 0 or 1.", "Let dp[i][lastHeight][isBigger] denote the maximum score if the grid was limited to column i, and where the height of column i - 1 is lastHeight. Additionally, if isBigger == 1, the number of black cells in column i is assumed to be larger than the number of black cells in column i - 2, and vice versa. Note that if our assumption is wrong, it would lead to a suboptimal score and, therefore, it would not be considered as the final answer." ] }, { "question_id": 3226, "task_id": "number-of-bit-changes-to-make-two-integers-equal", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 91, "kept": 68, "dropped": { "constraint_violation": 23 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= n, k <= 10**(6)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= n, k <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the binary representations of n and k.", "Any bit that is equal to 1 in n and equal to 0 in k needs to be changed." ] }, { "question_id": 3227, "task_id": "vowels-game-in-a-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 121, "kept": 120, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= s.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "If there are no vowels in the initial string, then Bob wins.", "If the number of vowels in the initial string is odd, then Alice can remove the whole string on her first turn and win.", "What if the number of vowels in the initial string is even? What\u2019s the optimal play for Alice\u2019s first turn?" ] }, { "question_id": 3228, "task_id": "maximum-number-of-operations-to-move-ones-to-the-end", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 107, "kept": 107, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It is optimal to perform the operation on the lowest index possible each time.", "Traverse the string from left to right and perform the operation every time it is possible." ] }, { "question_id": 3229, "task_id": "minimum-operations-to-make-array-equal-to-target", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 117, "kept": 116, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= nums.length == target.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Change nums'[i] = nums[i] - target[i], so our goal is to make nums' into all 0s.", "Divide and conquer." ] }, { "question_id": 3231, "task_id": "minimum-number-of-increasing-subsequence-to-be-removed", "drop": [ "premium" ] }, { "question_id": 3232, "task_id": "find-if-digit-game-can-be-won", "drop": [], "similar": [ "find-numbers-with-even-number-of-digits", "count-integers-with-even-digit-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 121, "kept": 115, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "1 <= nums[i] <= 99" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 99" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums.length <= 100" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 99" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= nums[i] <= 99" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= nums[i] <= 99" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Alice wins if the sum of all single-digit numbers and the sum of all double-digit numbers are different." ] }, { "question_id": 3233, "task_id": "find-the-count-of-numbers-which-are-not-special", "drop": [], "similar": [ "count-primes" ], "flags": [], "comparison": "exact", "parameter_names": [ "l", "r" ], "tests": { "total": 77, "kept": 77, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "A special number must be a square of a prime number.", "We need to find all primes in the range [sqrt(l), sqrt(r)].", "Use sieve to find primes till sqrt(10^9)." ] }, { "question_id": 3234, "task_id": "count-the-number-of-substrings-with-dominant-ones", "drop": [], "similar": [ "count-binary-substrings" ], "flags": [ "figure_reference" ], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 165, "kept": 165, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let us fix the starting index l of the substring and count the number of indices r such that l <= r and the substring s[l..r] has dominant ones.", "A substring with dominant ones has at most sqrt(n) zeros.", "We cannot iterate over every r and check if the s[l..r] has dominant ones. Instead, we iterate over the next sqrt(n) zeros to the left of l and count the number of substrings with dominant ones where the current zero is the rightmost zero of the substring." ] }, { "question_id": 3235, "task_id": "check-if-the-rectangle-corner-is-reachable", "drop": [], "similar": [ "queries-on-number-of-points-inside-a-circle", "check-if-point-is-reachable" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "xCorner", "yCorner", "circles" ], "tests": { "total": 105, "kept": 105, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Create a graph with n + 4 vertices.", "Vertices 0 to n - 1 represent the circles, vertex n represents upper edge, vertex n + 1 represents right edge, vertex n + 2 represents lower edge, and vertex n + 3 represents left edge.", "Add an edge between these vertices if they intersect or touch.", "Answer will be false when any of two sides left-right, left-bottom, right-top or top-bottom are reachable using the edges." ] }, { "question_id": 3237, "task_id": "alt-and-tab-simulation", "drop": [ "premium" ] }, { "question_id": 3238, "task_id": "find-the-number-of-winning-players", "drop": [], "similar": [ "can-i-win", "predict-the-winner" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "pick" ], "tests": { "total": 69, "kept": 69, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Keep track of the number of balls of each color for each user using hashing.", "Find the maximum color that occurred for each player." ] }, { "question_id": 3239, "task_id": "minimum-number-of-flips-to-make-binary-grid-palindromic-i", "drop": [], "similar": [ "minimum-number-of-moves-to-make-palindrome" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 77, "kept": 77, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "We need to perform the operation only when the equivalent element of i from the back is not equal." ] }, { "question_id": 3240, "task_id": "minimum-number-of-flips-to-make-binary-grid-palindromic-ii", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 88, "kept": 88, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each (x, y), find (m - 1 - x, y), (m - 1 - x, n - 1 - y), and (x, n - 1 - y); they should be the same.", "Note that we need to specially handle the middle row (column) if the number of rows (columns) is odd." ] }, { "question_id": 3241, "task_id": "time-taken-to-mark-all-nodes", "drop": [], "similar": [ "sum-of-distances-in-tree", "most-profitable-path-in-a-tree", "find-the-last-marked-nodes-in-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges" ], "tests": { "total": 54, "kept": 54, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [ "The input is generated such that edges represents a valid tree." ], "public_tests": 3, "hints": [ "Can we use dp on trees?", "Store the two most distant children for each node.", "When re-rooting the tree, keep a variable for distance to the root node." ], "similar_to_test": [ "3313 find-the-last-marked-nodes-in-tree" ] } ]