added shortest repetition in C