I am trying to merge the elements in a list, the rules are as follows:
1. Merge a list in a way that if 2 consecutive numbers in a list are a same nu