Smart Interviews Basic Hackerrank Problem