Mapbar interview question

Write a program solving Mahjong linking games