[ { "question_id": 3243, "task_id": "shortest-distance-after-road-addition-queries-i", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "queries" ], "tests": { "total": 70, "kept": 47, "dropped": { "constraint_violation": 23 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 8, "end_line": 8, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 16, "end_line": 16, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 17, "end_line": 17, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 18, "end_line": 18, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 19, "end_line": 19, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 20, "end_line": 20, "violates": [ "1 < queries[i][1] - queries[i][0]", "There are no repeated roads among the queries." ] }, { "line": 21, "end_line": 21, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 22, "end_line": 22, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= queries[i][0] < queries[i][1] < n", "1 < queries[i][1] - queries[i][0]" ] }, { "line": 24, "end_line": 24, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 28, "end_line": 28, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 29, "end_line": 29, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 31, "end_line": 31, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 39, "end_line": 39, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= queries[i][0] < queries[i][1] < n", "1 < queries[i][1] - queries[i][0]" ] }, { "line": 53, "end_line": 53, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 58, "end_line": 58, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 59, "end_line": 59, "violates": [ "1 < queries[i][1] - queries[i][0]", "There are no repeated roads among the queries." ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= queries[i][0] < queries[i][1] < n", "1 < queries[i][1] - queries[i][0]" ] }, { "line": 62, "end_line": 62, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 67, "end_line": 67, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 70, "end_line": 70, "violates": [ "1 < queries[i][1] - queries[i][0]" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Maintain the graph and use an efficient shortest path algorithm after each update.", "We use BFS/Dijkstra for each query." ] }, { "question_id": 3244, "task_id": "shortest-distance-after-road-addition-queries-ii", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "queries" ], "tests": { "total": 37, "kept": 10, "dropped": { "constraint_violation": 27 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 3, "end_line": 3, "violates": [ "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 6, "end_line": 6, "violates": [ "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 7, "end_line": 7, "violates": [ "1 < queries[i][1] - queries[i][0]", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 8, "end_line": 8, "violates": [ "0 <= queries[i][0] < queries[i][1] < n", "1 < queries[i][1] - queries[i][0]", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 9, "end_line": 9, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 10, "end_line": 10, "violates": [ "1 < queries[i][1] - queries[i][0]" ] }, { "line": 12, "end_line": 12, "violates": [ "1 < queries[i][1] - queries[i][0]", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 14, "end_line": 14, "violates": [ "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 15, "end_line": 15, "violates": [ "1 < queries[i][1] - queries[i][0]", "There are no repeated roads among the queries.", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 16, "end_line": 16, "violates": [ "1 < queries[i][1] - queries[i][0]", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 18, "end_line": 18, "violates": [ "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 19, "end_line": 19, "violates": [ "1 < queries[i][1] - queries[i][0]", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 20, "end_line": 20, "violates": [ "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 23, "end_line": 23, "violates": [ "1 < queries[i][1] - queries[i][0]", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 24, "end_line": 24, "violates": [ "1 < queries[i][1] - queries[i][0]", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 25, "end_line": 25, "violates": [ "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 26, "end_line": 26, "violates": [ "There are no repeated roads among the queries.", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 27, "end_line": 27, "violates": [ "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 28, "end_line": 28, "violates": [ "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 29, "end_line": 29, "violates": [ "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 30, "end_line": 30, "violates": [ "1 < queries[i][1] - queries[i][0]", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 33, "end_line": 33, "violates": [ "1 < queries[i][1] - queries[i][0]", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 34, "end_line": 34, "violates": [ "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 35, "end_line": 35, "violates": [ "1 < queries[i][1] - queries[i][0]", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= queries[i][0] < queries[i][1] < n", "1 < queries[i][1] - queries[i][0]", "There are no repeated roads among the queries.", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= queries[i][0] < queries[i][1] < n", "There are no two queries such that i != j and queries[i][0] < queries[j][0] < queries[i][1] < queries[j][1]." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 3247, "task_id": "number-of-subsequences-with-odd-sum", "drop": [ "premium" ] }, { "question_id": 3248, "task_id": "snake-in-matrix", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "commands" ], "tests": { "total": 81, "kept": 62, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 10, "end_line": 10, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 11, "end_line": 11, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 15, "end_line": 15, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 22, "end_line": 22, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 24, "end_line": 24, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 25, "end_line": 25, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 26, "end_line": 26, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 27, "end_line": 27, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 40, "end_line": 40, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 47, "end_line": 47, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 49, "end_line": 49, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 50, "end_line": 50, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 58, "end_line": 58, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 68, "end_line": 68, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 69, "end_line": 69, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 70, "end_line": 70, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 72, "end_line": 72, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] }, { "line": 74, "end_line": 74, "violates": [ "The input is generated such the snake will not move outside of the boundaries." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to update the row and column of the snake after each command." ] }, { "question_id": 3249, "task_id": "count-the-number-of-good-nodes", "drop": [ "figure_reference" ], "similar": [ "maximum-depth-of-n-ary-tree" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "edges" ], "tests": { "total": 46, "kept": 46, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use DFS." ] }, { "question_id": 3250, "task_id": "find-the-count-of-monotonic-pairs-i", "drop": [], "similar": [ "monotonic-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 105, "kept": 97, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let dp[i][s] is the number of monotonic pairs of length i with the arr1[i - 1] = s.", "If arr1[i - 1] = s, arr2[i - 1] = nums[i - 1] - s.", "Check if the state in recurrence is valid." ] }, { "question_id": 3251, "task_id": "find-the-count-of-monotonic-pairs-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 82, "kept": 76, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 3253, "task_id": "construct-string-with-minimum-cost-easy", "drop": [ "premium" ] }, { "question_id": 3254, "task_id": "find-the-power-of-k-size-subarrays-i", "drop": [], "similar": [ "maximum-sum-of-distinct-subarrays-with-length-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 127, "kept": 127, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we use a brute force solution with nested loops and HashSet?" ] }, { "question_id": 3255, "task_id": "find-the-power-of-k-size-subarrays-ii", "drop": [], "similar": [ "maximum-sum-of-distinct-subarrays-with-length-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 140, "kept": 140, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let dp[i] denote the length of the longest subarray ending at index i that has consecutive and sorted elements.", "Use a TreeMap with a sliding window to check if there are k elements in the subarray ending at index i.", "If TreeMap has less than k elements and dp[i] < k, the subarray has power equal to -1.", "Is it possible to achieve O(nums.length) using a Stack?" ] }, { "question_id": 3256, "task_id": "maximum-value-sum-by-placing-three-rooks-i", "drop": [], "similar": [ "available-captures-for-rook" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board" ], "tests": { "total": 144, "kept": 142, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 80, "end_line": 80, "violates": [ "-10**(9) <= board[i][j] <= 10**(9)" ] }, { "line": 101, "end_line": 101, "violates": [ "-10**(9) <= board[i][j] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Store the largest 3 values for each row.", "Select any 3 rows and brute force all combinations." ] }, { "question_id": 3257, "task_id": "maximum-value-sum-by-placing-three-rooks-ii", "drop": [], "similar": [ "available-captures-for-rook" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "board" ], "tests": { "total": 81, "kept": 81, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Save the top 3 largest values in each row.", "Select any row, and select any of the three values stored in it.", "Get the top 4 values from all of the other 3 largest values of the other rows, which do not share the same column as the selected value.", "Brute force the selection of 2 positions from the top 4 now." ] }, { "question_id": 3258, "task_id": "count-substrings-that-satisfy-k-constraint-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 115, "kept": 104, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 53, "end_line": 53, "violates": [ "1 <= s.length <= 50" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= s.length <= 50" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= s.length <= 50" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= s.length <= 50" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= s.length <= 50" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= s.length <= 50" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= s.length <= 50" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= s.length <= 50" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= s.length <= 50" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= s.length <= 50" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= s.length <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Using a brute force approach, check each index until a substring satisfying the k-constraint is found, then increment." ] }, { "question_id": 3259, "task_id": "maximum-energy-boost-from-two-drinks", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "energyDrinkA", "energyDrinkB" ], "tests": { "total": 99, "kept": 96, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= energyDrinkA[i], energyDrinkB[i] <= 10**(5)" ] }, { "line": 48, "end_line": 48, "violates": [ "n == energyDrinkA.length == energyDrinkB.length" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= energyDrinkA[i], energyDrinkB[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we solve it using dynamic programming?", "Define dpA[i] as the maximum energy boost if we consider only the first i + 1 hours such that in the last hour, we drink the energy drink A.", "Similarly define dpB[i].", "dpA[i] = max(dpA[i - 1], dpB[i - 2]) + energyDrinkA[i]", "Similarly, fill dpB.", "The answer is max(dpA[n - 1], dpB[n - 1])." ] }, { "question_id": 3260, "task_id": "find-the-largest-palindrome-divisible-by-k", "drop": [], "similar": [ "palindrome-number", "find-the-closest-palindrome" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 49, "kept": 49, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "It must have a solution since we can have all digits equal to k.", "Use string dp, store modulus along with length of number currently formed.", "Is it possible to solve greedily using divisibility rules?" ] }, { "question_id": 3261, "task_id": "count-substrings-that-satisfy-k-constraint-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k", "queries" ], "tests": { "total": 72, "kept": 66, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "All queries are distinct." ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= li <= ri < s.length" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= li <= ri < s.length" ] }, { "line": 45, "end_line": 45, "violates": [ "All queries are distinct." ] }, { "line": 48, "end_line": 48, "violates": [ "All queries are distinct." ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= li <= ri < s.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Answering online queries is tough. Try to answer them offline since the queries are known beforehand.", "For each index, how do you calculate the left boundary so that the given condition is satisfied?", "Using the precomputed left boundaries and a range data structure, you can now answer the queries optimally." ] }, { "question_id": 3264, "task_id": "final-array-state-after-k-multiplication-operations-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k", "multiplier" ], "tests": { "total": 108, "kept": 97, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= k <= 10" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= k <= 10" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= k <= 10" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= k <= 10" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= multiplier <= 5" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= multiplier <= 5" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= k <= 10" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= k <= 10" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= k <= 10" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Maintain sorted pairs (nums[index], index) in a priority queue.", "Simulate the operation k times." ] }, { "question_id": 3265, "task_id": "count-almost-equal-pairs-i", "drop": [], "similar": [ "check-if-one-string-swap-can-make-strings-equal" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 123, "kept": 113, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Since the constraint on the number of elements is small, you can check all pairs in the array.", "For each pair, perform an operation on one of the elements and check if it becomes equal to the other." ] }, { "question_id": 3266, "task_id": "final-array-state-after-k-multiplication-operations-ii", "drop": [ "too_few_tests" ], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k", "multiplier" ], "tests": { "total": 2, "kept": 2, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [] }, { "question_id": 3267, "task_id": "count-almost-equal-pairs-ii", "drop": [], "similar": [ "find-the-occurrence-of-first-almost-equal-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 132, "kept": 127, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 46, "end_line": 46, "violates": [ "1 <= nums[i] < 10**(7)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] < 10**(7)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= nums[i] < 10**(7)" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= nums[i] < 10**(7)" ] }, { "line": 128, "end_line": 128, "violates": [ "1 <= nums[i] < 10**(7)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each element, find all possible integers we can get by applying the operations.", "Store the frequencies of all the integers in a hashmap." ] }, { "question_id": 3269, "task_id": "constructing-two-increasing-arrays", "drop": [ "premium" ] }, { "question_id": 3270, "task_id": "find-the-key-of-the-numbers", "drop": [], "similar": [ "largest-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "num1", "num2", "num3" ], "tests": { "total": 96, "kept": 96, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 3271, "task_id": "hash-divided-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 38, "kept": 38, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to find each substring.", "Use a for loop to find hashedChar of each substring.", "Find the answer using hashedChar of each substring." ] }, { "question_id": 3272, "task_id": "find-the-count-of-good-integers", "drop": [], "similar": [ "palindrome-number", "find-the-closest-palindrome" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 56, "kept": 56, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "How to generate all K-palindromic strings of length n? Do we need to go through all n digits?", "Use permutations to calculate the number of possible rearrangements." ] }, { "question_id": 3273, "task_id": "minimum-amount-of-damage-dealt-to-bob", "drop": [], "similar": [ "minimum-time-to-complete-trips", "minimum-penalty-for-a-shop" ], "flags": [], "comparison": "exact", "parameter_names": [ "power", "damage", "health" ], "tests": { "total": 121, "kept": 112, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "1 <= damage[i], health[i] <= 10**(4)" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= damage[i], health[i] <= 10**(4)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= damage[i], health[i] <= 10**(4)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= damage[i], health[i] <= 10**(4)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= damage[i], health[i] <= 10**(4)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= damage[i], health[i] <= 10**(4)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= damage[i], health[i] <= 10**(4)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= damage[i], health[i] <= 10**(4)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= damage[i], health[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we use sorting here along with a custom comparator?", "For any two enemies i and j with damages damage[i] and damage[j], and time to take each of them down t_i and t_j, when is it better to choose enemy i over enemy j first?" ] }, { "question_id": 3274, "task_id": "check-if-two-chessboard-squares-have-the-same-color", "drop": [], "similar": [ "determine-color-of-a-chessboard-square" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "coordinate1", "coordinate2" ], "tests": { "total": 154, "kept": 153, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 143, "end_line": 143, "violates": [ "'1' <= coordinate1[1], coordinate2[1] <= '8'" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The color of the chessboard is black the sum of row coordinates and column coordinates is even. Otherwise, it's white." ] }, { "question_id": 3275, "task_id": "k-th-nearest-obstacle-queries", "drop": [], "similar": [ "k-closest-points-to-origin" ], "flags": [], "comparison": "exact", "parameter_names": [ "queries", "k" ], "tests": { "total": 85, "kept": 84, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 58, "end_line": 58, "violates": [ "All queries[i] are unique." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider if there are more than k obstacles. Can the k + 1^th obstacle ever be the answer to any query?", "Maintain a max heap of size k, thus heap will contain minimum element at the top in that queue.", "Remove top element and insert new element from input array if current max is larger than this." ] }, { "question_id": 3276, "task_id": "select-cells-in-grid-with-maximum-score", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 97, "kept": 92, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= grid[i][j] <= 100" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= grid[i][j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort all the cells in the grid by their values and keep track of their original positions.", "Try dynamic programming with the following states: the current cell that we might select and a bitmask representing all the rows from which we have already selected a cell so far." ] }, { "question_id": 3277, "task_id": "maximum-xor-score-subarray-queries", "drop": [], "similar": [ "make-the-xor-of-all-segments-equal-to-zero" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 58, "kept": 55, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "0 <= nums[i] <= 2**(31) - 1" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= nums[i] <= 2**(31) - 1" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= nums[i] <= 2**(31) - 1" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Precompute the XOR score of every subarray.", "Try to find a relationship between XOR score of nums[i..j], nums[i..j + 1], nums[i..j + 2], \u2026. Do you notice any pattern?", "If dp[i][j] is the XOR score of subarray nums[i..j], dp[i][j] = dp[i - 1][j] XOR dp[i - 1][j + 1]." ] }, { "question_id": 3279, "task_id": "maximum-total-area-occupied-by-pistons", "drop": [ "premium" ] }, { "question_id": 3280, "task_id": "convert-date-to-binary", "drop": [], "similar": [ "number-of-1-bits", "convert-to-base-2" ], "flags": [], "comparison": "exact", "parameter_names": [ "date" ], "tests": { "total": 87, "kept": 87, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 3281, "task_id": "maximize-score-of-numbers-in-ranges", "drop": [], "similar": [ "find-k-th-smallest-pair-distance" ], "flags": [], "comparison": "exact", "parameter_names": [ "start", "d" ], "tests": { "total": 107, "kept": 100, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "0 <= start[i] <= 10**(9)" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= start[i] <= 10**(9)" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= start[i] <= 10**(9)" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= start[i] <= 10**(9)" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= start[i] <= 10**(9)" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= start[i] <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= start[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use binary search here?", "Suppose that the answer is x. We can find a valid configuration of integers by sorting start, the first integer should be start[0], then each subsequent integer should be the smallest one in [start[i], start[i] + d] that is greater than last_chosen_value + x.", "Binary search over x" ] }, { "question_id": 3282, "task_id": "reach-end-of-array-with-max-score", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 99, "kept": 98, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "It can be proven that from each index i, the optimal solution is to jump to the nearest index j > i such that nums[j] > nums[i]." ] }, { "question_id": 3283, "task_id": "maximum-number-of-moves-to-kill-all-pawns", "drop": [ "figure_reference" ], "similar": [ "knight-probability-in-chessboard", "check-knight-tour-configuration" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "kx", "ky", "positions" ], "tests": { "total": 97, "kept": 89, "dropped": { "constraint_violation": 8 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "All positions[i] are unique." ] }, { "line": 50, "end_line": 50, "violates": [ "All positions[i] are unique." ] }, { "line": 63, "end_line": 63, "violates": [ "All positions[i] are unique." ] }, { "line": 75, "end_line": 75, "violates": [ "All positions[i] are unique." ] }, { "line": 79, "end_line": 79, "violates": [ "The input is generated such that positions[i] != [kx, ky] for all 0 <= i < positions.length." ] }, { "line": 81, "end_line": 81, "violates": [ "The input is generated such that positions[i] != [kx, ky] for all 0 <= i < positions.length." ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= positions.length <= 15" ] }, { "line": 86, "end_line": 86, "violates": [ "The input is generated such that positions[i] != [kx, ky] for all 0 <= i < positions.length." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use BFS to preprocess the minimum number of moves to reach one pawn from the other pawns.", "Consider the knight\u2019s original position as another pawn.", "Use DP with a bitmask to store current pawns that have not been captured." ] }, { "question_id": 3284, "task_id": "sum-of-consecutive-subarrays", "drop": [ "premium" ] }, { "question_id": 3285, "task_id": "find-indices-of-stable-mountains", "drop": [], "similar": [ "find-in-mountain-array" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "height", "threshold" ], "tests": { "total": 113, "kept": 109, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "1 <= threshold <= 100" ] }, { "line": 14, "end_line": 14, "violates": [ "1 <= threshold <= 100" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= threshold <= 100" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= height[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 3286, "task_id": "find-a-safe-walk-through-a-grid", "drop": [], "similar": [ "shortest-path-in-a-grid-with-obstacles-elimination" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid", "health" ], "tests": { "total": 81, "kept": 75, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "1 <= health <= m + n" ] }, { "line": 7, "end_line": 7, "violates": [ "1 <= health <= m + n" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= health <= m + n" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= health <= m + n" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= health <= m + n" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= health <= m + n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use 01 BFS." ] }, { "question_id": 3287, "task_id": "find-the-maximum-sequence-value-of-array", "drop": [], "similar": [ "bitwise-ors-of-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 65, "kept": 60, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= nums[i] < 2**(7)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] < 2**(7)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] < 2**(7)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] < 2**(7)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] < 2**(7)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Find all the possible OR till each i with k elements backward and forward." ] }, { "question_id": 3288, "task_id": "length-of-the-longest-increasing-path", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "coordinates", "k" ], "tests": { "total": 101, "kept": 101, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Only keep coordinates with both x and y being strictly less than coordinates[k].", "Sort them by x\u2019s, in the case of equal, the y values should be decreasing.", "Calculate LIS only using y values.", "Do the same for coordinates with both x and y being strictly larger than coordinates[k]." ] }, { "question_id": 3289, "task_id": "the-two-sneaky-numbers-of-digitville", "drop": [], "similar": [ "find-all-duplicates-in-an-array" ], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "nums" ], "tests": { "total": 74, "kept": 49, "dropped": { "constraint_violation": 25 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "0 <= nums[i] < n", "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 5, "end_line": 5, "violates": [ "0 <= nums[i] < n", "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 12, "end_line": 12, "violates": [ "0 <= nums[i] < n", "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 15, "end_line": 15, "violates": [ "0 <= nums[i] < n", "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 16, "end_line": 16, "violates": [ "0 <= nums[i] < n" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= nums[i] < n" ] }, { "line": 21, "end_line": 21, "violates": [ "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 24, "end_line": 24, "violates": [ "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 26, "end_line": 26, "violates": [ "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= nums[i] < n" ] }, { "line": 35, "end_line": 35, "violates": [ "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 36, "end_line": 36, "violates": [ "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= nums[i] < n", "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 47, "end_line": 47, "violates": [ "2 <= n <= 100", "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 51, "end_line": 51, "violates": [ "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= nums[i] < n", "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 62, "end_line": 62, "violates": [ "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= nums[i] < n", "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= nums[i] < n" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= nums[i] < n" ] }, { "line": 70, "end_line": 70, "violates": [ "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 71, "end_line": 71, "violates": [ "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 73, "end_line": 73, "violates": [ "0 <= nums[i] < n", "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 74, "end_line": 74, "violates": [ "The input is generated such that nums contains exactly two repeated elements." ] }, { "line": 75, "end_line": 75, "violates": [ "2 <= n <= 100", "The input is generated such that nums contains exactly two repeated elements." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "To solve the problem without the extra space, we need to think about how many times each number occurs in relation to the index." ] }, { "question_id": 3290, "task_id": "maximum-multiplication-score", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "a", "b" ], "tests": { "total": 104, "kept": 97, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "-10**(5) <= a[i], b[i] <= 10**(5)" ] }, { "line": 27, "end_line": 27, "violates": [ "-10**(5) <= a[i], b[i] <= 10**(5)" ] }, { "line": 32, "end_line": 32, "violates": [ "-10**(5) <= a[i], b[i] <= 10**(5)" ] }, { "line": 59, "end_line": 59, "violates": [ "-10**(5) <= a[i], b[i] <= 10**(5)" ] }, { "line": 62, "end_line": 62, "violates": [ "-10**(5) <= a[i], b[i] <= 10**(5)" ] }, { "line": 66, "end_line": 66, "violates": [ "-10**(5) <= a[i], b[i] <= 10**(5)" ] }, { "line": 96, "end_line": 96, "violates": [ "-10**(5) <= a[i], b[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try using dynamic programming.", "Consider a dp with the following states: The current position in the array b, and the number of indices considered." ] }, { "question_id": 3291, "task_id": "minimum-number-of-valid-strings-to-form-target-i", "drop": [], "similar": [ "minimum-cost-to-convert-string-ii", "construct-string-with-minimum-cost" ], "flags": [], "comparison": "exact", "parameter_names": [ "words", "target" ], "tests": { "total": 149, "kept": 149, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let dp[i] be the minimum cost to form the prefix of length i of target.", "If target[(i + 1)..j] matches any prefix, update the range dp[(i + 1)..j] to minimum between original value and dp[i] + 1.", "Use a Trie to check prefix matching." ] }, { "question_id": 3292, "task_id": "minimum-number-of-valid-strings-to-form-target-ii", "drop": [], "similar": [ "minimum-cost-to-convert-string-ii", "construct-string-with-minimum-cost" ], "flags": [], "comparison": "exact", "parameter_names": [ "words", "target" ], "tests": { "total": 169, "kept": 169, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let dp[i] be the minimum cost to form the prefix of length i of target.", "Use Rabin-Karp to hash every prefix and store it in a HashSet.", "Use Binary search to find the longest substring starting at index i (target[i..j]) that has a hash present in the HashSet.", "Inverse Modulo precomputation can optimise hash calculation.", "Use Lazy Segment Tree, or basic Segment Tree to update dp[i..j].", "Is it possible to use two TreeSets to update dp[i..j]?" ] }, { "question_id": 3295, "task_id": "report-spam-message", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "message", "bannedWords" ], "tests": { "total": 108, "kept": 93, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] }, { "line": 7, "end_line": 7, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] }, { "line": 15, "end_line": 15, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] }, { "line": 17, "end_line": 17, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] }, { "line": 19, "end_line": 19, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] }, { "line": 20, "end_line": 20, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] }, { "line": 22, "end_line": 22, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] }, { "line": 36, "end_line": 36, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] }, { "line": 51, "end_line": 51, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] }, { "line": 57, "end_line": 57, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] }, { "line": 63, "end_line": 63, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] }, { "line": 70, "end_line": 70, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= message[i].length, bannedWords[i].length <= 15" ] }, { "line": 95, "end_line": 95, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] }, { "line": 102, "end_line": 102, "violates": [ "message[i] and bannedWords[i] consist only of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use hash set." ] }, { "question_id": 3296, "task_id": "minimum-number-of-seconds-to-make-mountain-height-zero", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "mountainHeight", "workerTimes" ], "tests": { "total": 116, "kept": 114, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "1 <= workerTimes[i] <= 10**(6)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= mountainHeight <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we use binary search to solve this problem?", "Do a binary search on the number of seconds to check if it's enough to reduce the mountain height to 0 or less with all workers working simultaneously." ] }, { "question_id": 3297, "task_id": "count-substrings-that-can-be-rearranged-to-contain-a-string-i", "drop": [], "similar": [ "minimum-window-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "word1", "word2" ], "tests": { "total": 106, "kept": 104, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= word1.length <= 10**(5)" ] }, { "line": 105, "end_line": 105, "violates": [ "word1 and word2 consist only of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Store the frequency of each character for all prefixes.", "Use Binary Search." ] }, { "question_id": 3298, "task_id": "count-substrings-that-can-be-rearranged-to-contain-a-string-ii", "drop": [], "similar": [ "minimum-window-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "word1", "word2" ], "tests": { "total": 68, "kept": 68, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use sliding window along with two-pointer here.", "Use constant space to store the frequency of characters." ] }, { "question_id": 3299, "task_id": "sum-of-consecutive-subsequences", "drop": [ "premium" ] }, { "question_id": 3300, "task_id": "minimum-element-after-replacement-with-digit-sum", "drop": [], "similar": [ "sum-of-digits-of-string-after-convert" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 109, "kept": 75, "dropped": { "constraint_violation": 34 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 46, "end_line": 46, "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": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 72, "end_line": 72, "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)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= nums[i] <= 10**(4)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums[i] <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Convert to string and calculate the sum for each element." ] }, { "question_id": 3301, "task_id": "maximize-the-total-height-of-unique-towers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "maximumHeight" ], "tests": { "total": 73, "kept": 73, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the array maximumHeight in descending order.", "After sorting, it can be seen that the maximum height that we can assign to the i^th element is min(maximumHeight[i], maximumHeight[i - 1] - 1)." ] }, { "question_id": 3302, "task_id": "find-the-lexicographically-smallest-valid-sequence", "drop": [], "similar": [ "smallest-k-length-subsequence-with-occurrences-of-a-letter" ], "flags": [], "comparison": "exact", "parameter_names": [ "word1", "word2" ], "tests": { "total": 155, "kept": 151, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= word2.length < word1.length <= 3 * 10**(5)" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= word2.length < word1.length <= 3 * 10**(5)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= word2.length < word1.length <= 3 * 10**(5)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= word2.length < word1.length <= 3 * 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Let dp[i] be the longest suffix of word2 that exists as a subsequence of suffix of the substring of word1 starting at index i.", "If dp[i + 1] < m and word1[i] == word2[m - dp[i + 1] - 1],dp[i] = dp[i + 1] + 1. Otherwise, dp[i] = dp[i + 1].", "For each index i, greedily select characters using the dp array to know whether a solution exists." ] }, { "question_id": 3303, "task_id": "find-the-occurrence-of-first-almost-equal-substring", "drop": [], "similar": [ "check-whether-two-strings-are-almost-equivalent", "count-almost-equal-pairs-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "pattern" ], "tests": { "total": 134, "kept": 26, "dropped": { "constraint_violation": 108 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 5, "end_line": 5, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 6, "end_line": 6, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 10, "end_line": 10, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 124, "end_line": 124, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 125, "end_line": 125, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 128, "end_line": 128, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 129, "end_line": 129, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 130, "end_line": 130, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 131, "end_line": 131, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 132, "end_line": 132, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 133, "end_line": 133, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] }, { "line": 134, "end_line": 134, "violates": [ "1 <= pattern.length < s.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Let dp1[i] represent the maximum length of a substring of s starting at index i that is also a prefix of pattern.", "Let dp2[i] represent the maximum length of a substring of s ending at index i that is also a suffix of pattern.", "Consider a window of size pattern.length. If dp1[i] + i == i + pattern.length - 1 - dp2[i + pattern.length - 1], what does this signify?" ] }, { "question_id": 3304, "task_id": "find-the-k-th-character-in-string-game-i", "drop": [], "similar": [ "shifting-letters" ], "flags": [], "comparison": "exact", "parameter_names": [ "k" ], "tests": { "total": 37, "kept": 37, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The constraints are small. Construct the string by simulating the operations." ] }, { "question_id": 3305, "task_id": "count-of-substrings-containing-every-vowel-and-k-consonants-i", "drop": [], "similar": [ "longest-substring-of-all-vowels-in-order", "count-vowel-substrings-of-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "word", "k" ], "tests": { "total": 67, "kept": 67, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a HashMap and check all the substrings." ] }, { "question_id": 3306, "task_id": "count-of-substrings-containing-every-vowel-and-k-consonants-ii", "drop": [], "similar": [ "longest-substring-of-all-vowels-in-order", "count-vowel-substrings-of-a-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "word", "k" ], "tests": { "total": 68, "kept": 68, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "We can use sliding window and binary search.", "For each index r, find the maximum l such that both conditions are satisfied using binary search." ] }, { "question_id": 3307, "task_id": "find-the-k-th-character-in-string-game-ii", "drop": [], "similar": [ "shifting-letters" ], "flags": [], "comparison": "exact", "parameter_names": [ "k", "operations" ], "tests": { "total": 47, "kept": 45, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= operations.length <= 100" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= k <= 10**(14)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try to replay the operations k^th character was part of.", "The k^th character is only affected if it is present in the first half of the string." ] }, { "question_id": 3309, "task_id": "maximum-possible-number-by-binary-concatenation", "drop": [], "similar": [ "concatenation-of-consecutive-binary-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 91, "kept": 90, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i] <= 127" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "How many possible concatenation orders are there?" ] }, { "question_id": 3310, "task_id": "remove-methods-from-project", "drop": [], "similar": [], "flags": [ "any_order", "has_images" ], "comparison": "unordered", "parameter_names": [ "n", "k", "invocations" ], "tests": { "total": 78, "kept": 76, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "invocations[i] != invocations[j]" ] }, { "line": 74, "end_line": 74, "violates": [ "invocations[i] != invocations[j]" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use DFS from node k.", "Mark all the nodes visited from node k, and then check if they can be visited from the other nodes." ] }, { "question_id": 3311, "task_id": "construct-2d-grid-matching-graph-layout", "drop": [ "multiple_answers" ], "similar": [], "flags": [ "multiple_answers", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges" ], "tests": { "total": 33, "kept": 32, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "0 <= ui < vi < n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Observe the indegrees of the nodes.", "The case where there are two nodes with an indegree of 1, and all the others have an indegree of 2 can be handled separately.", "The nodes with the smallest degrees are the corners.", "You can simulate the grid creation process using BFS or a similar approach after making some observations on the indegrees." ] }, { "question_id": 3312, "task_id": "sorted-gcd-pair-queries", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 85, "kept": 42, "dropped": { "constraint_violation": 43 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 3, "end_line": 3, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 4, "end_line": 4, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 9, "end_line": 9, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 14, "end_line": 14, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 15, "end_line": 15, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 17, "end_line": 17, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 18, "end_line": 18, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 19, "end_line": 19, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= queries[i] < n * (n - 1) / 2", "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 5 * 10**(4)", "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= queries[i] < n * (n - 1) / 2", "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 5 * 10**(4)" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 55, "end_line": 55, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 63, "end_line": 63, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 73, "end_line": 73, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 78, "end_line": 78, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 81, "end_line": 81, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= queries[i] < n * (n - 1) / 2" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Try counting the number of pairs that have a GCD of g", "Use inclusion-exclusion." ] }, { "question_id": 3313, "task_id": "find-the-last-marked-nodes-in-tree", "drop": [ "premium" ] }, { "question_id": 3314, "task_id": "construct-the-minimum-bitwise-array-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 124, "kept": 123, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 122, "end_line": 122, "violates": [ "2 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The constraints are small, allowing you to iterate over all potential values for ans[i] directly." ] }, { "question_id": 3315, "task_id": "construct-the-minimum-bitwise-array-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 226, "kept": 226, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider the binary representation of nums[i].", "Answer is -1 for even nums[i].", "Try unsetting a single bit from nums[i]." ] }, { "question_id": 3316, "task_id": "find-maximum-removals-from-source-string", "drop": [], "similar": [ "delete-characters-to-make-fancy-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "source", "pattern", "targetIndices" ], "tests": { "total": 87, "kept": 69, "dropped": { "constraint_violation": 18 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= targetIndices.length <= n", "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 20, "end_line": 20, "violates": [ "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 23, "end_line": 23, "violates": [ "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 24, "end_line": 24, "violates": [ "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= targetIndices.length <= n", "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= targetIndices.length <= n", "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= targetIndices.length <= n", "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= targetIndices.length <= n", "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= targetIndices.length <= n", "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= targetIndices.length <= n", "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 71, "end_line": 71, "violates": [ "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 72, "end_line": 72, "violates": [ "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1].", "The input is generated such that pattern appears as a subsequence in source." ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= targetIndices.length <= n", "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 77, "end_line": 77, "violates": [ "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= targetIndices.length <= n", "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= targetIndices.length <= n", "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 83, "end_line": 83, "violates": [ "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] }, { "line": 88, "end_line": 88, "violates": [ "The input is generated such that targetIndices contains distinct elements in the range [0, n - 1]." ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Use dynamic programming.", "At each index in targetIndices, make the choice to remove or not remove the character." ] }, { "question_id": 3317, "task_id": "find-the-number-of-possible-ways-for-an-event", "drop": [], "similar": [ "kth-smallest-amount-with-single-denomination-combination" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "x", "y" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Fix the number of stages.", "Assign the Performers to the stages.", "Use inclusion-exclusion to ensure that no stage has 0 performers." ] }, { "question_id": 3318, "task_id": "find-x-sum-of-all-k-long-subarrays-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k", "x" ], "tests": { "total": 197, "kept": 183, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= n == nums.length <= 50" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= n == nums.length <= 50" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= n == nums.length <= 50" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= n == nums.length <= 50" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= n == nums.length <= 50" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= n == nums.length <= 50" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= n == nums.length <= 50" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 170, "end_line": 170, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 179, "end_line": 179, "violates": [ "1 <= n == nums.length <= 50" ] }, { "line": 196, "end_line": 196, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 197, "end_line": 197, "violates": [ "1 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Implement the x-sum function. Then, run x-sum on every subarray of nums of size k." ] }, { "question_id": 3319, "task_id": "k-th-largest-perfect-subtree-size-in-binary-tree", "drop": [ "tree_or_linked_list", "too_few_tests" ], "similar": [ "balanced-binary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "root", "k" ], "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 [1, 2000].", "1 <= Node.val <= 2000" ] }, { "question_id": 3320, "task_id": "count-the-number-of-winning-sequences", "drop": [], "similar": [ "predict-the-winner" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 30, "kept": 30, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use dynamic programming.", "For 0 < i < n - 1, -n < j < n, and k in {\u2019F\u2019, \u2018W\u2019, \u2018E\u2019}, let dp[i][j][k] be the number of sequences consisting of the first i moves such that the difference between bob\u2019s points and alice\u2019s point is equal to j and the i^th move that Bob played is k.", "The answer is the sum of dp[n - 1][j][k]over all j > 0 and over all k." ] }, { "question_id": 3321, "task_id": "find-x-sum-of-all-k-long-subarrays-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k", "x" ], "tests": { "total": 196, "kept": 194, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use sliding window.", "Use two sets ordered by frequency. One of the sets will only contain the top x frequent elements, and the second will contain all other elements.", "Update the two sets whenever you slide the window, and maintain a sum of the elements in the set with x elements" ] }, { "question_id": 3323, "task_id": "minimize-connected-groups-by-inserting-interval", "drop": [ "premium" ] }, { "question_id": 3324, "task_id": "find-the-sequence-of-strings-appeared-on-the-screen", "drop": [], "similar": [ "keyboard-row" ], "flags": [], "comparison": "exact", "parameter_names": [ "target" ], "tests": { "total": 41, "kept": 41, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Append the character 'a' using key 1.", "Convert it to the required character using key 2." ] }, { "question_id": 3325, "task_id": "count-substrings-with-k-frequency-characters-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 102, "kept": 102, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Fix the left index of the substring.", "For the fixed left index, find the first right index for which substring s[left..right] satisfies the condition.", "Every substring that starts at left and ends after right satisfies the condition." ] }, { "question_id": 3326, "task_id": "minimum-division-operations-to-make-array-non-decreasing", "drop": [], "similar": [ "smallest-value-after-replacing-with-sum-of-prime-factors" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 116, "kept": 114, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 10**(6)" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Iterate backward from the last index.", "Each number can be divided by its largest proper divisor to yield its smallest prime divisor." ] }, { "question_id": 3327, "task_id": "check-if-dfs-strings-are-palindromes", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "parent", "s" ], "tests": { "total": 39, "kept": 14, "dropped": { "constraint_violation": 25 } }, "dropped_tests": [ { "line": 4, "end_line": 4, "violates": [ "n == parent.length == s.length" ] }, { "line": 5, "end_line": 5, "violates": [ "n == parent.length == s.length" ] }, { "line": 12, "end_line": 12, "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": 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": 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": 33, "end_line": 33, "violates": [ "n == parent.length == s.length" ] }, { "line": 36, "end_line": 36, "violates": [ "n == parent.length == s.length" ] }, { "line": 37, "end_line": 37, "violates": [ "n == parent.length == s.length" ] }, { "line": 38, "end_line": 38, "violates": [ "n == parent.length == s.length" ] }, { "line": 40, "end_line": 40, "violates": [ "n == parent.length == s.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Perform the dfs described from the root of tree, and store the order in which nodes are visited into an array.", "For any node in the tree, the nodes in its subtree will form a contiguous subarray within the DFS traversal array.", "Use Manacher\u2019s algorithm to compute the answer for each node in constant time." ] }, { "question_id": 3329, "task_id": "count-substrings-with-k-frequency-characters-ii", "drop": [ "premium" ] }, { "question_id": 3330, "task_id": "find-the-original-typed-string-i", "drop": [], "similar": [ "keyboard-row", "faulty-keyboard" ], "flags": [], "comparison": "exact", "parameter_names": [ "word" ], "tests": { "total": 54, "kept": 51, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "1 <= word.length <= 100" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= word.length <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= word.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Any group of consecutive characters might have been the mistake." ] }, { "question_id": 3331, "task_id": "find-subtree-sizes-after-changes", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "parent", "s" ], "tests": { "total": 61, "kept": 24, "dropped": { "constraint_violation": 37 } }, "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": 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": 20, "end_line": 20, "violates": [ "n == parent.length == s.length" ] }, { "line": 21, "end_line": 21, "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": 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": 34, "end_line": 34, "violates": [ "n == parent.length == s.length" ] }, { "line": 36, "end_line": 36, "violates": [ "n == parent.length == s.length" ] }, { "line": 37, "end_line": 37, "violates": [ "n == parent.length == s.length" ] }, { "line": 38, "end_line": 38, "violates": [ "n == parent.length == s.length" ] }, { "line": 40, "end_line": 40, "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": 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" ] }, { "line": 51, "end_line": 51, "violates": [ "n == parent.length == s.length" ] }, { "line": 52, "end_line": 52, "violates": [ "n == parent.length == s.length" ] }, { "line": 55, "end_line": 55, "violates": [ "n == parent.length == s.length" ] }, { "line": 56, "end_line": 56, "violates": [ "n == parent.length == s.length" ] }, { "line": 57, "end_line": 57, "violates": [ "n == parent.length == s.length" ] }, { "line": 59, "end_line": 59, "violates": [ "n == parent.length == s.length" ] }, { "line": 60, "end_line": 60, "violates": [ "n == parent.length == s.length" ] }, { "line": 61, "end_line": 61, "violates": [ "n == parent.length == s.length" ] }, { "line": 62, "end_line": 62, "violates": [ "n == parent.length == s.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Perform a depth-first search on the tree, starting from the root.", "During the DFS, keep track of the most recent node where each character from 'a' to 'z' has been seen." ] }, { "question_id": 3332, "task_id": "maximum-points-tourist-can-earn", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k", "stayScore", "travelScore" ], "tests": { "total": 52, "kept": 13, "dropped": { "constraint_violation": 39 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "k == stayScore.length" ] }, { "line": 5, "end_line": 5, "violates": [ "k == stayScore.length" ] }, { "line": 8, "end_line": 8, "violates": [ "k == stayScore.length", "1 <= stayScore[i][j] <= 100" ] }, { "line": 9, "end_line": 9, "violates": [ "k == stayScore.length", "1 <= stayScore[i][j] <= 100" ] }, { "line": 10, "end_line": 10, "violates": [ "k == stayScore.length" ] }, { "line": 12, "end_line": 12, "violates": [ "k == stayScore.length" ] }, { "line": 14, "end_line": 14, "violates": [ "k == stayScore.length" ] }, { "line": 17, "end_line": 17, "violates": [ "k == stayScore.length" ] }, { "line": 19, "end_line": 19, "violates": [ "k == stayScore.length" ] }, { "line": 20, "end_line": 20, "violates": [ "k == stayScore.length" ] }, { "line": 22, "end_line": 22, "violates": [ "k == stayScore.length" ] }, { "line": 23, "end_line": 23, "violates": [ "k == stayScore.length" ] }, { "line": 24, "end_line": 24, "violates": [ "k == stayScore.length", "1 <= stayScore[i][j] <= 100" ] }, { "line": 25, "end_line": 25, "violates": [ "k == stayScore.length" ] }, { "line": 26, "end_line": 26, "violates": [ "k == stayScore.length" ] }, { "line": 27, "end_line": 27, "violates": [ "k == stayScore.length" ] }, { "line": 28, "end_line": 28, "violates": [ "k == stayScore.length" ] }, { "line": 29, "end_line": 29, "violates": [ "k == stayScore.length" ] }, { "line": 30, "end_line": 30, "violates": [ "k == stayScore.length" ] }, { "line": 31, "end_line": 31, "violates": [ "k == stayScore.length", "1 <= stayScore[i][j] <= 100" ] }, { "line": 32, "end_line": 32, "violates": [ "k == stayScore.length" ] }, { "line": 33, "end_line": 33, "violates": [ "k == stayScore.length" ] }, { "line": 34, "end_line": 34, "violates": [ "k == stayScore.length" ] }, { "line": 36, "end_line": 36, "violates": [ "k == stayScore.length" ] }, { "line": 37, "end_line": 37, "violates": [ "k == stayScore.length" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= stayScore[i][j] <= 100" ] }, { "line": 41, "end_line": 41, "violates": [ "k == stayScore.length" ] }, { "line": 42, "end_line": 42, "violates": [ "k == stayScore.length", "1 <= stayScore[i][j] <= 100" ] }, { "line": 43, "end_line": 43, "violates": [ "k == stayScore.length" ] }, { "line": 44, "end_line": 44, "violates": [ "k == stayScore.length" ] }, { "line": 45, "end_line": 45, "violates": [ "k == stayScore.length" ] }, { "line": 46, "end_line": 46, "violates": [ "k == stayScore.length" ] }, { "line": 47, "end_line": 47, "violates": [ "k == stayScore.length" ] }, { "line": 48, "end_line": 48, "violates": [ "k == stayScore.length" ] }, { "line": 49, "end_line": 49, "violates": [ "k == stayScore.length" ] }, { "line": 50, "end_line": 50, "violates": [ "k == stayScore.length", "1 <= stayScore[i][j] <= 100" ] }, { "line": 51, "end_line": 51, "violates": [ "k == stayScore.length" ] }, { "line": 52, "end_line": 52, "violates": [ "k == stayScore.length" ] }, { "line": 53, "end_line": 53, "violates": [ "k == stayScore.length", "1 <= stayScore[i][j] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use DP.", "dp[i][j] is the maximum score that you can achieve in your last i actions by starting from city j." ] }, { "question_id": 3333, "task_id": "find-the-original-typed-string-ii", "drop": [], "similar": [ "keyboard-row", "faulty-keyboard" ], "flags": [], "comparison": "exact", "parameter_names": [ "word", "k" ], "tests": { "total": 104, "kept": 103, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 97, "end_line": 97, "violates": [ "1 <= word.length <= 5 * 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Instead of solving for at least k, can we solve for at most k - 1 length?" ] }, { "question_id": 3334, "task_id": "find-the-maximum-factor-score-of-array", "drop": [], "similar": [ "greatest-common-divisor-of-strings", "remove-one-element-to-make-the-array-strictly-increasing" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 120, "kept": 33, "dropped": { "constraint_violation": 87 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 31, "end_line": 31, "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": 34, "end_line": 34, "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": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 30", "1 <= nums[i] <= 30" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 48, "end_line": 48, "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": 52, "end_line": 52, "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": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 30", "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": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 63, "end_line": 63, "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": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 30", "1 <= nums[i] <= 30" ] }, { "line": 67, "end_line": 67, "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": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 76, "end_line": 76, "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": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums[i] <= 30", "1 <= nums[i] <= 30" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 30", "1 <= nums[i] <= 30" ] }, { "line": 83, "end_line": 83, "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": 89, "end_line": 89, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 96, "end_line": 96, "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": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums[i] <= 30", "1 <= nums[i] <= 30" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= nums[i] <= 30", "1 <= nums[i] <= 30" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= nums[i] <= 30" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= nums[i] <= 30", "1 <= nums[i] <= 30" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use brute force approach with two loops.", "Optimize using prefix and suffix arrays." ] }, { "question_id": 3335, "task_id": "total-characters-in-string-after-transformations-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 87, "kept": 86, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= t <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Maintain the frequency of each character." ] }, { "question_id": 3336, "task_id": "find-the-number-of-subsequences-with-equal-gcd", "drop": [], "similar": [ "find-greatest-common-divisor-of-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 106, "kept": 87, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= nums[i] <= 200", "1 <= nums[i] <= 200" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 200", "1 <= nums[i] <= 200" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 200", "1 <= nums[i] <= 200" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 200" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 200", "1 <= nums[i] <= 200" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= nums[i] <= 200" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming to store number of subsequences up till index i with GCD g1 and g2." ] }, { "question_id": 3337, "task_id": "total-characters-in-string-after-transformations-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t", "nums" ], "tests": { "total": 112, "kept": 105, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "1 <= t <= 10**(9)" ] }, { "line": 52, "end_line": 52, "violates": [ "nums.length == 26" ] }, { "line": 56, "end_line": 56, "violates": [ "nums.length == 26" ] }, { "line": 65, "end_line": 65, "violates": [ "nums.length == 26" ] }, { "line": 78, "end_line": 78, "violates": [ "nums.length == 26" ] }, { "line": 83, "end_line": 83, "violates": [ "nums.length == 26" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= nums[i] <= 25" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Model the problem as a matrix multiplication problem.", "Use exponentiation to quickly multiply matrices." ] }, { "question_id": 3339, "task_id": "find-the-number-of-k-even-arrays", "drop": [ "premium" ] }, { "question_id": 3340, "task_id": "check-balanced-string", "drop": [], "similar": [ "balanced-binary-tree" ], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 103, "kept": 103, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 3341, "task_id": "find-minimum-time-to-reach-last-room-i", "drop": [], "similar": [ "minimum-cost-to-reach-destination-in-time", "minimum-time-to-visit-a-cell-in-a-grid" ], "flags": [], "comparison": "exact", "parameter_names": [ "moveTime" ], "tests": { "total": 87, "kept": 86, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "0 <= moveTime[i][j] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use shortest path algorithms." ] }, { "question_id": 3342, "task_id": "find-minimum-time-to-reach-last-room-ii", "drop": [], "similar": [ "minimum-cost-to-reach-destination-in-time", "minimum-time-to-visit-a-cell-in-a-grid" ], "flags": [], "comparison": "exact", "parameter_names": [ "moveTime" ], "tests": { "total": 81, "kept": 80, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 46, "end_line": 46, "violates": [ "0 <= moveTime[i][j] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use shortest path algorithms with a state for the last move being odd or even indexed." ] }, { "question_id": 3343, "task_id": "count-number-of-balanced-permutations", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "num" ], "tests": { "total": 113, "kept": 111, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 50, "end_line": 50, "violates": [ "2 <= num.length <= 80" ] }, { "line": 74, "end_line": 74, "violates": [ "2 <= num.length <= 80" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Count frequency of each character in the string.", "Use dynamic programming.", "The states are the characters, sum of even index numbers, and the number of digits used.", "Calculate the sum of odd index numbers without using a state for it." ] }, { "question_id": 3344, "task_id": "maximum-sized-array", "drop": [ "premium" ] }, { "question_id": 3345, "task_id": "smallest-divisible-digit-product-i", "drop": [], "similar": [ "smallest-number-with-given-digit-product" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "t" ], "tests": { "total": 124, "kept": 51, "dropped": { "constraint_violation": 73 } }, "dropped_tests": [ { "line": 29, "end_line": 29, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= t <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= n <= 100" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= n <= 100" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= t <= 10" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= t <= 10" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= t <= 10" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= t <= 10" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= t <= 10" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= t <= 10" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= t <= 10" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= n <= 100" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= t <= 10" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= t <= 10" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= t <= 10" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= t <= 10" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= t <= 10" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= n <= 100" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= t <= 10" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= t <= 10" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= t <= 10" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= t <= 10" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= t <= 10" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= t <= 10" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= t <= 10" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= n <= 100" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= t <= 10" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= n <= 100" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= t <= 10" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= n <= 100" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= t <= 10" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= t <= 10" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= n <= 100" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= t <= 10" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= t <= 10" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= n <= 100" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= t <= 10" ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= n <= 100" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 102, "end_line": 102, "violates": [ "1 <= t <= 10" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= t <= 10" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= t <= 10" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= t <= 10" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 111, "end_line": 111, "violates": [ "1 <= t <= 10" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= n <= 100", "1 <= t <= 10" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= t <= 10" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= t <= 10" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= t <= 10" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= t <= 10" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= n <= 100" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= t <= 10" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= n <= 100" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= n <= 100" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= t <= 10" ] }, { "line": 124, "end_line": 124, "violates": [ "1 <= t <= 10" ] }, { "line": 125, "end_line": 125, "violates": [ "1 <= t <= 10" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "You have to check at most 10 numbers.", "Apply a brute-force approach by checking each possible number." ] }, { "question_id": 3346, "task_id": "maximum-frequency-of-an-element-after-performing-operations-i", "drop": [], "similar": [ "frequency-of-the-most-frequent-element", "count-elements-with-maximum-frequency" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k", "numOperations" ], "tests": { "total": 99, "kept": 65, "dropped": { "constraint_violation": 34 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 16, "end_line": 16, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 17, "end_line": 17, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 20, "end_line": 20, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 32, "end_line": 32, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 33, "end_line": 33, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 43, "end_line": 43, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 55, "end_line": 55, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 60, "end_line": 60, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 65, "end_line": 65, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 70, "end_line": 70, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 81, "end_line": 81, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 83, "end_line": 83, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 85, "end_line": 85, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 89, "end_line": 89, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 95, "end_line": 95, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 96, "end_line": 96, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 98, "end_line": 98, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= numOperations <= nums.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the array and try each value in range as a candidate." ] }, { "question_id": 3347, "task_id": "maximum-frequency-of-an-element-after-performing-operations-ii", "drop": [], "similar": [ "frequency-of-the-most-frequent-element", "count-elements-with-maximum-frequency" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k", "numOperations" ], "tests": { "total": 101, "kept": 67, "dropped": { "constraint_violation": 34 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 14, "end_line": 14, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 18, "end_line": 18, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 25, "end_line": 25, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 26, "end_line": 26, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 37, "end_line": 37, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 46, "end_line": 46, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 52, "end_line": 52, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 68, "end_line": 68, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 74, "end_line": 74, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 77, "end_line": 77, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 86, "end_line": 86, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 87, "end_line": 87, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 90, "end_line": 90, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 99, "end_line": 99, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= numOperations <= nums.length" ] }, { "line": 101, "end_line": 101, "violates": [ "0 <= numOperations <= nums.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The optimal values to check are nums[i] - k, nums[i], and nums[i] + k." ] }, { "question_id": 3348, "task_id": "smallest-divisible-digit-product-ii", "drop": [], "similar": [ "smallest-number-with-given-digit-product" ], "flags": [], "comparison": "exact", "parameter_names": [ "num", "t" ], "tests": { "total": 126, "kept": 93, "dropped": { "constraint_violation": 33 } }, "dropped_tests": [ { "line": 21, "end_line": 21, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 125, "end_line": 125, "violates": [ "1 <= t <= 10**(14)" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= t <= 10**(14)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "t should only have 2, 3, 5 and 7 as prime factors.", "Find the shortest suffix that must be changed.", "Try to form the string greedily." ] }, { "question_id": 3349, "task_id": "adjacent-increasing-subarrays-detection-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 123, "kept": 122, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 55, "end_line": 55, "violates": [ "-1000 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Store the longest increasing subarray starting and ending at an index." ] }, { "question_id": 3350, "task_id": "adjacent-increasing-subarrays-detection-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 152, "kept": 152, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Find the boundaries between strictly increasing subarrays.", "Can we use binary search?" ] }, { "question_id": 3351, "task_id": "sum-of-good-subsequences", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 124, "kept": 121, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 107, "end_line": 107, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 118, "end_line": 118, "violates": [ "0 <= nums[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Consider counting how many times each element occurs in all possible good subsequences. This can help you derive the final answer more easily.", "Use dynamic programming to track both the count and the sum of subsequences where the last element is nums[i]." ] }, { "question_id": 3352, "task_id": "count-k-reducible-numbers-less-than-n", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 37, "kept": 37, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "You can precompute number of operations required to convert a number with x bits to 1.", "Use digit dp." ] }, { "question_id": 3353, "task_id": "minimum-total-operations", "drop": [ "premium" ] }, { "question_id": 3354, "task_id": "make-array-elements-equal-to-zero", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 119, "kept": 118, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 107, "end_line": 107, "violates": [ "0 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Since the constraints are very small, you can simulate the process described." ] }, { "question_id": 3355, "task_id": "zero-array-transformation-i", "drop": [], "similar": [ "zero-array-transformation-iv" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 103, "kept": 99, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 23, "end_line": 23, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= li <= ri < nums.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use difference array and prefix sum to check if an index can be made zero?" ] }, { "question_id": 3356, "task_id": "zero-array-transformation-ii", "drop": [], "similar": [ "corporate-flight-bookings", "minimum-moves-to-make-array-complementary", "zero-array-transformation-iv" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 87, "kept": 66, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= vali <= 5" ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= vali <= 5" ] }, { "line": 11, "end_line": 11, "violates": [ "1 <= vali <= 5" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= vali <= 5" ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= vali <= 5" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= vali <= 5" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= vali <= 5" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= vali <= 5" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= vali <= 5" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= vali <= 5" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= vali <= 5" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= vali <= 5" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= vali <= 5" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= vali <= 5" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= vali <= 5" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= vali <= 5" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= vali <= 5" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= vali <= 5" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= vali <= 5" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= vali <= 5" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= vali <= 5" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we apply binary search here?", "Utilize a difference array to optimize the processing of queries." ] }, { "question_id": 3359, "task_id": "find-sorted-submatrices-with-maximum-element-at-most-k", "drop": [ "premium" ] }, { "question_id": 3360, "task_id": "stone-removal-game", "drop": [], "similar": [ "stone-game-iv" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 29, "kept": 29, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The constraints are small enough that a brute-force solution is feasible." ] }, { "question_id": 3361, "task_id": "shift-distance-between-two-strings", "drop": [], "similar": [ "shifting-letters", "shifting-letters-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t", "nextCost", "previousCost" ], "tests": { "total": 86, "kept": 79, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= s.length == t.length <= 10**(5)" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= s.length == t.length <= 10**(5)" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= s.length == t.length <= 10**(5)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= s.length == t.length <= 10**(5)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= s.length == t.length <= 10**(5)" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= s.length == t.length <= 10**(5)" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= s.length == t.length <= 10**(5)", "nextCost.length == previousCost.length == 26" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "- For every unordered pair of characters (a, b), the cost of turning a into b is equal to the minimum between:\n- If i < j, nextCost[i] + nextCost[i + 1] + \u2026 + nextCost[j - 1], and nextCost[i] + nextCost[i + 1] + \u2026 + nextCost[25] + nextCost[0] + \u2026 + nextCost[j - 1] otherwise.\n- If i < j, prevCost[i] + prevCost[i - 1] + \u2026 + prevCost[0] + prevCost[25] + \u2026 + prevCost[j + 1], and prevCost[i] + prevCost[i - 1] + \u2026 + prevCost[j + 1] otherwise.\n\nWhere i and j are the indices of a and b in the alphabet.", "The shift distance is the sum of costs of turning s[i] into t[i]." ] }, { "question_id": 3362, "task_id": "zero-array-transformation-iii", "drop": [], "similar": [ "corporate-flight-bookings", "minimum-moves-to-make-array-complementary", "zero-array-transformation-iv" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 113, "kept": 106, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 24, "end_line": 24, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 41, "end_line": 41, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 83, "end_line": 83, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 97, "end_line": 97, "violates": [ "0 <= li <= ri < nums.length" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the queries.", "We need to greedily pick the queries with farthest ending point first." ] }, { "question_id": 3363, "task_id": "find-the-maximum-number-of-fruits-collected", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "fruits" ], "tests": { "total": 87, "kept": 85, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 34, "end_line": 34, "violates": [ "2 <= n == fruits.length == fruits[i].length <= 1000" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= fruits[i][j] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The child at (0, 0) has only one possible path.", "The other two children won\u2019t intersect its path.", "Use Dynamic Programming." ] }, { "question_id": 3364, "task_id": "minimum-positive-sum-subarray", "drop": [], "similar": [ "minimum-size-subarray-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "l", "r" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Check every subarray, since constraints are small." ] }, { "question_id": 3365, "task_id": "rearrange-k-substrings-to-form-target-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t", "k" ], "tests": { "total": 100, "kept": 38, "dropped": { "constraint_violation": 62 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "The input is generated such that s and t are anagrams of each other." ] }, { "line": 8, "end_line": 8, "violates": [ "The input is generated such that s and t are anagrams of each other." ] }, { "line": 9, "end_line": 9, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 11, "end_line": 11, "violates": [ "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 15, "end_line": 15, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 16, "end_line": 16, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 20, "end_line": 20, "violates": [ "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 22, "end_line": 22, "violates": [ "s.length is divisible by k." ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 36, "end_line": 36, "violates": [ "s.length is divisible by k." ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 42, "end_line": 42, "violates": [ "The input is generated such that s and t are anagrams of each other." ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 59, "end_line": 59, "violates": [ "s.length is divisible by k." ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 68, "end_line": 68, "violates": [ "s.length is divisible by k." ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 71, "end_line": 71, "violates": [ "s.length is divisible by k." ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 80, "end_line": 80, "violates": [ "s.length is divisible by k." ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 82, "end_line": 82, "violates": [ "The input is generated such that s and t are anagrams of each other." ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 85, "end_line": 85, "violates": [ "s.length is divisible by k." ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 95, "end_line": 95, "violates": [ "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 99, "end_line": 99, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= s.length == t.length <= 2 * 10**(5)", "s.length is divisible by k.", "The input is generated such that s and t are anagrams of each other." ] }, { "line": 101, "end_line": 101, "violates": [ "s.length is divisible by k." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Split s into k equal-sized substrings, use a map to track frequencies, and check if rearranging them can form t." ] }, { "question_id": 3366, "task_id": "minimum-array-sum", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k", "op1", "op2" ], "tests": { "total": 258, "kept": 252, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 36, "end_line": 36, "violates": [ "0 <= op1, op2 <= nums.length" ] }, { "line": 38, "end_line": 38, "violates": [ "0 <= op1, op2 <= nums.length" ] }, { "line": 66, "end_line": 66, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 96, "end_line": 96, "violates": [ "0 <= op1, op2 <= nums.length" ] }, { "line": 126, "end_line": 126, "violates": [ "0 <= nums[i] <= 10**(5)" ] }, { "line": 228, "end_line": 228, "violates": [ "0 <= op1, op2 <= nums.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Think of dynamic programming with states to track progress and remaining operations.", "Use dp[index][op1][op2] where each state tracks progress at index with op1 and op2 operations left.", "At each state, try applying only operation 1, only operation 2, both in sequence, or skip both to find optimal results." ] }, { "question_id": 3367, "task_id": "maximize-sum-of-weights-after-edge-removals", "drop": [], "similar": [ "find-minimum-diameter-after-merging-two-trees" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges", "k" ], "tests": { "total": 65, "kept": 65, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use DFS based approach here?", "For each edge, find two sums: one including the edge and one excluding it." ] }, { "question_id": 3370, "task_id": "smallest-number-with-all-set-bits", "drop": [], "similar": [ "minimum-number-of-k-consecutive-bit-flips", "minimum-bit-flips-to-convert-number", "find-sum-of-array-product-of-magical-sequences" ], "flags": [], "comparison": "exact", "parameter_names": [ "n" ], "tests": { "total": 56, "kept": 52, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "1 <= n <= 1000" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= n <= 1000" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= n <= 1000" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= n <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Find the strictly greater power of 2, and subtract 1 from it." ] }, { "question_id": 3371, "task_id": "identify-the-largest-outlier-in-an-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 118, "kept": 38, "dropped": { "constraint_violation": 80 } }, "dropped_tests": [ { "line": 6, "end_line": 6, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 14, "end_line": 14, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 17, "end_line": 17, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 20, "end_line": 20, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 21, "end_line": 21, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 22, "end_line": 22, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 25, "end_line": 25, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 28, "end_line": 28, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 29, "end_line": 29, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 30, "end_line": 30, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 31, "end_line": 31, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 32, "end_line": 32, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 33, "end_line": 33, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 34, "end_line": 34, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 35, "end_line": 35, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 36, "end_line": 36, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 37, "end_line": 37, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 38, "end_line": 38, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 39, "end_line": 39, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 41, "end_line": 41, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 43, "end_line": 43, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 44, "end_line": 44, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 45, "end_line": 45, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 46, "end_line": 46, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 47, "end_line": 47, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 48, "end_line": 48, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 49, "end_line": 49, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 50, "end_line": 50, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 51, "end_line": 51, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 52, "end_line": 52, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 53, "end_line": 53, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 55, "end_line": 55, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 56, "end_line": 56, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 58, "end_line": 58, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 59, "end_line": 59, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 62, "end_line": 62, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 63, "end_line": 63, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 64, "end_line": 64, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 65, "end_line": 65, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 66, "end_line": 66, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 68, "end_line": 68, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 69, "end_line": 69, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 72, "end_line": 72, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 73, "end_line": 73, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 74, "end_line": 74, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 75, "end_line": 75, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 76, "end_line": 76, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 80, "end_line": 80, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 81, "end_line": 81, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 82, "end_line": 82, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 84, "end_line": 84, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 85, "end_line": 85, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 86, "end_line": 86, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 87, "end_line": 87, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 88, "end_line": 88, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 89, "end_line": 89, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 91, "end_line": 91, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 92, "end_line": 92, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 94, "end_line": 94, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 95, "end_line": 95, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 96, "end_line": 96, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 97, "end_line": 97, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 98, "end_line": 98, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 99, "end_line": 99, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 100, "end_line": 100, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 101, "end_line": 101, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 102, "end_line": 102, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 103, "end_line": 103, "violates": [ "-1000 <= nums[i] <= 1000" ] }, { "line": 104, "end_line": 104, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 106, "end_line": 106, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 107, "end_line": 107, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 108, "end_line": 108, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 109, "end_line": 109, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 110, "end_line": 110, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 111, "end_line": 111, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 112, "end_line": 112, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 113, "end_line": 113, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 114, "end_line": 114, "violates": [ "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 115, "end_line": 115, "violates": [ "-1000 <= nums[i] <= 1000", "The input is generated such that at least one potential outlier exists in nums." ] }, { "line": 119, "end_line": 119, "violates": [ "-1000 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "What will be the value of array sum if we remove the outlier from it?", "Use hashmap to find occurrence of an element quickly." ] }, { "question_id": 3372, "task_id": "maximize-the-number-of-target-nodes-after-connecting-trees-i", "drop": [], "similar": [ "find-minimum-diameter-after-merging-two-trees" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges1", "edges2", "k" ], "tests": { "total": 58, "kept": 58, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each node u in the first tree, find the number of nodes at a distance of at most k from node u.", "For each node v in the second tree, find the number of nodes at a distance of at most k - 1 from node v." ] }, { "question_id": 3373, "task_id": "maximize-the-number-of-target-nodes-after-connecting-trees-ii", "drop": [], "similar": [ "find-minimum-diameter-after-merging-two-trees" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "edges1", "edges2" ], "tests": { "total": 49, "kept": 49, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Compute an array even where even[u] is the number of nodes at an even distance from node u, for every u of the first tree.", "Compute an array odd where odd[u] is the number of nodes at an odd distance from node u, for every u of the second tree.", "answer[i] = even[i]+ max(odd[1], odd[2], \u2026, odd[m - 1])" ] }, { "question_id": 3375, "task_id": "minimum-operations-to-make-array-values-equal-to-k", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 120, "kept": 120, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Handle the case when the array contains an integer less than k", "Start by performing operations on the highest integer", "You can perform an operation on the highest integer using the second-highest, an operation on the second-highest using the third-highest, and so forth.", "The answer is the number of distinct integers in the array that are larger than k." ] }, { "question_id": 3376, "task_id": "minimum-time-to-break-locks-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "strength", "k" ], "tests": { "total": 175, "kept": 166, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= strength[i] <= 10**(6)" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= k <= 10" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= k <= 10" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= strength[i] <= 10**(6)" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= k <= 10" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= k <= 10" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= k <= 10" ] }, { "line": 119, "end_line": 119, "violates": [ "1 <= strength[i] <= 10**(6)" ] }, { "line": 151, "end_line": 151, "violates": [ "1 <= strength[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Try all n! permutation ways of breaking the locks." ] }, { "question_id": 3377, "task_id": "digit-operations-to-make-two-integers-equal", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "m" ], "tests": { "total": 111, "kept": 109, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "n and m consist of the same number of digits." ] }, { "line": 93, "end_line": 93, "violates": [ "n and m consist of the same number of digits." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Consider a directed, weighted graph where an edge exists from a node x to a node y if and only if x can be transformed into y through a single operation.", "Apply a shortest path algorithm on this graph to find the shortest path from n to m." ] }, { "question_id": 3378, "task_id": "count-connected-components-in-lcm-graph", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "nums", "threshold" ], "tests": { "total": 91, "kept": 86, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "1 <= threshold <= 2 * 10**(5)" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= threshold <= 2 * 10**(5)" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= threshold <= 2 * 10**(5)" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= threshold <= 2 * 10**(5)" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= threshold <= 2 * 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use DSU", "Connect a number to all its multiples less than threshold" ] }, { "question_id": 3379, "task_id": "transformed-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 126, "kept": 126, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simulate the operations as described in the statement" ] }, { "question_id": 3380, "task_id": "maximum-area-rectangle-with-point-constraints-i", "drop": [], "similar": [ "minimum-area-rectangle" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "points" ], "tests": { "total": 93, "kept": 49, "dropped": { "constraint_violation": 44 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= points.length <= 10" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= points.length <= 10" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= points.length <= 10" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= points.length <= 10" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= points.length <= 10" ] }, { "line": 30, "end_line": 30, "violates": [ "1 <= points.length <= 10" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= points.length <= 10" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= points.length <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= points.length <= 10" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= points.length <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= points.length <= 10" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= points.length <= 10" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= points.length <= 10" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= points.length <= 10" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= points.length <= 10" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= points.length <= 10" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= points.length <= 10" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= points.length <= 10" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= points.length <= 10" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= points.length <= 10" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= points.length <= 10" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= points.length <= 10" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= points.length <= 10" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= points.length <= 10" ] }, { "line": 61, "end_line": 61, "violates": [ "1 <= points.length <= 10" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= points.length <= 10" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= points.length <= 10" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= points.length <= 10" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= points.length <= 10" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= points.length <= 10" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= points.length <= 10" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= points.length <= 10" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= points.length <= 10" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= points.length <= 10" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= points.length <= 10" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= points.length <= 10" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= points.length <= 10" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= points.length <= 10" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= points.length <= 10" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= points.length <= 10" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= points.length <= 10" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= points.length <= 10" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= points.length <= 10" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= points.length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If (x1, y1) and (x2, y2) are two opposite corners of a rectangle, then the other two would be (x1, y2) and (x2, y1).", "Fix two points and find the other two using a set data structure.", "After determining the rectangle, iterate through the array of points to ensure no point lies on the rectangle\u2019s border or within its interior." ] }, { "question_id": 3381, "task_id": "maximum-subarray-sum-with-length-divisible-by-k", "drop": [], "similar": [ "subarray-sums-divisible-by-k" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 128, "kept": 126, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 38, "end_line": 38, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] }, { "line": 97, "end_line": 97, "violates": [ "-10**(9) <= nums[i] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Maintain minimum prefix sum ending at every possible index%k." ] }, { "question_id": 3382, "task_id": "maximum-area-rectangle-with-point-constraints-ii", "drop": [], "similar": [ "minimum-area-rectangle" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "xCoord", "yCoord" ], "tests": { "total": 131, "kept": 102, "dropped": { "constraint_violation": 29 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "All the given points are unique." ] }, { "line": 15, "end_line": 15, "violates": [ "All the given points are unique." ] }, { "line": 23, "end_line": 23, "violates": [ "All the given points are unique." ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= xCoord[i], yCoord[i] <= 8 * 10**(7)", "0 <= xCoord[i], yCoord[i] <= 8 * 10**(7)" ] }, { "line": 27, "end_line": 27, "violates": [ "All the given points are unique." ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= xCoord[i], yCoord[i] <= 8 * 10**(7)", "0 <= xCoord[i], yCoord[i] <= 8 * 10**(7)" ] }, { "line": 33, "end_line": 33, "violates": [ "All the given points are unique." ] }, { "line": 35, "end_line": 35, "violates": [ "All the given points are unique." ] }, { "line": 42, "end_line": 42, "violates": [ "All the given points are unique." ] }, { "line": 45, "end_line": 45, "violates": [ "All the given points are unique." ] }, { "line": 46, "end_line": 46, "violates": [ "All the given points are unique." ] }, { "line": 48, "end_line": 48, "violates": [ "All the given points are unique." ] }, { "line": 55, "end_line": 55, "violates": [ "All the given points are unique." ] }, { "line": 64, "end_line": 64, "violates": [ "All the given points are unique." ] }, { "line": 69, "end_line": 69, "violates": [ "All the given points are unique." ] }, { "line": 72, "end_line": 72, "violates": [ "All the given points are unique." ] }, { "line": 84, "end_line": 84, "violates": [ "All the given points are unique." ] }, { "line": 90, "end_line": 90, "violates": [ "All the given points are unique." ] }, { "line": 92, "end_line": 92, "violates": [ "All the given points are unique." ] }, { "line": 100, "end_line": 100, "violates": [ "0 <= xCoord[i], yCoord[i] <= 8 * 10**(7)", "All the given points are unique." ] }, { "line": 102, "end_line": 102, "violates": [ "All the given points are unique." ] }, { "line": 105, "end_line": 105, "violates": [ "All the given points are unique." ] }, { "line": 106, "end_line": 106, "violates": [ "All the given points are unique." ] }, { "line": 108, "end_line": 108, "violates": [ "All the given points are unique." ] }, { "line": 112, "end_line": 112, "violates": [ "All the given points are unique." ] }, { "line": 118, "end_line": 118, "violates": [ "All the given points are unique." ] }, { "line": 126, "end_line": 126, "violates": [ "All the given points are unique." ] }, { "line": 129, "end_line": 129, "violates": [ "All the given points are unique." ] }, { "line": 132, "end_line": 132, "violates": [ "All the given points are unique." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Process the points by sorting them based on their x-coordinates.", "For each x-coordinate, sort the corresponding points by y and select two consecutive points y1 and y2 (y1 < y2).", "Identify the closest x-coordinate (greater than the current x) where some y-coordinates lie in [y1, y2].", "Use a segment tree to efficiently locate the nearest x-coordinate.", "Check if the points form a valid rectangle. How?" ] }, { "question_id": 3383, "task_id": "minimum-runes-to-add-to-cast-spell", "drop": [ "premium" ] }, { "question_id": 3386, "task_id": "button-with-longest-push-time", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "events" ], "tests": { "total": 104, "kept": 103, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 59, "end_line": 59, "violates": [ "1 <= indexi, timei <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [] }, { "question_id": 3387, "task_id": "maximize-amount-after-two-days-of-conversions", "drop": [ "too_few_tests" ], "similar": [ "evaluate-division" ], "flags": [ "decimal_answer" ], "comparison": "float", "parameter_names": [ "initialCurrency", "pairs1", "rates1", "pairs2", "rates2" ], "tests": { "total": 9, "kept": 3, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1.0 <= rates1[i], rates2[i] <= 10.0" ] }, { "line": 3, "end_line": 3, "violates": [ "1.0 <= rates1[i], rates2[i] <= 10.0" ] }, { "line": 4, "end_line": 4, "violates": [ "1.0 <= rates1[i], rates2[i] <= 10.0" ] }, { "line": 6, "end_line": 6, "violates": [ "1.0 <= rates1[i], rates2[i] <= 10.0" ] }, { "line": 7, "end_line": 7, "violates": [ "1.0 <= rates1[i], rates2[i] <= 10.0" ] }, { "line": 10, "end_line": 10, "violates": [ "1.0 <= rates1[i], rates2[i] <= 10.0" ] } ], "unchecked_constraints": [] }, { "question_id": 3388, "task_id": "count-beautiful-splits-in-an-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 107, "kept": 106, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "0 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use 2D dynamic programming to find the maximum matching prefix." ] }, { "question_id": 3389, "task_id": "minimum-operations-to-make-character-frequencies-equal", "drop": [], "similar": [ "minimum-number-of-steps-to-make-two-strings-anagram" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 40, "kept": 40, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The order of the letters in the string is irrelevant.", "Compute an occurrence array occ where occ[x] is the number of occurrences of the x character of the alphabet. How do the described operations change occ?", "We have three types of operations: increase any occ[x] by 1, decrease any occ[x] by 1, or decrease any occ[x] by 1 and simultaneously increase occ[x + 1] by 1 at the same time. To make s good, we need to make occ good. occ is good if and only if every occ[x] equals either 0 or some constant c.", "If you know the value of c, how can you calculate the minimum operations required to make occ good?", "Observation 1: It is never optimal to apply the third type of operation (simultaneous decrease and increase) on two continuous elements occ[x] and occ[x + 1]. Instead, we can decrease occ[x] by 1 then increase occ[x + 2] by 1 to achieve the same effect.", "Observation 2: It is never optimal to increase an element of occ then decrease it, or vice versa.", "Use dynamic programming where dp[i] is the minimum number of operations required to make occ[0..i] good. You will need to use the above observations to come up with the transitions." ] }, { "question_id": 3392, "task_id": "count-subarrays-of-length-three-with-a-condition", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 134, "kept": 120, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 30, "end_line": 30, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 33, "end_line": 33, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 36, "end_line": 36, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 46, "end_line": 46, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 47, "end_line": 47, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 59, "end_line": 59, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 68, "end_line": 68, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 69, "end_line": 69, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 77, "end_line": 77, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 81, "end_line": 81, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 119, "end_line": 119, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 120, "end_line": 120, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 126, "end_line": 126, "violates": [ "-100 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The constraints are small. Consider checking every subarray." ] }, { "question_id": 3393, "task_id": "count-paths-with-the-given-xor-value", "drop": [], "similar": [ "count-pairs-with-xor-in-a-range" ], "flags": [], "comparison": "exact", "parameter_names": [ "grid", "k" ], "tests": { "total": 106, "kept": 94, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "0 <= grid[r][c] < 16" ] }, { "line": 27, "end_line": 27, "violates": [ "0 <= grid[r][c] < 16" ] }, { "line": 28, "end_line": 28, "violates": [ "0 <= k < 16" ] }, { "line": 30, "end_line": 30, "violates": [ "0 <= grid[r][c] < 16" ] }, { "line": 36, "end_line": 36, "violates": [ "0 <= grid[r][c] < 16" ] }, { "line": 44, "end_line": 44, "violates": [ "0 <= grid[r][c] < 16" ] }, { "line": 54, "end_line": 54, "violates": [ "0 <= grid[r][c] < 16" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= grid[r][c] < 16", "0 <= k < 16" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= grid[r][c] < 16" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= grid[r][c] < 16" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= grid[r][c] < 16", "0 <= k < 16" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= grid[r][c] < 16" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use DP." ] }, { "question_id": 3394, "task_id": "check-if-grid-can-be-cut-into-sections", "drop": [ "figure_reference" ], "similar": [], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "n", "rectangles" ], "tests": { "total": 57, "kept": 48, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 10, "end_line": 10, "violates": [ "No two rectangles overlap." ] }, { "line": 12, "end_line": 12, "violates": [ "No two rectangles overlap." ] }, { "line": 13, "end_line": 13, "violates": [ "No two rectangles overlap." ] }, { "line": 25, "end_line": 25, "violates": [ "No two rectangles overlap." ] }, { "line": 29, "end_line": 29, "violates": [ "No two rectangles overlap." ] }, { "line": 34, "end_line": 34, "violates": [ "No two rectangles overlap." ] }, { "line": 37, "end_line": 37, "violates": [ "No two rectangles overlap." ] }, { "line": 43, "end_line": 43, "violates": [ "No two rectangles overlap." ] }, { "line": 57, "end_line": 57, "violates": [ "No two rectangles overlap." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each rectangle, consider ranges [start_x, end_x] and [start_y, end_y] separately.", "For x and y directions, check whether we can split it into 3 parts." ] }, { "question_id": 3395, "task_id": "subsequences-with-a-unique-middle-mode-i", "drop": [], "similar": [ "subsequences-with-a-unique-middle-mode-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 133, "kept": 133, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "For each index, find the number of subsequences for which it is the unique middle mode. What combinations of values can the two numbers on the left and the right take?", "For example, we can have exactly 1 element on the left equal to the middle and all other elements differ. What other combinations are acceptable?" ] }, { "question_id": 3396, "task_id": "minimum-number-of-operations-to-make-elements-in-array-distinct", "drop": [], "similar": [ "minimum-increment-to-make-array-unique" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 116, "kept": 115, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 80, "end_line": 80, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "The constraints are small. Try brute force." ] }, { "question_id": 3397, "task_id": "maximum-number-of-distinct-elements-after-operations", "drop": [], "similar": [ "least-number-of-unique-integers-after-k-removals" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 120, "kept": 120, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use sorting here?", "Find the minimum element which is not used for each element." ] }, { "question_id": 3398, "task_id": "smallest-substring-with-identical-characters-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "numOps" ], "tests": { "total": 120, "kept": 117, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 28, "end_line": 28, "violates": [ "0 <= numOps <= n" ] }, { "line": 56, "end_line": 56, "violates": [ "0 <= numOps <= n" ] }, { "line": 67, "end_line": 67, "violates": [ "0 <= numOps <= n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we use binary search here?", "Use DP for predicate function" ] }, { "question_id": 3399, "task_id": "smallest-substring-with-identical-characters-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "numOps" ], "tests": { "total": 128, "kept": 114, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "0 <= numOps <= n" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= numOps <= n" ] }, { "line": 24, "end_line": 24, "violates": [ "0 <= numOps <= n" ] }, { "line": 51, "end_line": 51, "violates": [ "0 <= numOps <= n" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= numOps <= n" ] }, { "line": 71, "end_line": 71, "violates": [ "0 <= numOps <= n" ] }, { "line": 76, "end_line": 76, "violates": [ "0 <= numOps <= n" ] }, { "line": 84, "end_line": 84, "violates": [ "0 <= numOps <= n" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= numOps <= n" ] }, { "line": 108, "end_line": 108, "violates": [ "0 <= numOps <= n" ] }, { "line": 112, "end_line": 112, "violates": [ "0 <= numOps <= n" ] }, { "line": 119, "end_line": 119, "violates": [ "0 <= numOps <= n" ] }, { "line": 125, "end_line": 125, "violates": [ "0 <= numOps <= n" ] }, { "line": 128, "end_line": 128, "violates": [ "0 <= numOps <= n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Binary search for the answer.", "Group the same digits by size of (mid + 1) and ignore any remainder. Flip one in each group (the last one).", "For the last group, we can flip the 2nd last one.", "What if the answer was 1?" ] }, { "question_id": 3400, "task_id": "maximum-number-of-matching-indices-after-right-shifts", "drop": [ "premium" ] }, { "question_id": 3402, "task_id": "minimum-operations-to-make-columns-strictly-increasing", "drop": [], "similar": [ "minimum-operations-to-make-the-array-increasing" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 93, "kept": 84, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "0 <= grid[i][j] < 2500", "0 <= grid[i][j] < 2500" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= grid[i][j] < 2500" ] }, { "line": 34, "end_line": 34, "violates": [ "0 <= grid[i][j] < 2500" ] }, { "line": 39, "end_line": 39, "violates": [ "0 <= grid[i][j] < 2500" ] }, { "line": 49, "end_line": 49, "violates": [ "0 <= grid[i][j] < 2500" ] }, { "line": 53, "end_line": 53, "violates": [ "0 <= grid[i][j] < 2500" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= grid[i][j] < 2500" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= grid[i][j] < 2500" ] }, { "line": 92, "end_line": 92, "violates": [ "0 <= grid[i][j] < 2500", "0 <= grid[i][j] < 2500" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "grid[i + 1][j] must be at least equal to grid[i][j] + 1.", "Iterate on i in increasing order, and set grid[i + 1][j] = max(grid[i][j]+1, grid[i + 1][j])." ] }, { "question_id": 3403, "task_id": "find-the-lexicographically-largest-string-from-the-box-i", "drop": [], "similar": [ "last-substring-in-lexicographical-order", "construct-the-lexicographically-largest-valid-sequence" ], "flags": [], "comparison": "exact", "parameter_names": [ "word", "numFriends" ], "tests": { "total": 93, "kept": 92, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 62, "end_line": 62, "violates": [ "1 <= numFriends <= word.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Find lexicographically largest substring of size n - numFriends + 1 or less starting at every index." ] }, { "question_id": 3404, "task_id": "count-special-subsequences", "drop": [], "similar": [ "max-points-on-a-line" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 127, "kept": 108, "dropped": { "constraint_violation": 19 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= nums[i] <= 1000", "1 <= nums[i] <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= nums[i] <= 1000", "1 <= nums[i] <= 1000" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 117, "end_line": 117, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 128, "end_line": 128, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Count pairs where nums[p] / nums[q] equals nums[s] / nums[r], using GCD to handle ratios efficiently.", "Try iterating over (p, q) pairs and efficiently count valid (r, s) pairs with the same ratio." ] }, { "question_id": 3405, "task_id": "count-the-number-of-arrays-with-k-matching-adjacent-elements", "drop": [ "too_few_tests" ], "similar": [ "count-good-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "m", "k" ], "tests": { "total": 1, "kept": 0, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "0 <= k <= n - 1" ] } ], "unchecked_constraints": [] }, { "question_id": 3406, "task_id": "find-the-lexicographically-largest-string-from-the-box-ii", "drop": [ "premium" ] }, { "question_id": 3407, "task_id": "substring-matching-pattern", "drop": [], "similar": [ "wildcard-matching" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "p" ], "tests": { "total": 209, "kept": 78, "dropped": { "constraint_violation": 131 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 3, "end_line": 3, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 12, "end_line": 12, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 15, "end_line": 15, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 16, "end_line": 16, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 17, "end_line": 17, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 18, "end_line": 18, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 20, "end_line": 20, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 21, "end_line": 21, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 23, "end_line": 23, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 24, "end_line": 24, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 28, "end_line": 28, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 29, "end_line": 29, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 30, "end_line": 30, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 31, "end_line": 31, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 32, "end_line": 32, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 33, "end_line": 33, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 39, "end_line": 39, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 40, "end_line": 40, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 41, "end_line": 41, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 43, "end_line": 43, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 44, "end_line": 44, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 46, "end_line": 46, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 47, "end_line": 47, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 48, "end_line": 48, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 49, "end_line": 49, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 51, "end_line": 51, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 52, "end_line": 52, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 53, "end_line": 53, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 54, "end_line": 54, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 55, "end_line": 55, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 56, "end_line": 56, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 57, "end_line": 57, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 59, "end_line": 59, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 60, "end_line": 60, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 61, "end_line": 61, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 63, "end_line": 63, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 64, "end_line": 64, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 65, "end_line": 65, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 68, "end_line": 68, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 69, "end_line": 69, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 70, "end_line": 70, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 73, "end_line": 73, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 76, "end_line": 76, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 77, "end_line": 77, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 78, "end_line": 78, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 79, "end_line": 79, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 80, "end_line": 80, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 84, "end_line": 84, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 85, "end_line": 85, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 87, "end_line": 87, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 88, "end_line": 88, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 90, "end_line": 90, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 91, "end_line": 91, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 92, "end_line": 92, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 93, "end_line": 93, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 94, "end_line": 94, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 95, "end_line": 95, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 96, "end_line": 96, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 97, "end_line": 97, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 98, "end_line": 98, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 99, "end_line": 99, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 100, "end_line": 100, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 101, "end_line": 101, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 102, "end_line": 102, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 106, "end_line": 106, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 107, "end_line": 107, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 108, "end_line": 108, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 109, "end_line": 109, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 110, "end_line": 110, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 111, "end_line": 111, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 112, "end_line": 112, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 114, "end_line": 114, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 116, "end_line": 116, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 117, "end_line": 117, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 118, "end_line": 118, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 119, "end_line": 119, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 120, "end_line": 120, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 122, "end_line": 122, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 123, "end_line": 123, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 124, "end_line": 124, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 126, "end_line": 126, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 127, "end_line": 127, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 128, "end_line": 128, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 130, "end_line": 130, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 131, "end_line": 131, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 132, "end_line": 132, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 133, "end_line": 133, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 139, "end_line": 139, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 141, "end_line": 141, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 144, "end_line": 144, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 145, "end_line": 145, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 146, "end_line": 146, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 149, "end_line": 149, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 151, "end_line": 151, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 153, "end_line": 153, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 154, "end_line": 154, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 155, "end_line": 155, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 156, "end_line": 156, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 157, "end_line": 157, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 158, "end_line": 158, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 159, "end_line": 159, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 160, "end_line": 160, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 161, "end_line": 161, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 162, "end_line": 162, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 163, "end_line": 163, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 167, "end_line": 167, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 168, "end_line": 168, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 170, "end_line": 170, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 172, "end_line": 172, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 174, "end_line": 174, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 176, "end_line": 176, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 178, "end_line": 178, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 180, "end_line": 180, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 181, "end_line": 181, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 184, "end_line": 184, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 185, "end_line": 185, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 186, "end_line": 186, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 187, "end_line": 187, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 188, "end_line": 188, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 189, "end_line": 189, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 196, "end_line": 196, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 197, "end_line": 197, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 199, "end_line": 199, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 200, "end_line": 200, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 205, "end_line": 205, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 206, "end_line": 206, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 207, "end_line": 207, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 208, "end_line": 208, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 209, "end_line": 209, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] }, { "line": 210, "end_line": 210, "violates": [ "p contains only lowercase English letters and exactly one '*'" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Divide the pattern in two strings and search in the string." ] }, { "question_id": 3409, "task_id": "longest-subsequence-with-decreasing-adjacent-difference", "drop": [], "similar": [ "longest-increasing-subsequence", "longest-increasing-subsequence-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 121, "kept": 112, "dropped": { "constraint_violation": 9 } }, "dropped_tests": [ { "line": 30, "end_line": 30, "violates": [ "1 <= nums[i] <= 300" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 300" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 300" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 300" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 300" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 300" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 300" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 300" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= nums[i] <= 300" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming.", "Store the maximum answer for each index and every possible difference." ] }, { "question_id": 3410, "task_id": "maximize-subarray-sum-after-removing-all-occurrences-of-one-element", "drop": [], "similar": [ "maximum-subarray", "maximum-subarray-sum-with-one-deletion" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 140, "kept": 138, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 61, "end_line": 61, "violates": [ "-10**(6) <= nums[i] <= 10**(6)" ] }, { "line": 109, "end_line": 109, "violates": [ "-10**(6) <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a segment tree data structure to solve the problem.", "Each node of the segment tree should store the subarray sum, the maximum subarray sum, the maximum prefix sum, and the maximum suffix sum within the subarray defined by that node." ] }, { "question_id": 3411, "task_id": "maximum-subarray-with-equal-products", "drop": [], "similar": [ "find-greatest-common-divisor-of-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 126, "kept": 47, "dropped": { "constraint_violation": 79 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 6, "end_line": 6, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 8, "end_line": 8, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 12, "end_line": 12, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 21, "end_line": 21, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 33, "end_line": 33, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 36, "end_line": 36, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 37, "end_line": 37, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 38, "end_line": 38, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 42, "end_line": 42, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 48, "end_line": 48, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 52, "end_line": 52, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 54, "end_line": 54, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 56, "end_line": 56, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 74, "end_line": 74, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 82, "end_line": 82, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 84, "end_line": 84, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 93, "end_line": 93, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 96, "end_line": 96, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 101, "end_line": 101, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 103, "end_line": 103, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 105, "end_line": 105, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 106, "end_line": 106, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 109, "end_line": 109, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 110, "end_line": 110, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 113, "end_line": 113, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 114, "end_line": 114, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 115, "end_line": 115, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 116, "end_line": 116, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 120, "end_line": 120, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 121, "end_line": 121, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 122, "end_line": 122, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 124, "end_line": 124, "violates": [ "1 <= nums[i] <= 10", "1 <= nums[i] <= 10" ] }, { "line": 126, "end_line": 126, "violates": [ "1 <= nums[i] <= 10" ] }, { "line": 127, "end_line": 127, "violates": [ "1 <= nums[i] <= 10" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "What is the maximum possible lcm?" ] }, { "question_id": 3412, "task_id": "find-mirror-score-of-a-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 74, "kept": 74, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Create a stack for every character.", "For each index, check if the stack for mirror of the letter at that index is empty." ] }, { "question_id": 3413, "task_id": "maximum-coins-from-k-consecutive-bags", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "coins", "k" ], "tests": { "total": 115, "kept": 112, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 35, "end_line": 35, "violates": [ "1 <= li <= ri <= 10**(9)" ] }, { "line": 88, "end_line": 88, "violates": [ "The given segments are non-overlapping." ] }, { "line": 107, "end_line": 107, "violates": [ "1 <= ci <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "An optimal starting position for k consecutive bags will be either l_i or r_i - k + 1." ] }, { "question_id": 3416, "task_id": "subsequences-with-a-unique-middle-mode-ii", "drop": [ "premium" ] }, { "question_id": 3417, "task_id": "zigzag-grid-traversal-with-skip", "drop": [], "similar": [ "binary-tree-zigzag-level-order-traversal", "longest-zigzag-path-in-a-binary-tree" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 71, "kept": 67, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 18, "end_line": 18, "violates": [ "1 <= grid[i][j] <= 2500" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= grid[i][j] <= 2500" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= grid[i][j] <= 2500" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= grid[i][j] <= 2500" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [] }, { "question_id": 3418, "task_id": "maximum-amount-of-money-robot-can-earn", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "coins" ], "tests": { "total": 85, "kept": 72, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 17, "end_line": 17, "violates": [ "-1000 <= coins[i][j] <= 1000" ] }, { "line": 35, "end_line": 35, "violates": [ "-1000 <= coins[i][j] <= 1000" ] }, { "line": 37, "end_line": 37, "violates": [ "-1000 <= coins[i][j] <= 1000" ] }, { "line": 39, "end_line": 39, "violates": [ "-1000 <= coins[i][j] <= 1000" ] }, { "line": 43, "end_line": 43, "violates": [ "-1000 <= coins[i][j] <= 1000" ] }, { "line": 44, "end_line": 44, "violates": [ "-1000 <= coins[i][j] <= 1000" ] }, { "line": 46, "end_line": 46, "violates": [ "-1000 <= coins[i][j] <= 1000" ] }, { "line": 59, "end_line": 59, "violates": [ "-1000 <= coins[i][j] <= 1000" ] }, { "line": 64, "end_line": 64, "violates": [ "-1000 <= coins[i][j] <= 1000" ] }, { "line": 65, "end_line": 65, "violates": [ "-1000 <= coins[i][j] <= 1000" ] }, { "line": 67, "end_line": 67, "violates": [ "-1000 <= coins[i][j] <= 1000" ] }, { "line": 74, "end_line": 74, "violates": [ "-1000 <= coins[i][j] <= 1000" ] }, { "line": 85, "end_line": 85, "violates": [ "-1000 <= coins[i][j] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use Dynamic Programming.", "Let dp[i][j][k] denote the maximum amount of money a robot can earn by starting at cell (i,j) and having neutralized k robbers." ] }, { "question_id": 3419, "task_id": "minimize-the-maximum-edge-weight-of-graph", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "n", "edges", "threshold" ], "tests": { "total": 83, "kept": 83, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Can we use binary search?", "Invert the edges in the graph." ] }, { "question_id": 3420, "task_id": "count-non-decreasing-subarrays-after-k-operations", "drop": [], "similar": [ "non-decreasing-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 135, "kept": 122, "dropped": { "constraint_violation": 13 } }, "dropped_tests": [ { "line": 14, "end_line": 14, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 47, "end_line": 47, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 57, "end_line": 57, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= k <= 10**(9)", "1 <= k <= 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 87, "end_line": 87, "violates": [ "1 <= nums[i] <= 10**(9)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 100, "end_line": 100, "violates": [ "1 <= k <= 10**(9)", "1 <= k <= 10**(9)" ] }, { "line": 118, "end_line": 118, "violates": [ "1 <= k <= 10**(9)" ] }, { "line": 130, "end_line": 130, "violates": [ "1 <= k <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a sparse table.", "Compute sp[e][i] = [lastElement, operations] where operations is the number of operations required to make the subarray nums[i...i + 2^e - 1] non-decreasing, and lastElement be the value of the last element after the operations were applied on it.", "How can we combine sp[a][i] with sp[b][i + 2^a] to find the answer for the subarray nums[i...i + 2^a + 2^b - 1]?" ] }, { "question_id": 3422, "task_id": "minimum-operations-to-make-subarray-elements-equal", "drop": [ "premium" ] }, { "question_id": 3423, "task_id": "maximum-difference-between-adjacent-elements-in-a-circular-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 120, "kept": 116, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 64, "end_line": 64, "violates": [ "2 <= nums.length <= 100" ] }, { "line": 68, "end_line": 68, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 92, "end_line": 92, "violates": [ "-100 <= nums[i] <= 100" ] }, { "line": 113, "end_line": 113, "violates": [ "-100 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Traverse from the second element to the last element and check the difference of every adjacent pair.", "The edge case is to check the difference between the first and last elements." ] }, { "question_id": 3424, "task_id": "minimum-cost-to-make-arrays-identical", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "arr", "brr", "k" ], "tests": { "total": 126, "kept": 125, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 120, "end_line": 120, "violates": [ "-10**(5) <= arr[i] <= 10**(5)", "-10**(5) <= brr[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What does Operation 1 (rearranging subarrays) actually accomplish?", "Calculate sum(abs(arr[i] - brr[i])) if you do not use Operation 1.", "Calculate sum(abs(arr[i] - brr[i])) after sorting both arrays if you use Operation 1." ] }, { "question_id": 3425, "task_id": "longest-special-path", "drop": [ "figure_reference" ], "similar": [ "frog-position-after-t-seconds", "longest-special-path-ii" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "edges", "nums" ], "tests": { "total": 70, "kept": 69, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "nums.length == n", "The input is generated such that edges represents a valid tree." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use DFS to traverse the tree and maintain the current path length from the root (starting at 0) to the current node.", "Use prefix sums to calculate the longest path ending at the current node with all unique values." ] }, { "question_id": 3426, "task_id": "manhattan-distances-of-all-arrangements-of-pieces", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "m", "n", "k" ], "tests": { "total": 89, "kept": 89, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Fix two pieces in two specific locations and find the number of boards where this can happen.", "A particular pair of positions will be counted exactly C(m * n - 2, k - 2) times. Calculate the total distance for all pairs of positions and multiply it with C(m * n - 2, k - 2)." ] }, { "question_id": 3427, "task_id": "sum-of-variable-length-subarrays", "drop": [], "similar": [ "range-sum-query-immutable", "maximum-sum-of-3-non-overlapping-subarrays" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 94, "kept": 90, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 65, "end_line": 65, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 71, "end_line": 71, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "The constraints are small, so brute force for each index." ] }, { "question_id": 3428, "task_id": "maximum-and-minimum-sums-of-at-most-size-k-subsequences", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 107, "kept": 96, "dropped": { "constraint_violation": 11 } }, "dropped_tests": [ { "line": 43, "end_line": 43, "violates": [ "1 <= k <= min(70, nums.length)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= k <= min(70, nums.length)" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= k <= min(70, nums.length)" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= k <= min(70, nums.length)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= k <= min(70, nums.length)" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= k <= min(70, nums.length)" ] }, { "line": 73, "end_line": 73, "violates": [ "1 <= k <= min(70, nums.length)" ] }, { "line": 81, "end_line": 81, "violates": [ "1 <= k <= min(70, nums.length)" ] }, { "line": 88, "end_line": 88, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= nums[i] <= 10**(9)" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= k <= min(70, nums.length)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort the array." ] }, { "question_id": 3429, "task_id": "paint-house-iv", "drop": [], "similar": [ "paint-house-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "cost" ], "tests": { "total": 91, "kept": 91, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use dynamic programming to calculate the minimum cost while ensuring that the adjacency and equidistant constraints are satisfied.", "Try all 9 combinations of colors for equidistant pairs to get the minimum cost." ] }, { "question_id": 3431, "task_id": "minimum-unlocked-indices-to-sort-nums", "drop": [ "premium" ] }, { "question_id": 3432, "task_id": "count-partitions-with-even-sum-difference", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 92, "kept": 77, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 13, "end_line": 13, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 15, "end_line": 15, "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" ] }, { "line": 18, "end_line": 18, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 32, "end_line": 32, "violates": [ "2 <= n == nums.length <= 100" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 53, "end_line": 53, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 77, "end_line": 77, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= nums[i] <= 100" ] }, { "line": 88, "end_line": 88, "violates": [ "2 <= n == nums.length <= 100" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= nums[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If the parity of the sum is even, the partition is valid; otherwise, there is no partition." ] }, { "question_id": 3433, "task_id": "count-mentions-per-user", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "numberOfUsers", "events" ], "tests": { "total": 70, "kept": 70, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Sort events by timestamp and then process each event.", "Maintain two sets for offline and online user IDs." ] }, { "question_id": 3434, "task_id": "maximum-frequency-after-subarray-operation", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 132, "kept": 118, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 23, "end_line": 23, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 51, "end_line": 51, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= k <= 50" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 64, "end_line": 64, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50" ] }, { "line": 90, "end_line": 90, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50", "1 <= k <= 50", "1 <= k <= 50" ] }, { "line": 95, "end_line": 95, "violates": [ "1 <= nums[i] <= 50", "1 <= k <= 50" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 50", "1 <= nums[i] <= 50", "1 <= k <= 50", "1 <= k <= 50" ] }, { "line": 108, "end_line": 108, "violates": [ "1 <= nums[i] <= 50" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= nums[i] <= 50", "1 <= k <= 50" ] }, { "line": 130, "end_line": 130, "violates": [ "1 <= k <= 50" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Fix the element you want to convert to k.", "Use prefix sums to optimize counting occurrences of an element." ] }, { "question_id": 3435, "task_id": "frequencies-of-shortest-supersequences", "drop": [], "similar": [], "flags": [ "any_order" ], "comparison": "unordered", "parameter_names": [ "words" ], "tests": { "total": 146, "kept": 117, "dropped": { "constraint_violation": 29 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "All strings in words will altogether be composed of no more than 16 unique lowercase letters." ] }, { "line": 23, "end_line": 23, "violates": [ "words[i].length == 2" ] }, { "line": 25, "end_line": 25, "violates": [ "words[i].length == 2" ] }, { "line": 29, "end_line": 29, "violates": [ "words[i].length == 2" ] }, { "line": 30, "end_line": 30, "violates": [ "All strings in words will altogether be composed of no more than 16 unique lowercase letters." ] }, { "line": 34, "end_line": 34, "violates": [ "All strings in words are unique." ] }, { "line": 35, "end_line": 35, "violates": [ "All strings in words are unique." ] }, { "line": 36, "end_line": 36, "violates": [ "All strings in words will altogether be composed of no more than 16 unique lowercase letters." ] }, { "line": 37, "end_line": 37, "violates": [ "words[i].length == 2" ] }, { "line": 38, "end_line": 38, "violates": [ "words[i].length == 2" ] }, { "line": 39, "end_line": 39, "violates": [ "All strings in words are unique." ] }, { "line": 43, "end_line": 43, "violates": [ "All strings in words are unique." ] }, { "line": 44, "end_line": 44, "violates": [ "All strings in words are unique." ] }, { "line": 47, "end_line": 47, "violates": [ "words[i].length == 2" ] }, { "line": 48, "end_line": 48, "violates": [ "All strings in words are unique." ] }, { "line": 49, "end_line": 49, "violates": [ "words[i].length == 2" ] }, { "line": 53, "end_line": 53, "violates": [ "words[i].length == 2" ] }, { "line": 54, "end_line": 54, "violates": [ "words[i].length == 2" ] }, { "line": 56, "end_line": 56, "violates": [ "All strings in words are unique." ] }, { "line": 57, "end_line": 57, "violates": [ "words[i].length == 2" ] }, { "line": 59, "end_line": 59, "violates": [ "words[i].length == 2", "All strings in words are unique." ] }, { "line": 60, "end_line": 60, "violates": [ "words[i].length == 2" ] }, { "line": 61, "end_line": 61, "violates": [ "words[i].length == 2" ] }, { "line": 66, "end_line": 66, "violates": [ "words[i].length == 2" ] }, { "line": 70, "end_line": 70, "violates": [ "words[i].length == 2" ] }, { "line": 71, "end_line": 71, "violates": [ "words[i].length == 2" ] }, { "line": 73, "end_line": 73, "violates": [ "words[i].length == 2" ] }, { "line": 75, "end_line": 75, "violates": [ "words[i].length == 2" ] }, { "line": 140, "end_line": 140, "violates": [ "All strings in words are unique." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Each SCS contains at most 2 occurrences of each character. Why?", "Construct every subset of possible characters (1 or 2).", "Check if a supersequence could be constructed using Topological Sort." ] }, { "question_id": 3437, "task_id": "permutations-iii", "drop": [ "premium" ] }, { "question_id": 3438, "task_id": "find-valid-pair-of-adjacent-digits-in-string", "drop": [], "similar": [ "majority-element", "contains-duplicate" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 166, "kept": 164, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 69, "end_line": 69, "violates": [ "s only consists of digits from '1' to '9'." ] }, { "line": 123, "end_line": 123, "violates": [ "2 <= s.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a HashMap to count the frequency of each digit." ] }, { "question_id": 3439, "task_id": "reschedule-meetings-for-maximum-free-time-i", "drop": [], "similar": [ "meeting-scheduler" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "eventTime", "k", "startTime", "endTime" ], "tests": { "total": 84, "kept": 72, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 8, "end_line": 8, "violates": [ "endTime[i] <= startTime[i + 1] where i lies in the range [0, n - 2]." ] }, { "line": 25, "end_line": 25, "violates": [ "endTime[i] <= startTime[i + 1] where i lies in the range [0, n - 2]." ] }, { "line": 34, "end_line": 34, "violates": [ "endTime[i] <= startTime[i + 1] where i lies in the range [0, n - 2]." ] }, { "line": 41, "end_line": 41, "violates": [ "1 <= k <= n" ] }, { "line": 51, "end_line": 51, "violates": [ "endTime[i] <= startTime[i + 1] where i lies in the range [0, n - 2]." ] }, { "line": 56, "end_line": 56, "violates": [ "n == startTime.length == endTime.length" ] }, { "line": 60, "end_line": 60, "violates": [ "n == startTime.length == endTime.length" ] }, { "line": 65, "end_line": 65, "violates": [ "endTime[i] <= startTime[i + 1] where i lies in the range [0, n - 2]." ] }, { "line": 76, "end_line": 76, "violates": [ "endTime[i] <= startTime[i + 1] where i lies in the range [0, n - 2]." ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= startTime[i] < endTime[i] <= eventTime" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= k <= n" ] }, { "line": 85, "end_line": 85, "violates": [ "1 <= k <= n" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "In a sequence of K meetings and K + 1 gaps, you could move all meetings to the start of the sequence to get the max free time.", "Use a sliding window of K + 1 size to store sum of gaps and take the maximum." ] }, { "question_id": 3440, "task_id": "reschedule-meetings-for-maximum-free-time-ii", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "eventTime", "startTime", "endTime" ], "tests": { "total": 114, "kept": 110, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 56, "end_line": 56, "violates": [ "endTime[i] <= startTime[i + 1] where i lies in the range [0, n - 2]." ] }, { "line": 60, "end_line": 60, "violates": [ "endTime[i] <= startTime[i + 1] where i lies in the range [0, n - 2]." ] }, { "line": 73, "end_line": 73, "violates": [ "endTime[i] <= startTime[i + 1] where i lies in the range [0, n - 2]." ] }, { "line": 92, "end_line": 92, "violates": [ "endTime[i] <= startTime[i + 1] where i lies in the range [0, n - 2]." ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "If we reschedule a meeting earlier or later, we need to find a gap of length at least endTime[i] - startTime[i]. Try maintaining the gaps in some sorted data structure." ] }, { "question_id": 3441, "task_id": "minimum-cost-good-caption", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "caption" ], "tests": { "total": 80, "kept": 80, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Construct a DP table and try all possible characters at every index.", "Choose characters greedily to get the lexicographically smallest caption." ] }, { "question_id": 3442, "task_id": "maximum-difference-between-even-and-odd-frequency-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 49, "kept": 28, "dropped": { "constraint_violation": 21 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 3, "end_line": 3, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 4, "end_line": 4, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 5, "end_line": 5, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 7, "end_line": 7, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 10, "end_line": 10, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 13, "end_line": 13, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 17, "end_line": 17, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 18, "end_line": 18, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 20, "end_line": 20, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 21, "end_line": 21, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 23, "end_line": 23, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 24, "end_line": 24, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 25, "end_line": 25, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 27, "end_line": 27, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 28, "end_line": 28, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 37, "end_line": 37, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 39, "end_line": 39, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 45, "end_line": 45, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 48, "end_line": 48, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] }, { "line": 50, "end_line": 50, "violates": [ "s contains at least one character with an odd frequency and one with an even frequency." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a frequency map to identify the maximum odd and minimum even frequencies. Then, calculate their difference." ] }, { "question_id": 3443, "task_id": "maximum-manhattan-distance-after-k-changes", "drop": [], "similar": [ "as-far-from-land-as-possible", "maximum-manhattan-distance-after-all-moves" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 108, "kept": 106, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 69, "end_line": 69, "violates": [ "0 <= k <= s.length" ] }, { "line": 79, "end_line": 79, "violates": [ "0 <= k <= s.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "We can brute force all the possible directions (NE, NW, SE, SW).", "Change up to k characters to maximize the distance in the chosen direction." ] }, { "question_id": 3444, "task_id": "minimum-increments-for-target-multiples-in-an-array", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "target" ], "tests": { "total": 159, "kept": 157, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 71, "end_line": 71, "violates": [ "1 <= target.length <= 4" ] }, { "line": 144, "end_line": 144, "violates": [ "1 <= target.length <= 4" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use bitmask dynamic programming." ] }, { "question_id": 3445, "task_id": "maximum-difference-between-even-and-odd-frequency-ii", "drop": [], "similar": [ "frequency-of-the-most-frequent-element", "count-elements-with-maximum-frequency" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 137, "kept": 105, "dropped": { "non_finite": 24, "constraint_violation": 8 } }, "dropped_tests": [ { "line": 2, "end_line": 2, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 7, "end_line": 7, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 8, "end_line": 8, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 13, "end_line": 13, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 15, "end_line": 15, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 17, "end_line": 17, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 18, "end_line": 18, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 19, "end_line": 19, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 20, "end_line": 20, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 21, "end_line": 21, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 23, "end_line": 23, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 29, "end_line": 29, "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": 33, "end_line": 33, "violates": [ "s consists only of digits '0' to '4'." ] }, { "line": 39, "end_line": 39, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 45, "end_line": 45, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 47, "end_line": 47, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 49, "end_line": 49, "violates": [ "s consists only of digits '0' to '4'." ] }, { "line": 53, "end_line": 53, "violates": [ "s consists only of digits '0' to '4'." ] }, { "line": 55, "end_line": 55, "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": 64, "end_line": 64, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 66, "end_line": 66, "violates": [ "s consists only of digits '0' to '4'." ] }, { "line": 72, "end_line": 72, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 77, "end_line": 77, "violates": [ "s consists only of digits '0' to '4'." ] }, { "line": 85, "end_line": 85, "violates": [ "s consists only of digits '0' to '4'." ] }, { "line": 102, "end_line": 102, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 111, "end_line": 111, "violates": [ "s consists only of digits '0' to '4'." ] }, { "line": 112, "end_line": 112, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] }, { "line": 124, "end_line": 124, "violates": [ "s consists only of digits '0' to '4'." ] }, { "line": 127, "end_line": 127, "unrepresentable_in": [ "python", "cpp", "rust", "javascript", "typescript", "go", "java", "php", "ruby" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Fix the two characters.", "Use prefix sum (maintain 2 characters' parities as status)." ] }, { "question_id": 3446, "task_id": "sort-matrix-by-diagonals", "drop": [], "similar": [ "sort-the-matrix-diagonally" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 79, "kept": 79, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use a data structure to store all values in each diagonal.", "Sort and replace them in the matrix." ] }, { "question_id": 3447, "task_id": "assign-elements-to-groups-with-constraints", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "groups", "elements" ], "tests": { "total": 139, "kept": 137, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 55, "end_line": 55, "violates": [ "1 <= groups[i] <= 10**(5)" ] }, { "line": 123, "end_line": 123, "violates": [ "1 <= groups[i] <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can a sieve-like approach be applied here?", "Starting from the smallest index, iterate through the multiples of the element and assign it to groups divisible by that value.", "Process each element once.", "Find all divisors of each group, then match them with elements." ] }, { "question_id": 3448, "task_id": "count-substrings-divisible-by-last-digit", "drop": [], "similar": [ "number-of-divisible-substrings" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 113, "kept": 113, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Let dp[index][i][j] be the number of subarrays s[start...index] such that s[start...index] % i == j.", "For every pair (i, j), add dp[index - 1][i][j] to dp[index][i][(j * 10 + x)%i)].", "You should optimize this solution so that it can fit into the memory limit.", "In order to find dp[index][i][j] we use values from dp[index - 1][i][j]. Hence, we can keep only dp[index][i][j] and dp[index - 1][i][j] at every iteration of the loop." ] }, { "question_id": 3449, "task_id": "maximize-the-minimum-game-score", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "points", "m" ], "tests": { "total": 95, "kept": 94, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 82, "end_line": 82, "violates": [ "1 <= points[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use binary search?", "What happens if you fix the game score as x?", "We should go from i to (i + 1) back and forth, making the value for each index i (from left to right) no less than x." ] }, { "question_id": 3450, "task_id": "maximum-students-on-a-single-bench", "drop": [ "premium" ] }, { "question_id": 3452, "task_id": "sum-of-good-numbers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 109, "kept": 104, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 59, "end_line": 59, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For each index, check if nums[i] is strictly greater than nums[i - k] and nums[i + k]." ] }, { "question_id": 3453, "task_id": "separate-squares-i", "drop": [], "similar": [], "flags": [ "decimal_answer", "has_images" ], "comparison": "float", "parameter_names": [ "squares" ], "tests": { "total": 107, "kept": 101, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "The total area of all the squares will not exceed 10**(12)." ] }, { "line": 39, "end_line": 39, "violates": [ "The total area of all the squares will not exceed 10**(12)." ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= xi, yi <= 10**(9)", "The total area of all the squares will not exceed 10**(12)." ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= li <= 10**(9)" ] }, { "line": 77, "end_line": 77, "violates": [ "The total area of all the squares will not exceed 10**(12)." ] }, { "line": 98, "end_line": 98, "violates": [ "The total area of all the squares will not exceed 10**(12)." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Binary search on the answer." ] }, { "question_id": 3454, "task_id": "separate-squares-ii", "drop": [], "similar": [ "rectangle-area-ii" ], "flags": [ "decimal_answer", "has_images" ], "comparison": "float", "parameter_names": [ "squares" ], "tests": { "total": 103, "kept": 100, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 27, "end_line": 27, "violates": [ "1 <= li <= 10**(9)" ] }, { "line": 62, "end_line": 62, "violates": [ "The total area of all the squares will not exceed 10**(15)." ] }, { "line": 101, "end_line": 101, "violates": [ "The total area of all the squares will not exceed 10**(15)." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a line sweep and a segment tree.", "The line must lie in one of the squares." ] }, { "question_id": 3455, "task_id": "shortest-matching-substring", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "p" ], "tests": { "total": 53, "kept": 52, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 16, "end_line": 16, "violates": [ "1 <= s.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "The pattern string p can be divided into three segments.", "Use the KMP algorithm to locate all occurrences of each segment in s." ] }, { "question_id": 3456, "task_id": "find-special-substring-of-length-k", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 111, "kept": 111, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Return true if there is a sequence of consecutive characters of length k" ] }, { "question_id": 3457, "task_id": "eat-pizzas", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "pizzas" ], "tests": { "total": 103, "kept": 89, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "n is a multiple of 4." ] }, { "line": 5, "end_line": 5, "violates": [ "n is a multiple of 4." ] }, { "line": 17, "end_line": 17, "violates": [ "n is a multiple of 4." ] }, { "line": 27, "end_line": 27, "violates": [ "n is a multiple of 4." ] }, { "line": 32, "end_line": 32, "violates": [ "n is a multiple of 4." ] }, { "line": 37, "end_line": 37, "violates": [ "n is a multiple of 4." ] }, { "line": 40, "end_line": 40, "violates": [ "1 <= pizzas[i] <= 10**(5)" ] }, { "line": 59, "end_line": 59, "violates": [ "1 <= pizzas[i] <= 10**(5)", "n is a multiple of 4." ] }, { "line": 73, "end_line": 73, "violates": [ "n is a multiple of 4." ] }, { "line": 75, "end_line": 75, "violates": [ "n is a multiple of 4.", "n is a multiple of 4." ] }, { "line": 77, "end_line": 77, "violates": [ "n is a multiple of 4." ] }, { "line": 80, "end_line": 80, "violates": [ "n is a multiple of 4.", "n is a multiple of 4." ] }, { "line": 85, "end_line": 85, "violates": [ "n is a multiple of 4." ] }, { "line": 87, "end_line": 87, "violates": [ "n is a multiple of 4." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "On odd-numbered days, it is optimal to pair the smallest three and the largest one.", "On even-numbered days, it is optimal to pair the smallest two and the largest two.", "There will be ceil((n / 4) / 2) odd-numbered days. Select pizzas for all odd-numbered days first.", "Select the remaining pizzas for the even-numbered days." ] }, { "question_id": 3458, "task_id": "select-k-disjoint-special-substrings", "drop": [], "similar": [ "find-longest-self-contained-substring" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 95, "kept": 95, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "There are at most 26 start points (which are the first occurrence of each letter) and at most 26 end points (which are the last occurrence of each letter) of the substring.", "Starting from each character, build the smallest special substring interval containing it.", "Use dynamic programming on the obtained intervals to check if it's possible to pick at least k disjoint intervals." ] }, { "question_id": 3459, "task_id": "length-of-longest-v-shaped-diagonal-segment", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "grid" ], "tests": { "total": 76, "kept": 76, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Use dynamic programming to determine the best point to make a 90-degree rotation in the diagonal path while maintaining the required sequence.", "Represent dynamic programming states as (row, col, currentDirection, hasMadeTurnYet). Track the current position, direction of traversal, and whether a turn has already been made, and take transitions accordingly to find the longest V-shaped diagonal segment." ] }, { "question_id": 3460, "task_id": "longest-common-prefix-after-at-most-one-removal", "drop": [ "premium" ] }, { "question_id": 3461, "task_id": "check-if-digits-are-equal-in-string-after-operations-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 127, "kept": 126, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 22, "end_line": 22, "violates": [ "3 <= s.length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simulate the operations as described." ] }, { "question_id": 3462, "task_id": "maximum-sum-with-at-most-k-elements", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "grid", "limits", "k" ], "tests": { "total": 90, "kept": 84, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "0 <= k <= min(n * m, sum(limits))" ] }, { "line": 21, "end_line": 21, "violates": [ "0 <= k <= min(n * m, sum(limits))" ] }, { "line": 69, "end_line": 69, "violates": [ "0 <= k <= min(n * m, sum(limits))" ] }, { "line": 70, "end_line": 70, "violates": [ "n == grid.length == limits.length", "0 <= k <= min(n * m, sum(limits))" ] }, { "line": 89, "end_line": 89, "violates": [ "0 <= k <= min(n * m, sum(limits))" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= k <= min(n * m, sum(limits))" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort each row in descending order and extract the top limits[i] elements.", "Use a max-heap to efficiently pick the largest k elements across all rows." ] }, { "question_id": 3463, "task_id": "check-if-digits-are-equal-in-string-after-operations-ii", "drop": [], "similar": [ "pascals-triangle" ], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 108, "kept": 108, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use nCr and use Pascal's triangle values here?", "nCr mod 10 can be uniquely determined from nCr mod 2 and nCr mod 5.", "Use Lucas's theorem." ] }, { "question_id": 3464, "task_id": "maximize-the-distance-between-points-on-a-square", "drop": [], "similar": [ "maximum-number-of-integers-to-choose-from-a-range-ii", "maximum-points-inside-the-square" ], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "side", "points", "k" ], "tests": { "total": 66, "kept": 36, "dropped": { "constraint_violation": 30 } }, "dropped_tests": [ { "line": 3, "end_line": 3, "violates": [ "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 4, "end_line": 4, "violates": [ "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 9, "end_line": 9, "violates": [ "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 16, "end_line": 16, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square.", "All points[i] are unique." ] }, { "line": 20, "end_line": 20, "violates": [ "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 21, "end_line": 21, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 23, "end_line": 23, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 25, "end_line": 25, "violates": [ "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 26, "end_line": 26, "violates": [ "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 27, "end_line": 27, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 28, "end_line": 28, "violates": [ "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 29, "end_line": 29, "violates": [ "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 30, "end_line": 30, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 32, "end_line": 32, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 33, "end_line": 33, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square.", "All points[i] are unique." ] }, { "line": 37, "end_line": 37, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 40, "end_line": 40, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 44, "end_line": 44, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 45, "end_line": 45, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 47, "end_line": 47, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 49, "end_line": 49, "violates": [ "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 51, "end_line": 51, "violates": [ "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 52, "end_line": 52, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 55, "end_line": 55, "violates": [ "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 57, "end_line": 57, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 58, "end_line": 58, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 60, "end_line": 60, "violates": [ "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 64, "end_line": 64, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 65, "end_line": 65, "violates": [ "The input is generated such that: points[i] lies on the boundary of the square." ] }, { "line": 67, "end_line": 67, "violates": [ "4 <= points.length <= min(4 * side, 15 * 10**(3))", "The input is generated such that: points[i] lies on the boundary of the square." ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Can we use binary search for this problem?", "Think of the coordinates on a straight line in clockwise order.", "Binary search on the minimum Manhattan distance x.", "During the binary search, for each coordinate, find the immediate next coordinate with distance >= x.", "Greedily select up to k coordinates." ] }, { "question_id": 3466, "task_id": "maximum-coin-collection", "drop": [ "premium" ] }, { "question_id": 3467, "task_id": "transform-array-by-parity", "drop": [], "similar": [ "odd-even-linked-list" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 104, "kept": 92, "dropped": { "constraint_violation": 12 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 32, "end_line": 32, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 49, "end_line": 49, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 50, "end_line": 50, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 63, "end_line": 63, "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": 86, "end_line": 86, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 91, "end_line": 91, "violates": [ "1 <= nums[i] <= 1000" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= nums[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let x be the number of even numbers, and y be the number of odd numbers. Output 0 x times, followed by 1 y times." ] }, { "question_id": 3468, "task_id": "find-the-number-of-copy-arrays", "drop": [], "similar": [ "count-of-range-sum" ], "flags": [], "comparison": "exact", "parameter_names": [ "original", "bounds" ], "tests": { "total": 106, "kept": 101, "dropped": { "constraint_violation": 5 } }, "dropped_tests": [ { "line": 25, "end_line": 25, "violates": [ "1 <= bounds[i][0] <= bounds[i][1] <= 10**(9)" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= bounds[i][0] <= bounds[i][1] <= 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= bounds[i][0] <= bounds[i][1] <= 10**(9)" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= original[i] <= 10**(9)", "1 <= bounds[i][0] <= bounds[i][1] <= 10**(9)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= original[i] <= 10**(9)", "1 <= bounds[i][0] <= bounds[i][1] <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "copy[0] uniquely determines all other values.", "Possible values for copy[0] are in [u[0], v[0]].", "From left to right, compute valid ranges for each index by intersecting bounds with the previous range.", "The answer is the size of the valid range for the last index." ] }, { "question_id": 3469, "task_id": "find-minimum-cost-to-remove-array-elements", "drop": [], "similar": [ "minimum-difference-in-sums-after-removal-of-elements" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 116, "kept": 115, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 26, "end_line": 26, "violates": [ "1 <= nums[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Can we use dynamic programming here?", "Use dynamic programming. The process guarantees that the remaining elements form a prefix of the array with at most one previous element.", "Define the state as dp[i][j], where i represents the last remaining element and j represents the starting index of the current prefix." ] }, { "question_id": 3470, "task_id": "permutations-iv", "drop": [], "similar": [ "permutations-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "n", "k" ], "tests": { "total": 97, "kept": 95, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 48, "end_line": 48, "violates": [ "1 <= k <= 10**(15)" ] }, { "line": 89, "end_line": 89, "violates": [ "1 <= k <= 10**(15)" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If n is odd, the first number must be odd.", "If n is even, the first number can be either odd or even.", "From smallest to largest, place each number and subtract the number of permutations from k.", "The number of permutations can be calculated using factorials." ] }, { "question_id": 3471, "task_id": "find-the-largest-almost-missing-integer", "drop": [], "similar": [ "missing-number" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k" ], "tests": { "total": 120, "kept": 105, "dropped": { "constraint_violation": 15 } }, "dropped_tests": [ { "line": 33, "end_line": 33, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 40, "end_line": 40, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 41, "end_line": 41, "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": [ "1 <= nums.length <= 50" ] }, { "line": 75, "end_line": 75, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 79, "end_line": 79, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= nums.length <= 50" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 91, "end_line": 91, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 93, "end_line": 93, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 94, "end_line": 94, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 99, "end_line": 99, "violates": [ "0 <= nums[i] <= 50" ] }, { "line": 114, "end_line": 114, "violates": [ "0 <= nums[i] <= 50" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Solve the problem for three different cases: k = 1, k = n, and 1 < k < n", "If k = 1, return the largest element that occurs exactly once in nums", "If k = n, return the largest element in nums", "If 1 < k < n, all elements different from nums[0] and nums[n - 1] will occur in more than one subarray of size k. Hence, the answer is the largest of nums[0] and nums[n - 1] if they both occur exactly once in the array. If one of them occurs more than once, return the other. If both of them occur more than once, return -1." ] }, { "question_id": 3472, "task_id": "longest-palindromic-subsequence-after-at-most-k-operations", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "k" ], "tests": { "total": 153, "kept": 139, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= k <= 200" ] }, { "line": 17, "end_line": 17, "violates": [ "1 <= k <= 200" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= k <= 200" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= k <= 200" ] }, { "line": 46, "end_line": 46, "violates": [ "1 <= k <= 200" ] }, { "line": 66, "end_line": 66, "violates": [ "1 <= k <= 200" ] }, { "line": 72, "end_line": 72, "violates": [ "1 <= k <= 200" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= k <= 200" ] }, { "line": 88, "end_line": 88, "violates": [ "1 <= k <= 200" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= k <= 200" ] }, { "line": 104, "end_line": 104, "violates": [ "1 <= k <= 200" ] }, { "line": 112, "end_line": 112, "violates": [ "1 <= k <= 200" ] }, { "line": 116, "end_line": 116, "violates": [ "s consists of only lowercase English letters." ] }, { "line": 146, "end_line": 146, "violates": [ "1 <= k <= 200" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use dynamic programming.", "dp[i][j][k] is the length of the longest palindromic subsequence in substring [i..j] with cost at most k.", "dp[i][j][k] = max(dp[i + 1][j][k], dp[i][j - 1][k], dp[i + 1][j - 1][k - dist(s[i], s[j])] + 2), where dist(x, y) is the minimum cyclic distance between x and y." ] }, { "question_id": 3473, "task_id": "sum-of-k-subarrays-with-length-at-least-m", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "k", "m" ], "tests": { "total": 211, "kept": 207, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 9, "end_line": 9, "violates": [ "1 <= k <= floor(nums.length / m)" ] }, { "line": 22, "end_line": 22, "violates": [ "1 <= k <= floor(nums.length / m)" ] }, { "line": 31, "end_line": 31, "violates": [ "1 <= k <= floor(nums.length / m)" ] }, { "line": 94, "end_line": 94, "violates": [ "1 <= k <= floor(nums.length / m)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Dynamic Programming", "Prefix Sum", "Let dp[i][j] be the maximum sum with i subarrays for the first j elements" ] }, { "question_id": 3474, "task_id": "lexicographically-smallest-generated-string", "drop": [], "similar": [ "lexicographically-smallest-equivalent-string" ], "flags": [], "comparison": "exact", "parameter_names": [ "str1", "str2" ], "tests": { "total": 266, "kept": 266, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Use dynamic programming.", "Fill the fixed part.", "Use KMP's next table for DP.", "The state is the prefix length and the longest suffix length that matches the pattern.", "Each unknown character can be selected from ['a', 'b'].", "Can you think of a greedy approach?" ] }, { "question_id": 3476, "task_id": "maximize-profit-from-task-assignment", "drop": [ "premium" ] }, { "question_id": 3477, "task_id": "fruits-into-baskets-ii", "drop": [], "similar": [ "fruit-into-baskets" ], "flags": [], "comparison": "exact", "parameter_names": [ "fruits", "baskets" ], "tests": { "total": 107, "kept": 100, "dropped": { "constraint_violation": 7 } }, "dropped_tests": [ { "line": 5, "end_line": 5, "violates": [ "n == fruits.length == baskets.length", "n == fruits.length == baskets.length" ] }, { "line": 37, "end_line": 37, "violates": [ "n == fruits.length == baskets.length", "n == fruits.length == baskets.length" ] }, { "line": 49, "end_line": 49, "violates": [ "n == fruits.length == baskets.length" ] }, { "line": 62, "end_line": 62, "violates": [ "n == fruits.length == baskets.length" ] }, { "line": 66, "end_line": 66, "violates": [ "n == fruits.length == baskets.length" ] }, { "line": 74, "end_line": 74, "violates": [ "n == fruits.length == baskets.length" ] }, { "line": 88, "end_line": 88, "violates": [ "n == fruits.length == baskets.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simulate the operations for each fruit as described" ] }, { "question_id": 3478, "task_id": "choose-k-elements-with-maximum-sum", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums1", "nums2", "k" ], "tests": { "total": 110, "kept": 106, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(6)" ] }, { "line": 28, "end_line": 28, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(6)" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(6)" ] }, { "line": 97, "end_line": 97, "violates": [ "1 <= nums1[i], nums2[i] <= 10**(6)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort nums1 and its corresponding nums2 values together based on nums1.", "Use a max heap to track the top k values of nums2 as you process each element in the sorted order." ] }, { "question_id": 3479, "task_id": "fruits-into-baskets-iii", "drop": [], "similar": [ "block-placement-queries" ], "flags": [], "comparison": "exact", "parameter_names": [ "fruits", "baskets" ], "tests": { "total": 101, "kept": 100, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 73, "end_line": 73, "violates": [ "n == fruits.length == baskets.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Sort the baskets by the pair of (basket[i], i) in the array.", "For each fruit from left to right, use binary search to find the first index in the sorted array such that basket[i] >= fruit.", "Use a segment tree to maintain the smallest original indices where basket[i] >= fruit.", "When a valid index is found, set the corresponding point to infinity to mark it as used." ] }, { "question_id": 3480, "task_id": "maximize-subarrays-after-removing-one-conflicting-pair", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "conflictingPairs" ], "tests": { "total": 72, "kept": 68, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 20, "end_line": 20, "violates": [ "conflictingPairs[i][0] != conflictingPairs[i][1]" ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= conflictingPairs.length <= 2 * n" ] }, { "line": 44, "end_line": 44, "violates": [ "1 <= conflictingPairs.length <= 2 * n" ] }, { "line": 62, "end_line": 62, "violates": [ "1 <= conflictingPairs.length <= 2 * n" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Let f[i] (where i = 1, 2, 3, ..., n) be the end index of the longest valid subarray (without any conflicting pair) starting at index i.", "The answer is: sigma(f[i] - i + 1) for i in [1..n], which simplifies to: sigma(f[i]) - n * (n + 1) / 2 + n.", "Focus on maintaining f[i].", "If we have a conflicting pair (x, y) with x < y: 1. Sort the conflicting pairs by y values in non-increasing order. 2. Update each prefix of the f array accordingly.", "Use a segment tree or another suitable data structure to maintain the range update and sum query efficiently." ] }, { "question_id": 3481, "task_id": "apply-substitutions", "drop": [ "premium" ] }, { "question_id": 3483, "task_id": "unique-3-digit-even-numbers", "drop": [], "similar": [ "finding-3-digit-even-numbers" ], "flags": [], "comparison": "exact", "parameter_names": [ "digits" ], "tests": { "total": 128, "kept": 101, "dropped": { "constraint_violation": 27 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "3 <= digits.length <= 10", "3 <= digits.length <= 10" ] }, { "line": 33, "end_line": 33, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 35, "end_line": 35, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 38, "end_line": 38, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 42, "end_line": 42, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 44, "end_line": 44, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 47, "end_line": 47, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 54, "end_line": 54, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 56, "end_line": 56, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 57, "end_line": 57, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 60, "end_line": 60, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 62, "end_line": 62, "violates": [ "3 <= digits.length <= 10", "3 <= digits.length <= 10" ] }, { "line": 64, "end_line": 64, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 65, "end_line": 65, "violates": [ "3 <= digits.length <= 10", "3 <= digits.length <= 10" ] }, { "line": 67, "end_line": 67, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 68, "end_line": 68, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 77, "end_line": 77, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 86, "end_line": 86, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 92, "end_line": 92, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 98, "end_line": 98, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 103, "end_line": 103, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 109, "end_line": 109, "violates": [ "3 <= digits.length <= 10", "3 <= digits.length <= 10" ] }, { "line": 110, "end_line": 110, "violates": [ "3 <= digits.length <= 10", "3 <= digits.length <= 10" ] }, { "line": 115, "end_line": 115, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 122, "end_line": 122, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 123, "end_line": 123, "violates": [ "3 <= digits.length <= 10" ] }, { "line": 125, "end_line": 125, "violates": [ "3 <= digits.length <= 10", "3 <= digits.length <= 10" ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Use brute force to try all possibilities" ] }, { "question_id": 3485, "task_id": "longest-common-prefix-of-k-strings-after-removal", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "words", "k" ], "tests": { "total": 196, "kept": 195, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 169, "end_line": 169, "violates": [ "1 <= words[i].length <= 10**(4)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a trie to store all the strings initially.", "For each node in the trie, maintain the count of paths ending there.", "For each arr[i], remove it from the trie and update the counts.", "During evaluation, find the innermost node with at least k paths ending there.", "Use a multiset or similar structure to handle updates efficiently." ] }, { "question_id": 3486, "task_id": "longest-special-path-ii", "drop": [ "figure_reference" ], "similar": [ "longest-special-path" ], "flags": [ "figure_reference", "has_images" ], "comparison": "exact", "parameter_names": [ "edges", "nums" ], "tests": { "total": 41, "kept": 31, "dropped": { "constraint_violation": 10 } }, "dropped_tests": [ { "line": 11, "end_line": 11, "violates": [ "nums.length == n", "The input is generated such that edges represents a valid tree." ] }, { "line": 12, "end_line": 12, "violates": [ "nums.length == n", "The input is generated such that edges represents a valid tree." ] }, { "line": 13, "end_line": 13, "violates": [ "nums.length == n", "The input is generated such that edges represents a valid tree." ] }, { "line": 18, "end_line": 18, "violates": [ "nums.length == n", "The input is generated such that edges represents a valid tree." ] }, { "line": 20, "end_line": 20, "violates": [ "nums.length == n", "The input is generated such that edges represents a valid tree." ] }, { "line": 26, "end_line": 26, "violates": [ "nums.length == n", "The input is generated such that edges represents a valid tree." ] }, { "line": 29, "end_line": 29, "violates": [ "1 <= lengthi <= 10**(3)", "nums.length == n", "The input is generated such that edges represents a valid tree." ] }, { "line": 31, "end_line": 31, "violates": [ "nums.length == n", "The input is generated such that edges represents a valid tree." ] }, { "line": 35, "end_line": 35, "violates": [ "nums.length == n", "The input is generated such that edges represents a valid tree." ] }, { "line": 37, "end_line": 37, "violates": [ "nums.length == n", "The input is generated such that edges represents a valid tree." ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Maintain a special path (from root to current node) dynamically.", "Also, maintain the positions of each value on the path so we can adjust the start point of the path.", "Use prefix sum to calculate the path length." ] }, { "question_id": 3487, "task_id": "maximum-unique-subarray-sum-after-deletion", "drop": [], "similar": [ "maximum-subarray-sum-with-one-deletion" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums" ], "tests": { "total": 121, "kept": 121, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 3, "hints": [ "If the maximum element in the array is less than zero, the answer is the maximum element.", "Otherwise, the answer is the sum of all unique values that are greater than or equal to zero." ] }, { "question_id": 3488, "task_id": "closest-equal-element-queries", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 93, "kept": 79, "dropped": { "constraint_violation": 14 } }, "dropped_tests": [ { "line": 19, "end_line": 19, "violates": [ "0 <= queries[i] < nums.length" ] }, { "line": 24, "end_line": 24, "violates": [ "1 <= nums[i] <= 10**(6)", "0 <= queries[i] < nums.length" ] }, { "line": 29, "end_line": 29, "violates": [ "0 <= queries[i] < nums.length" ] }, { "line": 31, "end_line": 31, "violates": [ "0 <= queries[i] < nums.length" ] }, { "line": 42, "end_line": 42, "violates": [ "0 <= queries[i] < nums.length" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= queries[i] < nums.length" ] }, { "line": 48, "end_line": 48, "violates": [ "0 <= queries[i] < nums.length" ] }, { "line": 57, "end_line": 57, "violates": [ "0 <= queries[i] < nums.length" ] }, { "line": 59, "end_line": 59, "violates": [ "0 <= queries[i] < nums.length" ] }, { "line": 61, "end_line": 61, "violates": [ "0 <= queries[i] < nums.length" ] }, { "line": 64, "end_line": 64, "violates": [ "0 <= queries[i] < nums.length" ] }, { "line": 76, "end_line": 76, "violates": [ "1 <= queries.length <= nums.length <= 10**(5)", "0 <= queries[i] < nums.length" ] }, { "line": 80, "end_line": 80, "violates": [ "0 <= queries[i] < nums.length" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= queries.length <= nums.length <= 10**(5)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use a dictionary that maps each unique value in the array to a sorted list of its indices.", "For each query, use binary search on the sorted indices list to find the nearest occurrences of the target value." ] }, { "question_id": 3489, "task_id": "zero-array-transformation-iv", "drop": [], "similar": [ "zero-array-transformation-i", "zero-array-transformation-ii", "zero-array-transformation-iii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "queries" ], "tests": { "total": 100, "kept": 84, "dropped": { "constraint_violation": 16 } }, "dropped_tests": [ { "line": 12, "end_line": 12, "violates": [ "1 <= vali <= 10" ] }, { "line": 19, "end_line": 19, "violates": [ "1 <= vali <= 10" ] }, { "line": 20, "end_line": 20, "violates": [ "1 <= vali <= 10" ] }, { "line": 25, "end_line": 25, "violates": [ "1 <= vali <= 10" ] }, { "line": 27, "end_line": 27, "violates": [ "1 <= vali <= 10" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= vali <= 10" ] }, { "line": 45, "end_line": 45, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 47, "end_line": 47, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 50, "end_line": 50, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 58, "end_line": 58, "violates": [ "1 <= vali <= 10" ] }, { "line": 62, "end_line": 62, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 69, "end_line": 69, "violates": [ "1 <= vali <= 10" ] }, { "line": 70, "end_line": 70, "violates": [ "1 <= vali <= 10" ] }, { "line": 82, "end_line": 82, "violates": [ "0 <= li <= ri < nums.length" ] }, { "line": 83, "end_line": 83, "violates": [ "1 <= vali <= 10" ] }, { "line": 98, "end_line": 98, "violates": [ "1 <= vali <= 10" ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Use dynamic programming.", "For each nums[i], use DP to check whether the queries[.][2] values (i.e., the val values) of the queries that affect it can form a combination with a sum equal to nums[i]." ] }, { "question_id": 3490, "task_id": "count-beautiful-numbers", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "l", "r" ], "tests": { "total": 92, "kept": 89, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= l <= r < 10**(9)" ] }, { "line": 43, "end_line": 43, "violates": [ "1 <= l <= r < 10**(9)" ] }, { "line": 45, "end_line": 45, "violates": [ "1 <= l <= r < 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Use digit dynamic programming." ] }, { "question_id": 3491, "task_id": "phone-number-prefix", "drop": [ "premium" ] }, { "question_id": 3492, "task_id": "maximum-containers-on-a-ship", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "n", "w", "maxWeight" ], "tests": { "total": 115, "kept": 111, "dropped": { "constraint_violation": 4 } }, "dropped_tests": [ { "line": 32, "end_line": 32, "violates": [ "1 <= w <= 1000" ] }, { "line": 34, "end_line": 34, "violates": [ "1 <= w <= 1000" ] }, { "line": 67, "end_line": 67, "violates": [ "1 <= w <= 1000" ] }, { "line": 80, "end_line": 80, "violates": [ "1 <= w <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "What are the limits on the number of containers?", "We can load at most min(n * n, maxWeight / w) containers." ] }, { "question_id": 3493, "task_id": "properties-graph", "drop": [], "similar": [], "flags": [ "has_images" ], "comparison": "exact", "parameter_names": [ "properties", "k" ], "tests": { "total": 95, "kept": 92, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 15, "end_line": 15, "violates": [ "1 <= k <= m" ] }, { "line": 39, "end_line": 39, "violates": [ "1 <= properties[i][j] <= 100" ] }, { "line": 68, "end_line": 68, "violates": [ "1 <= m == properties[i].length <= 100" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "How can we optimally find the intersection of two arrays? One way is to use len(set(a) & set(b)).", "For connected components, think about using DFS, BFS, or DSU." ] }, { "question_id": 3494, "task_id": "find-the-minimum-amount-of-time-to-brew-potions", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "skill", "mana" ], "tests": { "total": 103, "kept": 101, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 78, "end_line": 78, "violates": [ "1 <= mana[i], skill[i] <= 5000" ] }, { "line": 92, "end_line": 92, "violates": [ "1 <= mana[i], skill[i] <= 5000" ] } ], "unchecked_constraints": [], "public_tests": 3, "hints": [ "Maintain each wizard's earliest free time (for the last potion) as f[i].", "Let x be the current mana value. Starting from now = f[0], update now = max(now + skill[i - 1] * x, f[i]) for i in [1..n]. Then, the final f[n - 1] = now + skill[n - 1] * x for this potion.", "Update all other f values by f[i] = f[i + 1] - skill[i + 1] * x for i in [0..n - 2] (in reverse order)." ] }, { "question_id": 3495, "task_id": "minimum-operations-to-make-array-elements-zero", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "queries" ], "tests": { "total": 94, "kept": 88, "dropped": { "constraint_violation": 6 } }, "dropped_tests": [ { "line": 7, "end_line": 7, "violates": [ "1 <= l < r <= 10**(9)" ] }, { "line": 13, "end_line": 13, "violates": [ "1 <= l < r <= 10**(9)" ] }, { "line": 55, "end_line": 55, "violates": [ "1 <= l < r <= 10**(9)", "1 <= l < r <= 10**(9)" ] }, { "line": 60, "end_line": 60, "violates": [ "1 <= l < r <= 10**(9)", "1 <= l < r <= 10**(9)" ] }, { "line": 65, "end_line": 65, "violates": [ "1 <= l < r <= 10**(9)" ] }, { "line": 86, "end_line": 86, "violates": [ "1 <= l < r <= 10**(9)" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "For a number x, the number of \"/4\" operations to change it to 0 is floor(log4(x)) + 1.", "Always pair the 2 numbers with the maximum \"/4\" operations needed." ] }, { "question_id": 3496, "task_id": "maximize-score-after-pair-deletions", "drop": [ "premium" ] }, { "question_id": 3498, "task_id": "reverse-degree-of-a-string", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 55, "kept": 55, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Simulate the operations as described." ] }, { "question_id": 3499, "task_id": "maximize-active-section-with-trade-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s" ], "tests": { "total": 88, "kept": 88, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Split the string into several zero-one segments.", "For each one-segment, if it has two neighbors (i.e., it is surrounded by two zero-segments), the total sum of their lengths is one of the candidates for delta.", "Find the maximum delta and add it to the total number of ones in the string." ] }, { "question_id": 3500, "task_id": "minimum-cost-to-divide-array-into-subarrays", "drop": [], "similar": [ "minimum-cost-to-split-an-array" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "cost", "k" ], "tests": { "total": 108, "kept": 106, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 63, "end_line": 63, "violates": [ "1 <= nums[i], cost[i] <= 1000" ] }, { "line": 78, "end_line": 78, "violates": [ "1 <= nums[i], cost[i] <= 1000" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "dp[i] is the minimum cost to split the array suffix starting at i.", "Observe that no matter how many subarrays we have, if we have the first subarray on the left, the total cost of the previous subarrays increases by k * total_cost_of_the_subarray. This is because when we increase i to (i + 1), the cost increase is just the suffix sum of the cost array." ] }, { "question_id": 3501, "task_id": "maximize-active-section-with-trade-ii", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "queries" ], "tests": { "total": 43, "kept": 43, "dropped": {} }, "dropped_tests": [], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Split consecutive zeros and ones into segments and give each segment an ID.", "The answer should be the maximum of ans[i] = len[i - 1] + len[i + 1], where i is a one-segment.", "For a zero-segment, define ans[i] = 0.", "Note that all three segments (i - 1, i, and i + 1) should be fully covered by the substring.", "Use a segment tree to perform range maximum queries on the answer. The query to the segment tree is not straightforward since we need to ensure the zero-segments are fully covered. Handle the first and last segments separately." ] }, { "question_id": 3502, "task_id": "minimum-cost-to-reach-every-position", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "cost" ], "tests": { "total": 109, "kept": 107, "dropped": { "constraint_violation": 2 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "1 <= cost[i] <= 100" ] }, { "line": 75, "end_line": 75, "violates": [ "1 <= cost[i] <= 100" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Note that once you swap to a position with a lower cost, you can reach any later position for free.", "Use a min prefix array." ] }, { "question_id": 3503, "task_id": "longest-palindrome-after-substring-concatenation-i", "drop": [], "similar": [], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 101, "kept": 100, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 34, "end_line": 34, "violates": [ "1 <= s.length, t.length <= 30" ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Brute force" ] }, { "question_id": 3504, "task_id": "longest-palindrome-after-substring-concatenation-ii", "drop": [], "similar": [ "edit-distance" ], "flags": [], "comparison": "exact", "parameter_names": [ "s", "t" ], "tests": { "total": 122, "kept": 121, "dropped": { "constraint_violation": 1 } }, "dropped_tests": [ { "line": 92, "end_line": 92, "violates": [ "s and t consist of lowercase English letters." ] } ], "unchecked_constraints": [], "public_tests": 4, "hints": [ "Let dp[i][j] be the length of the longest answer if we try starting it with s[i] and ending it with t[j].", "For s, preprocess the length of the longest palindrome starting at index i as p[i].", "For t, preprocess the length of the longest palindrome ending at index j as q[j].", "If s[i] != t[j], then dp[i][j] = max(p[i], q[j]).", "Otherwise, dp[i][j] = max(p[i], q[j], 2 + dp[i + 1][j - 1])." ] }, { "question_id": 3505, "task_id": "minimum-operations-to-make-elements-within-k-subarrays-equal", "drop": [], "similar": [ "find-median-from-data-stream", "minimum-moves-to-equal-array-elements-ii" ], "flags": [], "comparison": "exact", "parameter_names": [ "nums", "x", "k" ], "tests": { "total": 80, "kept": 77, "dropped": { "constraint_violation": 3 } }, "dropped_tests": [ { "line": 23, "end_line": 23, "violates": [ "2 <= k * x <= nums.length" ] }, { "line": 24, "end_line": 24, "violates": [ "-10**(6) <= nums[i] <= 10**(6)" ] }, { "line": 29, "end_line": 29, "violates": [ "2 <= k * x <= nums.length" ] } ], "unchecked_constraints": [], "public_tests": 2, "hints": [ "Making every element of an x-sized window equal to its median is optimal.", "Precalculate this for each window." ] } ]