I can't find this game or remember the name
Sounds like Accordion:


  Cards are dealt in a single row, from Left to Right [...]  The goal is
  to move cards onto each other, removing the lower card,  until a
  single card remains. A card may be moved onto a card on  its direct
  left, or third on left, if the card matches the [suit or value] of the
  destination card.


http://www.allgoodsw.com/sol_rules.html#accordion

And see the Wiki Entry for variants.