leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE | |
commit | e1480481481aa22552204b859c9fcc0354b78d2d |
parent | 3249a078cdc8e32636cb365184825213b9bc13de |
author | Dimitrije Dobrota <mail@dimitrijedobrota.com> |
date | Mon, 29 May 2023 07:55:39 +0200 |
Daily Problem
Diffstat:A | Problems/1603.cpp | | | +++++++++++++ |
M | README.md | | | + |
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/Problems/1603.cpp b/Problems/1603.cpp
@@ -0,0 +1,13 @@
class ParkingSystem {
vector<int> space;
public:
ParkingSystem(int big, int medium, int small)
: space(vector<int>{0, big, medium, small}) {}
bool addCar(int carType) {
if (space[carType] == 0) return false;
space[carType]--;
return true;
}
};
diff --git a/README.md b/README.md
@@ -470,6 +470,7 @@ for solving problems.
| 1572 | Easy | [Matrix Diagonal Sum](Problems/1572.cpp) |
| 1579 | Hard | [Remove Max Number of Edges to Keep Graph Fully Traversable](Problems/1579.cpp) |
| 1584 | Medium | [Min Cost to Connect All Points](Problems/1584.cpp) |
| 1603 | Easy | [Design Parking System](Problems/1603.cpp) |
| 1609 | Medium | [Even Odd Tree](Problems/1609.cpp) |
| 1615 | Medium | [Maximal Network Rank](Problems/1615.cpp) |
| 1626 | Medium | [Best Team With No Conflicts](Problems/1626.cpp) |