Help me in solving LB06C problem

My issue

I am not able to make the logic behind it sometime i feel like i have poor reasoning and thinking ability

Learning course: Problem solving in Python
Problem Link: Problem (Flip cards) - Observation in Problem solving in Python