Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- namespace _01.ParkingLot
- {
- class Program
- {
- static void Main(string[] args)
- {
- HashSet<string> parkingLot = new HashSet<string>();
- var input = Regex.Split(Console.ReadLine(),", ");
- while(input[0] != "END")
- {
- if(input[0] == "IN")
- {
- parkingLot.Add(input[1]);
- }
- else
- {
- parkingLot.Remove(input[1]);
- }
- input = Regex.Split(Console.ReadLine(), ", ");
- }
- if (parkingLot.Count() == 0)
- {
- Console.WriteLine("Parking Lot is Empty");
- }
- foreach(var ch in parkingLot)
- {
- Console.WriteLine(ch);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment