USAA interview question

gave a couple tasks to complete in python