Count Valid Infection Orders | Uber Coding Question