We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c2dd14 commit 0cc7ed4Copy full SHA for 0cc7ed4
1 file changed
kotlin/1603-design-parking-system.kt
@@ -0,0 +1,13 @@
1
+class ParkingSystem(big: Int, medium: Int, small: Int) {
2
+
3
+ val spaces = intArrayOf(big, medium, small)
4
5
+ fun addCar(carType: Int): Boolean {
6
+ if (spaces[carType - 1] > 0) {
7
+ spaces[carType - 1]--
8
+ return true
9
+ }
10
+ return false
11
12
13
+}
0 commit comments