AKUNA CAPITAL interview question

Card matching problem