Epic Interview Question

Terminal number parser.