added one-line solution from hackerrank