Find Valid IP Addresses in Files | Amazon Coding Question