Parking Garage Allocator

Medium Applied OOP Mini Projects
Solve in Playground →

Problem Statement

Implement a `ParkingGarage` class with `capacity`. Process PARK / LEAVE spot requests (index 0..capacity-1). Print final array of parked vehicle IDs (or None for empty representation).

Input Format

Line 1: capacity C. Line 2: N commands (PARK id, LEAVE spot_idx).

Output Format

Print space-separated vehicle IDs 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

class ParkingGarage:
    pass

if __name__ == '__main__':
    # Implement I/O logic here
    pass

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