more hackerrank (this week I learned machine learning!)