working shortest repetition rb soln