HRL Laboratories Interview Question

convert idea to code