>>442
c++
https://ideone.com/yBU6PG

sortしてuniqするだけ、45行