leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

commit f7408deb1ef4deaea2cade8be3ef00adcf25479c
parent b5d04334931cf217697c36889b65adf7bb3669c1
Author: Dimitrije Dobrota <mail@dimitrijedobrota.com>
Date:   Mon, 15 Jul 2024 21:44:58 +0200

1 Random Problem

Diffstat:
AProblems/3192.cpp | 13+++++++++++++
MREADME.md | 1+
2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/Problems/3192.cpp b/Problems/3192.cpp @@ -0,0 +1,13 @@ +class Solution { + public: + int minOperations(const vector<int> &nums) const { + int res = 0; + + for (const int n : nums) { + if ((n + res) % 2) continue; + res++; + } + + return res; + } +}; diff --git a/README.md b/README.md @@ -1286,5 +1286,6 @@ for solving problems. | 3110 | Easy | [Score of a String](Problems/3110.cpp) | | 3111 | Medium | [Minimum Rectangles to Cover Points](Problems/3111.cpp) | | 3159 | Medium | [Find Occurrences of an Element in an Array](Problems/3159.cpp) | +| 3192 | Medium | [Minimum Operations to Make Binary Array Elements Equal to One II](Problems/3192.cpp) | | 3195 | Medium | [Find the Minimum Area to Cover All Ones I](Problems/3195.cpp) | | 3211 | Medium | [Generate Binary Strings Without Adjacent Zeros](Problems/3211.cpp) |