-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Day 22: q1: Minimum Number of Operations to Make Array Empty #438
Comments
Please assign this question to me @kratika-Jangid @karishma-2020 |
please assign this question to me |
Closed
please assign this issue to me. |
@bh-g please assign this issue to me:) |
@bh-g @kratika-Jangid @karishma-2020 please assign this issue to me. I have another approach to solve. |
Please assign this issue to me @bh-g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
Return the minimum number of operations required to make the array empty, or -1 if it is not possible.
Example 1:
Input: nums = [2,3,3,2,2,4,2,3,4]
Output: 4
Explanation: We can apply the following operations to make the array empty:
It can be shown that we cannot make the array empty in less than 4 operations.
Example 2:
Input: nums = [2,1,2,2,3,3]
Output: -1
Explanation: It is impossible to empty the array.
Constraints:
problem link: https://leetcode.com/problems/minimum-number-of-operations-to-make-array-empty/description/?envType=daily-question&envId=2024-01-04
The text was updated successfully, but these errors were encountered: