| Action | Tickets Earned |
|---|---|
Complete Daily Challenge | +1 |
10-Day Streak | +10 |
20-Day Streak | +20 |
30-Day Streak | +30 |
LinkedIn post with #30DaysofCode Everyday (and tag Educative) | +2 per post |
Most-Liked Post Overall | +20 |
Top of Leaderboard | +50 |
Leaderboard: 2nd place | +30 |
Leaderboard: 3rd place | +20 |
You are given a nums consisting of distinct elements.
In a single operation, you can remove either the first element or the last element of nums.
Return the minimum number of deletions needed to remove both the minimum element and the maximum element from the array.
Constraints:
nums.length
nums[i]
The integers in nums are distinct.
| Action | Tickets Earned |
|---|---|
Complete Daily Challenge | +1 |
10-Day Streak | +10 |
20-Day Streak | +20 |
30-Day Streak | +30 |
LinkedIn post with #30DaysofCode Everyday (and tag Educative) | +2 per post |
Most-Liked Post Overall | +20 |
Top of Leaderboard | +50 |
Leaderboard: 2nd place | +30 |
Leaderboard: 3rd place | +20 |
You are given a nums consisting of distinct elements.
In a single operation, you can remove either the first element or the last element of nums.
Return the minimum number of deletions needed to remove both the minimum element and the maximum element from the array.
Constraints:
nums.length
nums[i]
The integers in nums are distinct.