Solve chat, grid paths, and car rentals | Google Interview Question