its showing output [ c, d, e, a, c] for 5 2 a b c d e