Example #1
0
        public static void SwapParkingLots()
        {
            var obj   = new CareerCupQnA();
            var input = new List <EmployeeParkingInfo>
            {
                new EmployeeParkingInfo
                {
                    EmployeeName     = "A",
                    FromBuildingName = "1",
                    ToBuildingName   = "2",
                },
                new EmployeeParkingInfo
                {
                    EmployeeName     = "B",
                    FromBuildingName = "3",
                    ToBuildingName   = "2",
                },
                new EmployeeParkingInfo
                {
                    EmployeeName     = "C",
                    FromBuildingName = "1",
                    ToBuildingName   = "4",
                },
                new EmployeeParkingInfo
                {
                    EmployeeName     = "D",
                    FromBuildingName = "2",
                    ToBuildingName   = "1",
                },
                new EmployeeParkingInfo
                {
                    EmployeeName     = "F",
                    FromBuildingName = "5",
                    ToBuildingName   = "2",
                },
                new EmployeeParkingInfo
                {
                    EmployeeName     = "G",
                    FromBuildingName = "9",
                    ToBuildingName   = "2",
                }
            };
            var output = obj.SwapParkingLots(input);

            foreach (var s in output)
            {
                Console.WriteLine(s);
            }
        }