leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE | |
commit | aaf0d36bf2738d925161020a41bc304b2d0a4592 |
parent | 465ba507ffa258b00f7a4f31800045f5181fa687 |
author | Dimitrije Dobrota <mail@dimitrijedobrota.com> |
date | Mon, 20 Feb 2023 08:01:38 +0100 |
Random Problem
Diffstat:A | Problems/2177.cpp | | | ++++++++ |
M | README.md | | | + |
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/Problems/2177.cpp b/Problems/2177.cpp
@@ -0,0 +1,8 @@
class Solution {
public:
vector<long long> sumOfThree(long long num) {
if (num % 3) return {};
long long a = num / 3;
return {a - 1, a, a + 1};
}
};
diff --git a/README.md b/README.md
@@ -423,6 +423,7 @@ for solving problems.
| 2115 | Medium | [Find All Possible Recipes from Given Supplies](Problems/2115.cpp) |
| 2130 | Medium | [Maximum Twin Sum of a Linked List](Problems/2130.cpp) |
| 2131 | Medium | [Longest Palindrome by Concatenating Two Letter Words](Problems/2131.cpp) |
| 2177 | Medium | [Find Three Consecutive Integers That Sum to a Given Number](Problems/2177.cpp) |
| 2181 | Medium | [Merge Nodes in Between Zeros](Problems/2181.cpp) |
| 2192 | Medium | [All Ancestors of a Node in a Directed Acyclic Graph](Problems/2192.cpp) |
| 2235 | Easy | [Add Two Integers](Problems/2235.cpp) |