Refined The Checking Algorithm

Checking flipped card is O(1) not O(n^2)