Parking Garage Allocator

Medium Applied C++ OOP Mini Projects
Solve in Playground →

Problem Statement

Implement a `ParkingGarage` class with `capacity`. Process `PARK id` and `LEAVE spot_idx` requests (index 0..capacity-1). Print final array of parked vehicle IDs.

Input Format

Line 1: capacity C. Line 2: N commands.

Output Format

Print vehicle IDs separated by spaces in spots 0..C-1 (use `None` for empty).

Constraints

1 <= C <= 10, 1 <= N <= 20

Sample Input

3
2
PARK V1
PARK V2

Sample Output

V1 V2 None

Explanation

Spots 0 and 1 fill with V1, V2; spot 2 is None.

Starter Code

#include <iostream>
#include <vector>
#include <string>

class ParkingGarage {
public:
    // Write your code here
};

int main() {
    // Implement I/O logic here
    return 0;
}

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used