solved in python with smallest algorithm
solved in python with smallest algorithm