leetcode

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

commit 7a6aa671fd415d0207b96b9c9466214afa33d46f
parent 4e616e9cf5c3404c50f7532b3583cfe421bcffd7
Author: Dimitrije Dobrota <mail@dimitrijedobrota.com>
Date:   Sun,  3 Mar 2024 12:09:54 +0000

1 Random Problem

Diffstat:
AProblems/2745.cpp | 7+++++++
MREADME.md | 1+
2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/Problems/2745.cpp b/Problems/2745.cpp @@ -0,0 +1,7 @@ +class Solution { + public: + int longestString(int x, int y, int z) const { + if (x == y) return (x + y + z) * 2; + return (min(x, y) * 2 + z + 1) * 2; + } +}; diff --git a/README.md b/README.md @@ -1129,6 +1129,7 @@ for solving problems. | 2712 | Medium | [Minimum Cost to Make All Characters Equal](Problems/2712.cpp) | | 2740 | Medium | [Find the Value of the Partition](Problems/2740.cpp) | | 2742 | Hard | [Painting the Walls](Problems/2742.cpp) | +| 2745 | Medium | [Construct the Longest New String](Problems/2745.cpp) | | 2780 | Medium | [Minimum Index of a Valid Split](Problems/2780.cpp) | | 2785 | Medium | [Sort Vowels in a String](Problems/2785.cpp) | | 2799 | Medium | [Count Complete Subarrays in an Array](Problems/2799.cpp) |