As almost all the great solutions, this one is also very simple, if it comes into our mind.
Let's see, how could South win the contract:
The opening lead was the Jack of clubs.
Declarer can know from the bidding, that both King of hearts and Ace of diamonds should be at East, so he has to create and elimination against East.
There is a sure way to do it.
Declarer should win the 1st trick with the Ace, he should play the ten od spades in trick 2, winning with the ace in the hand, he should play another spade to the King in case of 2-0 distribution at the defenders, and he should play the Queen of clubs in trick 4.
East has to win it, because it is the 10th trick otherwise, but now South should discard a red card to this suit, and East is eliminated. He either plays a diamond, establishing the King, or he plays a heart from the King, or he plays double chicane.
Yeah, that's why we like bridge!