Skip to main content

Practice · 2 of 5

Parking lot state machine

CHALLENGE
Difficulty: beginner+25 XP

Implement the Parking nested class: constructor stores capacity and creates state; arrive(plate) adds the plate if not already present and not full (true/false); depart(plate) removes it if present; count() returns occupied spots.

Back to lesson: Practice: Design reps