leetcode

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

commit 3c45b200678617180f71f3e7f7cb6f0df68f0c95
parent aeea7f6d060313e3d945c34812d03dc511dc71f7
Author: Dimitrije Dobrota <mail@dimitrijedobrota.com>
Date:   Sat,  1 Jun 2024 12:13:31 +0200

Daily Problem

Diffstat:
AProblems/3110.cpp | 9+++++++++
MREADME.md | 1+
2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/Problems/3110.cpp b/Problems/3110.cpp @@ -0,0 +1,9 @@ +class Solution { + public: + int scoreOfString(const string &s) const { + int res = 0; + for (int i = 1; i < size(s); i++) + res += abs(s[i] - s[i - 1]); + return res; + } +}; diff --git a/README.md b/README.md @@ -1243,4 +1243,5 @@ for solving problems. | 3100 | Medium | [Water Bottles II](Problems/3100.cpp) | | 3101 | Medium | [Count Alternating Subarrays](Problems/3101.cpp) | | 3106 | Medium | [Lexicographically Smallest String After Operations With Constraint](Problems/3106.cpp) | +| 3110 | Easy | [Score of a String](Problems/3110.cpp) | | 3111 | Medium | [Minimum Rectangles to Cover Points](Problems/3111.cpp) |