more hackerrank; reached 320pts