[LeetCode] Minimum Number of Operations to Make Array Empty

2870. Minimum Number of Operations to Make Array Empty

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 number of operations required to make the array empty, or -1 if it is not possible.

Read more
[LeetCode] Minimum Operations to Collect Elements

2869. Minimum Operations to Collect Elements

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.

Read more
[Codeforces] Educational Round 133 (Rated for Div. 2) C. Robot in a HallwayRead more
[Codeforces] Educational Codeforces Round 133 (Rated for Div. 2) D. Chip MoveRead more
[Codeforces] Round 814 (Div. 1) B. Fibonacci StringsRead more
[Codeforces] COMPFEST 14 - Preliminary Online Mirror (Unrated, ICPC Rules, Teams Preferred) C. Circular MirrorRead more
[Codeforces] Round 819 (Div. 1 + Div. 2) and Grimoire of Code Annual Contest 2022 D. Edge SplitRead more
[Codeforces] Round 888 (Div. 3) F. Lisa and the MartiansRead more
[Codeforces] Educational Round 152 (Rated for Div. 2) D. Array PaintingRead more
[Codeforces] Educational Round 152 (Rated for Div. 2) C. Binary String CopyingRead more