Smart Interview Basic Hackerrank Python Intermediate Solution