Search is not available for this dataset
problem_id string | problem string | answer string | test_cases string | eval_spec string | source string | source_platform string | original_domain string | category float64 |
|---|---|---|---|---|---|---|---|---|
livecodebench__test__2879 | Given a string s and an integer k, partition s into k substrings such that the sum of the number of letter changes required to turn each substring into a semi-palindrome is minimized.
Return an integer denoting the minimum number of letter changes required.
Notes
A string is a palindrome if it can be read the same way... | [] | [{"case_id": "livecodebench__test__2879__public__0000", "expected_output": {"kind": "return_value", "value": "1"}, "input": {"kind": "function_args", "value": {"args": ["\"abcac\"\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2879__public__0001", "expected_output": {"k... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumChanges", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason":... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2881 | Given an array of strings words and a character separator, split each string in words by separator.
Return an array of strings containing the new strings formed after the splits, excluding empty strings.
Notes
separator is used to determine where the split should occur, but it is not included as part of the resulting ... | [] | [{"case_id": "livecodebench__test__2881__public__0000", "expected_output": {"kind": "return_value", "value": ["one", "two", "three", "four", "five", "six"]}, "input": {"kind": "function_args", "value": {"args": ["[\"one.two.three\", \"four.five\", \"six\"]\n\".\""], "kwargs": {}}}, "metadata": {}, "visibility": "public... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "splitWordsBySeparator", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_r... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2882 | Given two positive integers n and x.
Return the number of ways n can be expressed as the sum of the x^th power of unique positive integers, in other words, the number of sets of unique integers [n_1, n_2, ..., n_k] where n = n_1^x + n_2^x + ... + n_k^x.
Since the result can be very large, return it modulo 10^9 + 7.
For... | [] | [{"case_id": "livecodebench__test__2882__public__0000", "expected_output": {"kind": "return_value", "value": "1"}, "input": {"kind": "function_args", "value": {"args": ["10\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2882__public__0001", "expected_output": {"kind": "... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "numberOfWays", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": n... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2883 | Given a binary string s, partition the string into one or more substrings such that each substring is beautiful.
A string is beautiful if:
It doesn't contain leading zeros.
It's the binary representation of a number that is a power of 5.
Return the minimum number of substrings in such partition. If it is impossible t... | [] | [{"case_id": "livecodebench__test__2883__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["1011"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2883__public__0001", "expected_output": {"kind": "r... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumBeautifulSubstrings", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsuppor... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2884 | You are given a string word and an array of strings forbidden.
A string is called valid if none of its substrings are present in forbidden.
Return the length of the longest valid substring of the string word.
A substring is a contiguous sequence of characters in a string, possibly empty.
Example 1:
Input: word = "cb... | [] | [{"case_id": "livecodebench__test__2884__public__0000", "expected_output": {"kind": "return_value", "value": "4"}, "input": {"kind": "function_args", "value": {"args": ["\"cbaaaabc\"\n[\"aaa\", \"cb\"]"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2884__public__0001", "ex... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "longestValidSubstring", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_r... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2886 | Your laptop keyboard is faulty, and whenever you type a character 'i' on it, it reverses the string that you have written. Typing other characters works as expected.
You are given a 0-indexed string s, and you type each character of s using your faulty keyboard.
Return the final string that will be present on your lapt... | [] | [{"case_id": "livecodebench__test__2886__public__0000", "expected_output": {"kind": "return_value", "value": "rtsng"}, "input": {"kind": "function_args", "value": {"args": ["string"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2886__public__0001", "expected_output": {"kin... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "finalString", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": nu... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2887 | Given a 0-indexed string s, permute s to get a new string t such that:
All consonants remain in their original places. More formally, if there is an index i with 0 <= i < s.length such that s[i] is a consonant, then t[i] = s[i].
The vowels must be sorted in the nondecreasing order of their ASCII values. More formally,... | [] | [{"case_id": "livecodebench__test__2887__public__0000", "expected_output": {"kind": "return_value", "value": "lEOtcede"}, "input": {"kind": "function_args", "value": {"args": ["lEetcOde"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2887__public__0001", "expected_output": ... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "sortVowels", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": nul... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2888 | An element x of an integer array arr of length m is dominant if freq(x) * 2 > m, where freq(x) is the number of occurrences of x in arr. Note that this definition implies that arr can have at most one dominant element.
You are given a 0-indexed integer array nums of length n with one dominant element.
You can split num... | [] | [{"case_id": "livecodebench__test__2888__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["1", "2", "2", "2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2888__public__0001", "expected_output":... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumIndex", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": n... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2891 | You are given a 0-indexed array nums and a non-negative integer k.
In one operation, you can do the following:
Choose an index i that hasn't been chosen before from the range [0, nums.length - 1].
Replace nums[i] with any integer from the range [nums[i] - k, nums[i] + k].
The beauty of the array is the length of the ... | [] | [{"case_id": "livecodebench__test__2891__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["[4, 6, 1, 2]\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2891__public__0001", "expected_output": ... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maximumBeauty", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": ... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2892 | You are given an integer array nums. We consider an array good if it is a permutation of an array base[n].
base[n] = [1, 2, ..., n - 1, n, n] (in other words, it is an array of length n + 1 which contains 1 to n - 1 exactly once, plus two occurrences of n). For example, base[1] = [1, 1] and base[3] = [1, 2, 3, 3].
Retu... | [] | [{"case_id": "livecodebench__test__2892__public__0000", "expected_output": {"kind": "return_value", "value": false}, "input": {"kind": "function_args", "value": {"args": ["2", "1", "3"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2892__public__0001", "expected_output": {"... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "isGood", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null} | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2893 | You are given a 0-indexed integer array nums and a positive integer x.
You are initially at position 0 in the array and you can visit other positions according to the following rules:
If you are currently in position i, then you can move to any position j such that i < j.
For each position i that you visit, you get a ... | [] | [{"case_id": "livecodebench__test__2893__public__0000", "expected_output": {"kind": "return_value", "value": "13"}, "input": {"kind": "function_args", "value": {"args": ["[2, 3, 6, 1, 9, 2]\n5"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2893__public__0001", "expected_ou... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maxScore", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null} | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2902 | You are given a 0-indexed integer array nums. You have to find the maximum sum of a pair of numbers from nums such that the maximum digit in both numbers are equal.
Return the maximum sum or -1 if no such pair exists.
Example 1:
Input: nums = [51,71,17,24,42]
Output: 88
Explanation:
For i = 1 and j = 2, nums[i] and... | [] | [{"case_id": "livecodebench__test__2902__public__0000", "expected_output": {"kind": "return_value", "value": "88"}, "input": {"kind": "function_args", "value": {"args": ["51", "71", "17", "24", "42"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2902__public__0001", "expect... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maxSum", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null} | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2915 | You are given a 0-indexed integer array nums, an integer modulo, and an integer k.
Your task is to find the count of subarrays that are interesting.
A subarray nums[l..r] is interesting if the following condition holds:
Let cnt be the number of indices i in the range [l, r] such that nums[i] % modulo == k. Then, cnt %... | [] | [{"case_id": "livecodebench__test__2915__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["[3, 2, 4]\n2\n1"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2915__public__0001", "expected_output": ... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "countInterestingSubarrays", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupport... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2916 | You are given an array nums of length n and an integer m. You need to determine if it is possible to split the array into n non-empty arrays by performing a series of steps.
In each step, you can select an existing array (which may be the result of previous steps) with a length of at least two and split it into two sub... | [] | [{"case_id": "livecodebench__test__2916__public__0000", "expected_output": {"kind": "return_value", "value": true}, "input": {"kind": "function_args", "value": {"args": ["[2, 2, 1]\n4"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2916__public__0001", "expected_output": {"... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "canSplitArray", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": ... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2917 | Given a 0-indexed integer array nums of length n and an integer target, return the number of pairs (i, j) where 0 <= i < j < n and nums[i] + nums[j] < target.
Example 1:
Input: nums = [-1,1,2,3,1], target = 2
Output: 3
Explanation: There are 3 pairs of indices that satisfy the conditions in the statement:
- (0, 1) s... | [] | [{"case_id": "livecodebench__test__2917__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["[-1, 1, 2, 3, 1]\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2917__public__0001", "expected_outpu... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "countPairs", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": nul... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2919 | You are given a 0-indexed array usageLimits of length n.
Your task is to create groups using numbers from 0 to n - 1, ensuring that each number, i, is used no more than usageLimits[i] times in total across all groups. You must also satisfy the following conditions:
Each group must consist of distinct numbers, meaning ... | [] | [{"case_id": "livecodebench__test__2919__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["1", "2", "5"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2919__public__0001", "expected_output": {"ki... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maxIncreasingGroups", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_rea... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2920 | You are given a 0-indexed array nums containing n integers.
At each second, you perform the following operation on the array:
For every index i in the range [0, n - 1], replace nums[i] with either nums[i], nums[(i - 1 + n) % n], or nums[(i + 1) % n].
Note that all the elements get replaced simultaneously.
Return the ... | [] | [{"case_id": "livecodebench__test__2920__public__0000", "expected_output": {"kind": "return_value", "value": "1"}, "input": {"kind": "function_args", "value": {"args": ["1", "2", "1", "2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2920__public__0001", "expected_output":... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumSeconds", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason":... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2921 | Given two positive integers low and high represented as strings, find the count of stepping numbers in the inclusive range [low, high].
A stepping number is an integer such that all of its adjacent digits have an absolute difference of exactly 1.
Return an integer denoting the count of stepping numbers in the inclusive... | [] | [{"case_id": "livecodebench__test__2921__public__0000", "expected_output": {"kind": "return_value", "value": "10"}, "input": {"kind": "function_args", "value": {"args": ["\"1\"\n\"11\""], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2921__public__0001", "expected_output": {... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "countSteppingNumbers", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_re... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2952 | You are given two 0-indexed integer arrays nums1 and nums2 of equal length. Every second, for all indices 0 <= i < nums1.length, value of nums1[i] is incremented by nums2[i]. After this is done, you can do the following operation:
Choose an index 0 <= i < nums1.length and make nums1[i] = 0.
You are also given an inte... | [] | [{"case_id": "livecodebench__test__2952__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["[1, 2, 3]\n[1, 2, 3]\n4"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2952__public__0001", "expected_o... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumTime", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": nu... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2953 | You are given a 2D integer array coordinates and an integer k, where coordinates[i] = [x_i, y_i] are the coordinates of the i^th point in a 2D plane.
We define the distance between two points (x_1, y_1) and (x_2, y_2) as (x1 XOR x2) + (y1 XOR y2) where XOR is the bitwise XOR operation.
Return the number of pairs (i, j)... | [] | [{"case_id": "livecodebench__test__2953__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["[[1, 2], [4, 2], [1, 3], [5, 2]]\n5"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2953__public__0001",... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "countPairs", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": nul... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2954 | You are given an integer array nums and two positive integers m and k.
Return the maximum sum out of all almost unique subarrays of length k of nums. If no such subarray exists, return 0.
A subarray of nums is almost unique if it contains at least m distinct elements.
A subarray is a contiguous non-empty sequence of el... | [] | [{"case_id": "livecodebench__test__2954__public__0000", "expected_output": {"kind": "return_value", "value": "18"}, "input": {"kind": "function_args", "value": {"args": ["[2, 6, 7, 3, 1, 7]\n3\n4"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2954__public__0001", "expected... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maxSum", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null} | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2955 | Initially, you have a bank account balance of 100 dollars.
You are given an integer purchaseAmount representing the amount you will spend on a purchase in dollars.
At the store where you will make the purchase, the purchase amount is rounded to the nearest multiple of 10. In other words, you pay a non-negative amount, ... | [] | [{"case_id": "livecodebench__test__2955__public__0000", "expected_output": {"kind": "return_value", "value": "90"}, "input": {"kind": "function_args", "value": {"args": ["9"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2955__public__0001", "expected_output": {"kind": "ret... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "accountBalanceAfterPurchase", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsuppo... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2977 | Given an array of strings words and a string s, determine if s is an acronym of words.
The string s is considered an acronym of words if it can be formed by concatenating the first character of each string in words in order. For example, "ab" can be formed from ["apple", "banana"], but it can't be formed from ["bear", ... | [] | [{"case_id": "livecodebench__test__2977__public__0000", "expected_output": {"kind": "return_value", "value": true}, "input": {"kind": "function_args", "value": {"args": ["[\"alice\", \"bob\", \"charlie\"]\n\"abc\""], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2977__public... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "isAcronym", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2979 | You are given an integer n representing the number of houses on a number line, numbered from 0 to n - 1.
Additionally, you are given a 2D integer array offers where offers[i] = [start_i, end_i, gold_i], indicating that i^th buyer wants to buy all the houses from start_i to end_i for gold_i amount of gold.
As a salesman... | [] | [{"case_id": "livecodebench__test__2979__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["5\n[[0, 0, 1], [0, 2, 2], [1, 3, 2]]"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2979__public__0001"... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maximizeTheProfit", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reaso... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2998 | You are given two positive integers low and high.
An integer x consisting of 2 * n digits is symmetric if the sum of the first n digits of x is equal to the sum of the last n digits of x. Numbers with an odd number of digits are never symmetric.
Return the number of symmetric integers in the range [low, high].
Exampl... | [] | [{"case_id": "livecodebench__test__2998__public__0000", "expected_output": {"kind": "return_value", "value": "9"}, "input": {"kind": "function_args", "value": {"args": ["1\n100"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2998__public__0001", "expected_output": {"kind": ... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "countSymmetricIntegers", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__2999 | You are given two strings s1 and s2, both of length 4, consisting of lowercase English letters.
You can apply the following operation on any of the two strings any number of times:
Choose any two indices i and j such that j - i = 2, then swap the two characters at those indices in the string.
Return true if you can m... | [] | [{"case_id": "livecodebench__test__2999__public__0000", "expected_output": {"kind": "return_value", "value": true}, "input": {"kind": "function_args", "value": {"args": ["\"abcd\"\n\"cdab\""], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__2999__public__0001", "expected_outpu... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "canBeEqual", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": nul... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3000 | You are given a 0-indexed integer array nums and an integer x.
Find the minimum absolute difference between two elements in the array that are at least x indices apart.
In other words, find two indices i and j such that abs(i - j) >= x and abs(nums[i] - nums[j]) is minimized.
Return an integer denoting the minimum abso... | [] | [{"case_id": "livecodebench__test__3000__public__0000", "expected_output": {"kind": "return_value", "value": "0"}, "input": {"kind": "function_args", "value": {"args": ["[4, 3, 2, 4]\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3000__public__0001", "expected_output": ... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minAbsoluteDifference", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_r... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3017 | You are given positive integers low, high, and k.
A number is beautiful if it meets both of the following conditions:
The count of even digits in the number is equal to the count of odd digits.
The number is divisible by k.
Return the number of beautiful integers in the range [low, high].
Example 1:
Input: low = 1... | [] | [{"case_id": "livecodebench__test__3017__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["10\n20\n3"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3017__public__0001", "expected_output": {"kind... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "numberOfBeautifulIntegers", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupport... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3018 | You are given two 0-indexed strings str1 and str2.
In an operation, you select a set of indices in str1, and for each index i in the set, increment str1[i] to the next character cyclically. That is 'a' becomes 'b', 'b' becomes 'c', and so on, and 'z' becomes 'a'.
Return true if it is possible to make str2 a subsequence... | [] | [{"case_id": "livecodebench__test__3018__public__0000", "expected_output": {"kind": "return_value", "value": true}, "input": {"kind": "function_args", "value": {"args": ["\"abc\"\n\"ad\""], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3018__public__0001", "expected_output":... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "canMakeSubsequence", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reas... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3019 | You are given a string moves of length n consisting only of characters 'L', 'R', and '_'. The string represents your movement on a number line starting from the origin 0.
In the i^th move, you can choose one of the following directions:
move to the left if moves[i] = 'L' or moves[i] = '_'
move to the right if moves[i]... | [] | [{"case_id": "livecodebench__test__3019__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["L_RL__R"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3019__public__0001", "expected_output": {"kind":... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "furthestDistanceFromOrigin", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsuppor... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3024 | You are given two strings s and t of equal length n. You can perform the following operation on the string s:
Remove a suffix of s of length l where 0 < l < n and append it at the start of s.
For example, let s = 'abcd' then in one operation you can remove the suffix 'cd' and append it in front of s making s = 'cdab'... | [] | [{"case_id": "livecodebench__test__3024__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["\"abcd\"\n\"cdab\"\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3024__public__0001", "expected_out... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "numberOfWays", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": n... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3025 | You are given a 0-indexed array nums consisting of non-negative powers of 2, and an integer target.
In one operation, you must apply the following changes to the array:
Choose any element of the array nums[i] such that nums[i] > 1.
Remove nums[i] from the array.
Add two occurrences of nums[i] / 2 to the end of nums.
... | [] | [{"case_id": "livecodebench__test__3025__public__0000", "expected_output": {"kind": "return_value", "value": "1"}, "input": {"kind": "function_args", "value": {"args": ["[1, 2, 8]\n7"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3025__public__0001", "expected_output": {"k... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minOperations", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": ... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3026 | You are given positive integers n and target.
An array nums is beautiful if it meets the following conditions:
nums.length == n.
nums consists of pairwise distinct positive integers.
There doesn't exist two distinct indices, i and j, in the range [0, n - 1], such that nums[i] + nums[j] == target.
Return the minimum p... | [] | [{"case_id": "livecodebench__test__3026__public__0000", "expected_output": {"kind": "return_value", "value": "4"}, "input": {"kind": "function_args", "value": {"args": ["2\n3"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3026__public__0001", "expected_output": {"kind": "r... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumPossibleSum", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reas... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3031 | Given a 0-indexed 2D integer matrix grid of size n * m, we define a 0-indexed 2D matrix p of size n * m as the product matrix of grid if the following condition is met:
Each element p[i][j] is calculated as the product of all elements in grid except for the element grid[i][j]. This product is then taken modulo 12345.
... | [] | [{"case_id": "livecodebench__test__3031__public__0000", "expected_output": {"kind": "return_value", "value": [["24", "12"], ["8", "6"]]}, "input": {"kind": "function_args", "value": {"args": [["1", "2"], ["3", "4"]], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3031__public... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "constructProductMatrix", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3032 | You are given a 0-indexed integer array receiver of length n and an integer k.
There are n players having a unique id in the range [0, n - 1] who will play a ball passing game, and receiver[i] is the id of the player who receives passes from the player with id i. Players can pass to themselves, i.e. receiver[i] may be ... | [] | [{"case_id": "livecodebench__test__3032__public__0000", "expected_output": {"kind": "return_value", "value": "6"}, "input": {"kind": "function_args", "value": {"args": ["[2, 0, 1]\n4"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3032__public__0001", "expected_output": {"k... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "getMaxFunctionValue", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_rea... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3033 | You are given two 0-indexed binary strings s1 and s2, both of length n, and a positive integer x.
You can perform any of the following operations on the string s1 any number of times:
Choose two indices i and j, and flip both s1[i] and s1[j]. The cost of this operation is x.
Choose an index i such that i < n - 1 and f... | [] | [{"case_id": "livecodebench__test__3033__public__0000", "expected_output": {"kind": "return_value", "value": "4"}, "input": {"kind": "function_args", "value": {"args": ["\"1100011000\"\n\"0101001010\"\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3033__public__0001", "... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minOperations", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": ... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3034 | You are given a 0-indexed 2D integer array nums representing the coordinates of the cars parking on a number line. For any index i, nums[i] = [start_i, end_i] where start_i is the starting point of the i^th car and end_i is the ending point of the i^th car.
Return the number of integer points on the line that are cover... | [] | [{"case_id": "livecodebench__test__3034__public__0000", "expected_output": {"kind": "return_value", "value": "7"}, "input": {"kind": "function_args", "value": {"args": [["3", "6"], ["1", "5"], ["4", "7"]], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3034__public__0001", "e... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "numberOfPoints", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason":... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3044 | You are given an array nums of positive integers and an integer k.
In one operation, you can remove the last element of the array and add it to your collection.
Return the minimum number of operations needed to collect elements 1, 2, ..., k.
Example 1:
Input: nums = [3,1,5,4,2], k = 2
Output: 4
Explanation: After 4 ... | [] | [{"case_id": "livecodebench__test__3044__public__0000", "expected_output": {"kind": "return_value", "value": "4"}, "input": {"kind": "function_args", "value": {"args": ["[3, 1, 5, 4, 2]\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3044__public__0001", "expected_output... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minOperations", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": ... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3045 | You are given a 0-indexed array nums of length n containing distinct positive integers. Return the minimum number of right shifts required to sort nums and -1 if this is not possible.
A right shift is defined as shifting the element at index i to index (i + 1) % n, for all indices.
Example 1:
Input: nums = [3,4,5,1,... | [] | [{"case_id": "livecodebench__test__3045__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["3", "4", "5", "1", "2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3045__public__0001", "expected_out... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumRightShifts", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reas... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3046 | You are given a 0-indexed string num representing a non-negative integer.
In one operation, you can pick any digit of num and delete it. Note that if you delete all the digits of num, num becomes 0.
Return the minimum number of operations required to make num special.
An integer x is considered special if it is divisib... | [] | [{"case_id": "livecodebench__test__3046__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["2245047"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3046__public__0001", "expected_output": {"kind":... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumOperations", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reaso... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3047 | You are given a 1-indexed array nums of n integers.
A set of numbers is complete if the product of every pair of its elements is a perfect square.
For a subset of the indices set {1, 2, ..., n} represented as {i_1, i_2, ..., i_k}, we define its element-sum as: nums[i_1] + nums[i_2] + ... + nums[i_k].
Return the maximum... | [] | [{"case_id": "livecodebench__test__3047__public__0000", "expected_output": {"kind": "return_value", "value": "16"}, "input": {"kind": "function_args", "value": {"args": ["8", "7", "3", "5", "7", "2", "4", "9"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3047__public__0001... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maximumSum", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": nul... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3055 | You are given a binary string s that contains at least one '1'.
You have to rearrange the bits in such a way that the resulting binary number is the maximum odd binary number that can be created from this combination.
Return a string representing the maximum odd binary number that can be created from the given combinat... | [] | [{"case_id": "livecodebench__test__3055__public__0000", "expected_output": {"kind": "return_value", "value": "001"}, "input": {"kind": "function_args", "value": {"args": ["010"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3055__public__0001", "expected_output": {"kind": "... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maximumOddBinaryNumber", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3080 | You are given an array nums consisting of non-negative integers.
We define the score of subarray nums[l..r] such that l <= r as nums[l] AND nums[l + 1] AND ... AND nums[r] where AND is the bitwise AND operation.
Consider splitting the array into one or more subarrays such that the following conditions are satisfied:
E... | [] | [{"case_id": "livecodebench__test__3080__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["1", "0", "2", "0", "1", "2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3080__public__0001", "expecte... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maxSubarrays", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": n... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3081 | You are given a 0-indexed sorted array of integers nums.
You can perform the following operation any number of times:
Choose two indices, i and j, where i < j, such that nums[i] < nums[j].
Then, remove the elements at indices i and j from nums. The remaining elements retain their original order, and the array is re-in... | [] | [{"case_id": "livecodebench__test__3081__public__0000", "expected_output": {"kind": "return_value", "value": "0"}, "input": {"kind": "function_args", "value": {"args": ["1", "3", "4", "9"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3081__public__0001", "expected_output":... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minLengthAfterRemovals", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3091 | You are given a 0-indexed array nums of non-negative integers, and two integers l and r.
Return the count of sub-multisets within nums where the sum of elements in each subset falls within the inclusive range of [l, r].
Since the answer may be large, return it modulo 10^9 + 7.
A sub-multiset is an unordered collection ... | [] | [{"case_id": "livecodebench__test__3091__public__0000", "expected_output": {"kind": "return_value", "value": "1"}, "input": {"kind": "function_args", "value": {"args": ["[1, 2, 2, 3]\n6\n6"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3091__public__0001", "expected_output... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "countSubMultisets", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reaso... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3093 | You are given a 0-indexed integer array nums and an integer k.
Return an integer that denotes the sum of elements in nums whose corresponding indices have exactly k set bits in their binary representation.
The set bits in an integer are the 1's present when it is written in binary.
For example, the binary representati... | [] | [{"case_id": "livecodebench__test__3093__public__0000", "expected_output": {"kind": "return_value", "value": "13"}, "input": {"kind": "function_args", "value": {"args": ["[5, 10, 1, 5, 2]\n1"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3093__public__0001", "expected_outp... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "sumIndicesWithKSetBits", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3094 | You are given a 0-indexed array nums consisting of positive integers.
There are two types of operations that you can apply on the array any number of times:
Choose two elements with equal values and delete them from the array.
Choose three elements with equal values and delete them from the array.
Return the minimum ... | [] | [{"case_id": "livecodebench__test__3094__public__0000", "expected_output": {"kind": "return_value", "value": "4"}, "input": {"kind": "function_args", "value": {"args": ["2", "3", "3", "2", "2", "4", "2", "3", "4"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3094__public__... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minOperations", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": ... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3104 | You are given a 0-indexed integer array nums of length n where n is the total number of students in the class. The class teacher tries to select a group of students so that all the students remain happy.
The i^th student will become happy if one of these two conditions is met:
The student is selected and the total num... | [] | [{"case_id": "livecodebench__test__3104__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["1", "1"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3104__public__0001", "expected_output": {"kind": ... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "countWays", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3106 | You are given a 0-indexed array of integers nums, and an integer target.
Return the length of the longest subsequence of nums that sums up to target. If no such subsequence exists, return -1.
A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of t... | [] | [{"case_id": "livecodebench__test__3106__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["[1, 2, 3, 4, 5]\n9"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3106__public__0001", "expected_output... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "lengthOfLongestSubsequence", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsuppor... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3114 | You are given a 0-indexed array maxHeights of n integers.
You are tasked with building n towers in the coordinate line. The i^th tower is built at coordinate i and has a height of heights[i].
A configuration of towers is beautiful if the following conditions hold:
1 <= heights[i] <= maxHeights[i]
heights is a mountain... | [] | [{"case_id": "livecodebench__test__3114__public__0000", "expected_output": {"kind": "return_value", "value": "13"}, "input": {"kind": "function_args", "value": {"args": ["5", "3", "4", "1", "1"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3114__public__0001", "expected_ou... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maximumSumOfHeights", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_rea... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3141 | You are given a 0-indexed array nums and an integer target.
A 0-indexed array infinite_nums is generated by infinitely appending the elements of nums to itself.
Return the length of the shortest subarray of the array infinite_nums with a sum equal to target. If there is no such subarray return -1.
Example 1:
Input: ... | [] | [{"case_id": "livecodebench__test__3141__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["[1, 2, 3]\n5"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3141__public__0001", "expected_output": {"k... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minSizeSubarray", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason"... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3150 | You are given a binary string s and a positive integer k.
A substring of s is beautiful if the number of 1's in it is exactly k.
Let len be the length of the shortest beautiful substring.
Return the lexicographically smallest beautiful substring of string s with length equal to len. If s doesn't contain a beautiful sub... | [] | [{"case_id": "livecodebench__test__3150__public__0000", "expected_output": {"kind": "return_value", "value": "11001"}, "input": {"kind": "function_args", "value": {"args": ["\"100011001\"\n3"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3150__public__0001", "expected_outp... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "shortestBeautifulSubstring", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsuppor... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3151 | You have n processors each having 4 cores and n * 4 tasks that need to be executed such that each core should perform only one task.
Given a 0-indexed integer array processorTime representing the time at which each processor becomes available for the first time and a 0-indexed integer array tasks representing the time ... | [] | [{"case_id": "livecodebench__test__3151__public__0000", "expected_output": {"kind": "return_value", "value": "16"}, "input": {"kind": "function_args", "value": {"args": ["[8, 10]\n[2, 2, 3, 1, 8, 7, 4, 5]"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3151__public__0001", ... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minProcessingTime", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reaso... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3153 | You are given a 0-indexed integer array nums and a positive integer k.
You can do the following operation on the array any number of times:
Choose any two distinct indices i and j and simultaneously update the values of nums[i] to (nums[i] AND nums[j]) and nums[j] to (nums[i] OR nums[j]). Here, OR denotes the bitwise ... | [] | [{"case_id": "livecodebench__test__3153__public__0000", "expected_output": {"kind": "return_value", "value": "261"}, "input": {"kind": "function_args", "value": {"args": ["[2, 6, 5, 8]\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3153__public__0001", "expected_output"... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maxSum", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null} | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3154 | You are given a 0-indexed integer array nums.
Return the maximum value over all triplets of indices (i, j, k) such that i < j < k. If all such triplets have a negative value, return 0.
The value of a triplet of indices (i, j, k) is equal to (nums[i] - nums[j]) * nums[k].
Example 1:
Input: nums = [12,6,1,2,7]
Output:... | [] | [{"case_id": "livecodebench__test__3154__public__0000", "expected_output": {"kind": "return_value", "value": "77"}, "input": {"kind": "function_args", "value": {"args": ["12", "6", "1", "2", "7"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3154__public__0001", "expected_o... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maximumTripletValue", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_rea... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3163 | You are given a 0-indexed integer array nums.
The distinct count of a subarray of nums is defined as:
Let nums[i..j] be a subarray of nums consisting of all the indices from i to j such that 0 <= i <= j < nums.length. Then the number of distinct values in nums[i..j] is called the distinct count of nums[i..j].
Return ... | [] | [{"case_id": "livecodebench__test__3163__public__0000", "expected_output": {"kind": "return_value", "value": "15"}, "input": {"kind": "function_args", "value": {"args": ["1", "2", "1"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3163__public__0001", "expected_output": {"k... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "sumCounts", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3164 | Given a 0-indexed array of strings words where words[i] is either a positive integer represented as a string or the string "prev".
Start iterating from the beginning of the array; for every "prev" string seen in words, find the last visited integer in words which is defined as follows:
Let k be the number of consecuti... | [] | [{"case_id": "livecodebench__test__3164__public__0000", "expected_output": {"kind": "return_value", "value": ["2", "1", "-1"]}, "input": {"kind": "function_args", "value": {"args": ["1", "2", "prev", "prev", "prev"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3164__public... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "lastVisitedIntegers", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_rea... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3166 | You are given a 0-indexed integer array nums of length n.
We want to group the indices so for each index i in the range [0, n - 1], it is assigned to exactly one group.
A group assignment is valid if the following conditions hold:
For every group g, all indices i assigned to group g have the same value in nums.
For an... | [] | [{"case_id": "livecodebench__test__3166__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["3", "2", "3", "2", "3"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3166__public__0001", "expected_out... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minGroupsForValidAssignment", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsuppo... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3171 | You are given two arrays nums1 and nums2 consisting of positive integers.
You have to replace all the 0's in both arrays with strictly positive integers such that the sum of elements of both arrays becomes equal.
Return the minimum equal sum you can obtain, or -1 if it is impossible.
Example 1:
Input: nums1 = [3,2,0... | [] | [{"case_id": "livecodebench__test__3171__public__0000", "expected_output": {"kind": "return_value", "value": "12"}, "input": {"kind": "function_args", "value": {"args": ["[3, 2, 0, 1, 0]\n[6, 5, 0]"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3171__public__0001", "expect... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minSum", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null} | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3172 | You are given positive integers n and m.
Define two integers, num1 and num2, as follows:
num1: The sum of all integers in the range [1, n] that are not divisible by m.
num2: The sum of all integers in the range [1, n] that are divisible by m.
Return the integer num1 - num2.
Example 1:
Input: n = 10, m = 3
Output: ... | [] | [{"case_id": "livecodebench__test__3172__public__0000", "expected_output": {"kind": "return_value", "value": "19"}, "input": {"kind": "function_args", "value": {"args": ["10\n3"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3172__public__0001", "expected_output": {"kind": ... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "differenceOfSums", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3174 | You are given a 0-indexed binary string s having an even length.
A string is beautiful if it's possible to partition it into one or more substrings such that:
Each substring has an even length.
Each substring contains only 1's or only 0's.
You can change any character in s to 0 or 1.
Return the minimum number of chan... | [] | [{"case_id": "livecodebench__test__3174__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["1001"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3174__public__0001", "expected_output": {"kind": "r... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minChanges", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": nul... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3176 | You are given a 0-indexed array nums of integers.
A triplet of indices (i, j, k) is a mountain if:
i < j < k
nums[i] < nums[j] and nums[k] < nums[j]
Return the minimum possible sum of a mountain triplet of nums. If no such triplet exists, return -1.
Example 1:
Input: nums = [8,6,1,5,3]
Output: 9
Explanation: Tripl... | [] | [{"case_id": "livecodebench__test__3176__public__0000", "expected_output": {"kind": "return_value", "value": "9"}, "input": {"kind": "function_args", "value": {"args": ["8", "6", "1", "5", "3"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3176__public__0001", "expected_out... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumSum", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": nul... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3183 | You are given a 0-indexed integer array nums, and an integer k.
The K-or of nums is a non-negative integer that satisfies the following:
The i^th bit is set in the K-or if and only if there are at least k elements of nums in which bit i is set.
Return the K-or of nums.
Note that a bit i is set in x if (2^i AND x) ==... | [] | [{"case_id": "livecodebench__test__3183__public__0000", "expected_output": {"kind": "return_value", "value": "9"}, "input": {"kind": "function_args", "value": {"args": ["[7, 12, 9, 8, 9, 15]\n4"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3183__public__0001", "expected_o... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "findKOr", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null} | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3184 | You are given a 0-indexed integer array nums.
A subsequence of nums having length k and consisting of indices i_0 < i_1 < ... < i_k-1 is balanced if the following holds:
nums[i_j] - nums[i_j-1] >= i_j - i_j-1, for every j in the range [1, k - 1].
A subsequence of nums having length 1 is considered balanced.
Return an... | [] | [{"case_id": "livecodebench__test__3184__public__0000", "expected_output": {"kind": "return_value", "value": "14"}, "input": {"kind": "function_args", "value": {"args": ["3", "3", "5", "6"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3184__public__0001", "expected_output"... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maxBalancedSubsequenceSum", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupport... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3188 | There are n teams numbered from 0 to n - 1 in a tournament.
Given a 0-indexed 2D boolean matrix grid of size n * n. For all i, j that 0 <= i, j <= n - 1 and i != j team i is stronger than team j if grid[i][j] == 1, otherwise, team j is stronger than team i.
Team a will be the champion of the tournament if there is no t... | [] | [{"case_id": "livecodebench__test__3188__public__0000", "expected_output": {"kind": "return_value", "value": "0"}, "input": {"kind": "function_args", "value": {"args": [["0", "1"], ["0", "0"]], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3188__public__0001", "expected_outp... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "findChampion", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": n... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3190 | You are given two 0-indexed integer arrays, nums1 and nums2, both having length n.
You are allowed to perform a series of operations (possibly none).
In an operation, you select an index i in the range [0, n - 1] and swap the values of nums1[i] and nums2[i].
Your task is to find the minimum number of operations require... | [] | [{"case_id": "livecodebench__test__3190__public__0000", "expected_output": {"kind": "return_value", "value": "1"}, "input": {"kind": "function_args", "value": {"args": ["[1, 2, 7]\n[4, 5, 3]"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3190__public__0001", "expected_outp... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minOperations", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": ... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3192 | Given three integers a, b, and n, return the maximum value of (a XOR x) * (b XOR x) where 0 <= x < 2^n.
Since the answer may be too large, return it modulo 10^9 + 7.
Note that XOR is the bitwise XOR operation.
Example 1:
Input: a = 12, b = 5, n = 4
Output: 98
Explanation: For x = 2, (a XOR x) = 14 and (b XOR x) = 7.... | [] | [{"case_id": "livecodebench__test__3192__public__0000", "expected_output": {"kind": "return_value", "value": "98"}, "input": {"kind": "function_args", "value": {"args": ["12\n5\n4"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3192__public__0001", "expected_output": {"kind... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maximumXorProduct", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reaso... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3193 | You are given a 0-indexed integer array nums. A pair of integers x and y is called a strong pair if it satisfies the condition:
|x - y| <= min(x, y)
You need to select two integers from nums such that they form a strong pair and their bitwise XOR is the maximum among all strong pairs in the array.
Return the maximum ... | [] | [{"case_id": "livecodebench__test__3193__public__0000", "expected_output": {"kind": "return_value", "value": "7"}, "input": {"kind": "function_args", "value": {"args": ["1", "2", "3", "4", "5"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3193__public__0001", "expected_out... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maximumStrongPairXor", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_re... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3194 | You are given a 0-indexed array of strings words and a character x.
Return an array of indices representing the words that contain the character x.
Note that the returned array may be in any order.
Example 1:
Input: words = ["leet","code"], x = "e"
Output: [0,1]
Explanation: "e" occurs in both words: "leet", and "co... | [] | [{"case_id": "livecodebench__test__3194__public__0000", "expected_output": {"kind": "return_value", "value": ["0", "1"]}, "input": {"kind": "function_args", "value": {"args": ["[\"leet\", \"code\"]\n\"e\""], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3194__public__0001", ... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "findWordsContaining", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_rea... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3195 | There are n balls on a table, each ball has a color black or white.
You are given a 0-indexed binary string s of length n, where 1 and 0 represent black and white balls, respectively.
In each step, you can choose two adjacent balls and swap them.
Return the minimum number of steps to group all the black balls to the ri... | [] | [{"case_id": "livecodebench__test__3195__public__0000", "expected_output": {"kind": "return_value", "value": "1"}, "input": {"kind": "function_args", "value": {"args": ["101"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3195__public__0001", "expected_output": {"kind": "re... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumSteps", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": n... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3196 | You are given a 0-indexed integer array nums and an integer k.
You can perform the following operation on the array at most k times:
Choose any index i from the array and increase or decrease nums[i] by 1.
The score of the final array is the frequency of the most frequent element in the array.
Return the maximum scor... | [] | [{"case_id": "livecodebench__test__3196__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["[1, 2, 6, 4]\n3"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3196__public__0001", "expected_output": ... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maxFrequencyScore", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reaso... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3199 | You are given two positive integers n and limit.
Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies.
Example 1:
Input: n = 5, limit = 2
Output: 3
Explanation: There are 3 ways to distribute 5 candies such that no child gets more than 2 candies: (1... | [] | [{"case_id": "livecodebench__test__3199__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["5\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3199__public__0001", "expected_output": {"kind": "r... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "distributeCandies", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reaso... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3200 | You are given an integer n.
A string s is called good if it contains only lowercase English characters and it is possible to rearrange the characters of s such that the new string contains "leet" as a substring.
For example:
The string "lteer" is good because we can rearrange it to form "leetr" .
"letl" is not good be... | [] | [{"case_id": "livecodebench__test__3200__public__0000", "expected_output": {"kind": "return_value", "value": "12"}, "input": {"kind": "function_args", "value": {"args": ["4"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3200__public__0001", "expected_output": {"kind": "ret... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "stringCount", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": nu... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3203 | You are given a 0-indexed string s having an even length n.
You are also given a 0-indexed 2D integer array, queries, where queries[i] = [a_i, b_i, c_i, d_i].
For each query i, you are allowed to perform the following operations:
Rearrange the characters within the substring s[a_i:b_i], where 0 <= a_i <= b_i < n / 2.
... | [] | [{"case_id": "livecodebench__test__3203__public__0000", "expected_output": {"kind": "return_value", "value": [true, true]}, "input": {"kind": "function_args", "value": {"args": ["\"abcabc\"\n[[1, 1, 3, 5], [0, 2, 5, 5]]"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3203__... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "canMakePalindromeQueries", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupporte... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3206 | You are given two 0-indexed integer arrays nums1 and nums2 of sizes n and m, respectively.
Consider calculating the following values:
The number of indices i such that 0 <= i < n and nums1[i] occurs at least once in nums2.
The number of indices i such that 0 <= i < m and nums2[i] occurs at least once in nums1.
Return... | [] | [{"case_id": "livecodebench__test__3206__public__0000", "expected_output": {"kind": "return_value", "value": ["3", "4"]}, "input": {"kind": "function_args", "value": {"args": ["[4, 3, 2, 3, 1]\n[2, 2, 5, 2, 3, 6]"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3206__public_... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "findIntersectionValues", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3207 | You are given three strings s1, s2, and s3. You have to perform the following operation on these three strings as many times as you want.
In one operation you can choose one of these three strings such that its length is at least 2 and delete the rightmost character of it.
Return the minimum number of operations you ne... | [] | [{"case_id": "livecodebench__test__3207__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["\"abc\"\n\"abb\"\n\"ab\""], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3207__public__0001", "expected_... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "findMinimumOperations", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_r... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3209 | You are at a fruit market with different types of exotic fruits on display.
You are given a 1-indexed array prices, where prices[i] denotes the number of coins needed to purchase the i^th fruit.
The fruit market has the following offer:
If you purchase the i^th fruit at prices[i] coins, you can get the next i fruits f... | [] | [{"case_id": "livecodebench__test__3209__public__0000", "expected_output": {"kind": "return_value", "value": "4"}, "input": {"kind": "function_args", "value": {"args": ["3", "1", "2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3209__public__0001", "expected_output": {"ki... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumCoins", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": n... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3210 | You are given a string s and a positive integer k.
Let vowels and consonants be the number of vowels and consonants in a string.
A string is beautiful if:
vowels == consonants.
(vowels * consonants) % k == 0, in other terms the multiplication of vowels and consonants is divisible by k.
Return the number of non-empty ... | [] | [{"case_id": "livecodebench__test__3210__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["\"baeyh\"\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3210__public__0001", "expected_output": {"k... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "beautifulSubstrings", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_rea... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3211 | You are given a 0-indexed integer array nums.
You can perform any number of operations, where each operation involves selecting a subarray of the array and replacing it with the sum of its elements. For example, if the given array is [1,3,5,6] and you select subarray [3,5] the array will convert to [1,8,6].
Return the ... | [] | [{"case_id": "livecodebench__test__3211__public__0000", "expected_output": {"kind": "return_value", "value": "1"}, "input": {"kind": "function_args", "value": {"args": ["5", "2", "2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3211__public__0001", "expected_output": {"ki... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "findMaximumLength", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reaso... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3212 | You are given a 0-indexed array nums consisting of positive integers.
A partition of an array into one or more contiguous subarrays is called good if no two subarrays contain the same number.
Return the total number of good partitions of nums.
Since the answer may be large, return it modulo 10^9 + 7.
Example 1:
Inpu... | [] | [{"case_id": "livecodebench__test__3212__public__0000", "expected_output": {"kind": "return_value", "value": "8"}, "input": {"kind": "function_args", "value": {"args": ["1", "2", "3", "4"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3212__public__0001", "expected_output":... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "numberOfGoodPartitions", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3213 | You are given an integer array nums and a positive integer k.
Return the number of subarrays where the maximum element of nums appears at least k times in that subarray.
A subarray is a contiguous sequence of elements within an array.
Example 1:
Input: nums = [1,3,2,3,3], k = 2
Output: 6
Explanation: The subarrays t... | [] | [{"case_id": "livecodebench__test__3213__public__0000", "expected_output": {"kind": "return_value", "value": "6"}, "input": {"kind": "function_args", "value": {"args": ["[1, 3, 2, 3, 3]\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3213__public__0001", "expected_output... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "countSubarrays", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason":... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3219 | You are given a 0-indexed array of positive integers nums and a positive integer limit.
In one operation, you can choose any two indices i and j and swap nums[i] and nums[j] if |nums[i] - nums[j]| <= limit.
Return the lexicographically smallest array that can be obtained by performing the operation any number of times.... | [] | [{"case_id": "livecodebench__test__3219__public__0000", "expected_output": {"kind": "return_value", "value": ["1", "3", "5", "8", "9"]}, "input": {"kind": "function_args", "value": {"args": ["[1, 5, 3, 9, 8]\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3219__public__0... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "lexicographicallySmallestArray", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsu... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3220 | You are given a 0-indexed integer array batteryPercentages having length n, denoting the battery percentages of n 0-indexed devices.
Your task is to test each device i in order from 0 to n - 1, by performing the following test operations:
If batteryPercentages[i] is greater than 0:
Increment the count of tested dev... | [] | [{"case_id": "livecodebench__test__3220__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["1", "1", "2", "1", "3"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3220__public__0001", "expected_out... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "countTestedDevices", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reas... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3221 | You are given a 0-indexed array mountain. Your task is to find all the peaks in the mountain array.
Return an array that consists of indices of peaks in the given array in any order.
Notes:
A peak is defined as an element that is strictly greater than its neighboring elements.
The first and last elements of the array ... | [] | [{"case_id": "livecodebench__test__3221__public__0000", "expected_output": {"kind": "return_value", "value": []}, "input": {"kind": "function_args", "value": {"args": ["2", "4", "4"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3221__public__0001", "expected_output": {"kin... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "findPeaks", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": null... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3223 | You are given a string word and an integer k.
A substring s of word is complete if:
Each character in s occurs exactly k times.
The difference between two adjacent characters is at most 2. That is, for any two adjacent characters c1 and c2 in s, the absolute difference in their positions in the alphabet is at most 2.
... | [] | [{"case_id": "livecodebench__test__3223__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["\"igigee\"\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3223__public__0001", "expected_output": {"... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "countCompleteSubstrings", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3224 | You are given an integer n and a 0-indexed integer array sick which is sorted in increasing order.
There are n children standing in a queue with positions 0 to n - 1 assigned to them. The array sick contains the positions of the children who are infected with an infectious disease. An infected child at position i can s... | [] | [{"case_id": "livecodebench__test__3224__public__0000", "expected_output": {"kind": "return_value", "value": "4"}, "input": {"kind": "function_args", "value": {"args": ["5\n[0, 4]"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3224__public__0001", "expected_output": {"kind... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "numberOfSequence", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3225 | You are given an integer array nums and an integer k.
The frequency of an element x is the number of times it occurs in an array.
An array is called good if the frequency of each element in this array is less than or equal to k.
Return the length of the longest good subarray of nums.
A subarray is a contiguous non-empt... | [] | [{"case_id": "livecodebench__test__3225__public__0000", "expected_output": {"kind": "return_value", "value": "6"}, "input": {"kind": "function_args", "value": {"args": ["[1, 2, 3, 1, 2, 3, 1, 2]\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3225__public__0001", "expect... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maxSubarrayLength", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reaso... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3226 | You are given a 0-indexed integer array nums of even length and there is also an empty array arr. Alice and Bob decided to play a game where in every round Alice and Bob will do one move. The rules of the game are as follows:
Every round, first Alice will remove the minimum element from nums, and then Bob does the sam... | [] | [{"case_id": "livecodebench__test__3226__public__0000", "expected_output": {"kind": "return_value", "value": ["3", "2", "5", "4"]}, "input": {"kind": "function_args", "value": {"args": ["5", "4", "2", "3"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3226__public__0001", "... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "numberGame", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": nul... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3227 | You are given a 0-indexed 2D integer matrix grid of size n * n with values in the range [1, n^2]. Each integer appears exactly once except a which appears twice and b which is missing. The task is to find the repeating and missing numbers a and b.
Return a 0-indexed integer array ans of size 2 where ans[0] equals to a ... | [] | [{"case_id": "livecodebench__test__3227__public__0000", "expected_output": {"kind": "return_value", "value": ["2", "4"]}, "input": {"kind": "function_args", "value": {"args": [["1", "3"], ["2", "2"]], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3227__public__0001", "expect... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "findMissingAndRepeatedValues", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupp... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3228 | You are given two 0-indexed integer arrays nums1 and nums2 of even length n.
You must remove n / 2 elements from nums1 and n / 2 elements from nums2. After the removals, you insert the remaining elements of nums1 and nums2 into a set s.
Return the maximum possible size of the set s.
Example 1:
Input: nums1 = [1,2,1,... | [] | [{"case_id": "livecodebench__test__3228__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["[1, 2, 1, 2]\n[1, 1, 1, 1]"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3228__public__0001", "expecte... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maximumSetSize", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason":... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3229 | You are given a 0-indexed integer array nums having length n.
You are allowed to perform a special move any number of times (including zero) on nums. In one special move you perform the following steps in order:
Choose an index i in the range [0, n - 1], and a positive integer x.
Add |nums[i] - x| to the total cost.
C... | [] | [{"case_id": "livecodebench__test__3229__public__0000", "expected_output": {"kind": "return_value", "value": "6"}, "input": {"kind": "function_args", "value": {"args": ["1", "2", "3", "4", "5"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3229__public__0001", "expected_out... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumCost", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": nu... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3230 | You are given a 0-indexed string word.
In one operation, you can pick any index i of word and change word[i] to any lowercase English letter.
Return the minimum number of operations needed to remove all adjacent almost-equal characters from word.
Two characters a and b are almost-equal if a == b or a and b are adjacent... | [] | [{"case_id": "livecodebench__test__3230__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["aaaaa"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3230__public__0001", "expected_output": {"kind": "... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "removeAlmostEqualCharacters", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsuppo... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3231 | You are given a 0-indexed integer array coins, representing the values of the coins available, and an integer target.
An integer x is obtainable if there exists a subsequence of coins that sums to x.
Return the minimum number of coins of any value that need to be added to the array so that every integer in the range [1... | [] | [{"case_id": "livecodebench__test__3231__public__0000", "expected_output": {"kind": "return_value", "value": "2"}, "input": {"kind": "function_args", "value": {"args": ["[1, 4, 10]\n19"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3231__public__0001", "expected_output": {... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumAddedCoins", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reaso... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3233 | You are given a 0-indexed string s and an integer k.
You are to perform the following partitioning operations until s is empty:
Choose the longest prefix of s containing at most k distinct characters.
Delete the prefix from s and increase the number of partitions by one. The remaining characters (if any) in s maintain... | [] | [{"case_id": "livecodebench__test__3233__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["\"accca\"\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3233__public__0001", "expected_output": {"k... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maxPartitionsAfterOperations", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupp... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3234 | You are given a 0-indexed 2D array variables where variables[i] = [a_i, b_i, c_i, m_i], and an integer target.
An index i is good if the following formula holds:
0 <= i < variables.length
((a_i^bi % 10)^ci) % m_i == target
Return an array consisting of good indices in any order.
Example 1:
Input: variables = [[2,3... | [] | [{"case_id": "livecodebench__test__3234__public__0000", "expected_output": {"kind": "return_value", "value": ["0", "2"]}, "input": {"kind": "function_args", "value": {"args": ["[[2, 3, 3, 10], [3, 3, 3, 1], [6, 1, 1, 4]]\n2"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__32... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "getGoodIndices", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason":... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3235 | You are given two 0-indexed strings source and target, both of length n and consisting of lowercase English letters. You are also given two 0-indexed character arrays original and changed, and an integer array cost, where cost[i] represents the cost of changing the character original[i] to the character changed[i].
You... | [] | [{"case_id": "livecodebench__test__3235__public__0000", "expected_output": {"kind": "return_value", "value": "28"}, "input": {"kind": "function_args", "value": {"args": ["\"abcd\"\n\"acbe\"\n[\"a\", \"b\", \"c\", \"c\", \"e\", \"d\"]\n[\"b\", \"c\", \"b\", \"e\", \"b\", \"e\"]\n[2, 5, 5, 1, 2, 20]"], "kwargs": {}}}, "m... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumCost", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason": nu... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3236 | You are given a 0-indexed array of integers nums.
A prefix nums[0..i] is sequential if, for all 1 <= j <= i, nums[j] = nums[j - 1] + 1. In particular, the prefix consisting only of nums[0] is sequential.
Return the smallest integer x missing from nums such that x is greater than or equal to the sum of the longest seque... | [] | [{"case_id": "livecodebench__test__3236__public__0000", "expected_output": {"kind": "return_value", "value": "6"}, "input": {"kind": "function_args", "value": {"args": ["1", "2", "3", "2", "5"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3236__public__0001", "expected_out... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "missingInteger", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reason":... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3239 | You are given two positive integers x and y.
In one operation, you can do one of the four following operations:
Divide x by 11 if x is a multiple of 11.
Divide x by 5 if x is a multiple of 5.
Decrement x by 1.
Increment x by 1.
Return the minimum number of operations required to make x and y equal.
Example 1:
Inp... | [] | [{"case_id": "livecodebench__test__3239__public__0000", "expected_output": {"kind": "return_value", "value": "3"}, "input": {"kind": "function_args", "value": {"args": ["26\n1"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3239__public__0001", "expected_output": {"kind": "... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "minimumOperationsToMakeEqual", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupp... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3240 | You are given an integer k and an integer x.
Consider s is the 1-indexed binary representation of an integer num. The price of a number num is the number of i's such that i % x == 0 and s[i] is a set bit.
Return the greatest integer num such that the sum of prices of all numbers from 1 to num is less than or equal to k... | [] | [{"case_id": "livecodebench__test__3240__public__0000", "expected_output": {"kind": "return_value", "value": "6"}, "input": {"kind": "function_args", "value": {"args": ["9\n1"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3240__public__0001", "expected_output": {"kind": "r... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "findMaximumNumber", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_reaso... | LiveCodeBench | leetcode | [] | null |
livecodebench__test__3242 | You are given an array nums consisting of positive integers.
Return the total frequencies of elements in nums such that those elements all have the maximum frequency.
The frequency of an element is the number of occurrences of that element in the array.
Example 1:
Input: nums = [1,2,2,3,1,4]
Output: 4
Explanation: T... | [] | [{"case_id": "livecodebench__test__3242__public__0000", "expected_output": {"kind": "return_value", "value": "4"}, "input": {"kind": "function_args", "value": {"args": ["1", "2", "2", "3", "1", "4"], "kwargs": {}}}, "metadata": {}, "visibility": "public"}, {"case_id": "livecodebench__test__3242__public__0001", "expecte... | {"comparison": {"case_sensitive": true, "numeric_tolerance": null, "strip_trailing_whitespace": true, "type": "exact_or_token_match"}, "entry_point": "maxFrequencyElements", "eval_mode": "function_call", "language": "python", "memory_limit_mb": 512, "requires_special_judge": false, "timeout_seconds": 5, "unsupported_re... | LiveCodeBench | leetcode | [] | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.