結果 : reduce function hackerrank solution