Garage
Garage
#include <iostream>
#include <filesystem>
#include <string>
#include <map>
#include <vector>
#define CAR_SIZE 3
class Garage
vector<int> freeSpots[CAR_SIZE];
counter = (counter+1)%TOTAL_TICKETS;
return counter;
public:
Garage(vector<int> &totalSpots);
};
Garage::Garage(vector<int> &totalSpots)
vector<int> spots;
spots.push_back(j);
freeSpots[i] = spots;
return false;
if(freeSpots[carSize].size() <= 0)
occupiedSpots[carSize][ticketNumber] = freeSpot;
return true;
freeSpots[carSize].push_back(freeSpot);
occupiedSpots[carSize].erase(ticketNumber);
return ticketNumber;
int main() {
vector<int> spots;
//Garage::initializeTicketCounter();
{
spots.push_back(20);
Garage garage(spots);
garage.arrive(1);
garage.depart(2, 100);
return 0;