leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE | |
commit | 475eb9b9e6ed1c3561cd8ab9f7db7974ccd395a2 |
parent | 7030976084918117607c80b39c542ff1c0f6a941 |
author | Dimitrije Dobrota <mail@dimitrijedobrota.com> |
date | Mon, 13 Feb 2023 11:36:45 +0100 |
Daily Problem
Diffstat:A | Problems/1523.cpp | | | ++++++ |
M | README.md | | | + |
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/Problems/1523.cpp b/Problems/1523.cpp
@@ -0,0 +1,6 @@
class Solution {
public:
int countOdds(int low, int high) {
return (high - low) / 2 + ((low % 2) | (high % 2));
}
};
diff --git a/README.md b/README.md
@@ -371,6 +371,7 @@ for solving problems.
| 1489 | Hard | [Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree](Problems/1489.cpp) |
| 1514 | Medium | [Path with Maximum Probability](Problems/1514.cpp) |
| 1519 | Medium | [Number of Nodes in the Sub-Tree With the Same Label](Problems/1519.cpp) |
| 1523 | Easy | [Count Odd Numbers in an Interval Range](Problems/1523.cpp) |
| 1544 | Easy | [Make The String Great](Problems/1544.cpp) |
| 1557 | Medium | [Minimum Number of Vertices to Reach All Nodes](Problems/1557.cpp) |
| 1567 | Medium | [Maximum Length of Subarray With Positive Product](Problems/1567.cpp) |