When dummy went down, declarer could count only six top tricks. He judged that he needed spades to be 4-4 and either a very favorable position in both minors or hearts 3-3 with the ace onside.
As the last condition seemed to require less, declarer took the lead with dummy’s ♠K and led a low heart away from the king at trick two. East won this with the jack and continued with a low spade. After winning this with dummy’s bare ace, declarer crossed to hand with a low diamond to his king to lead a heart up. West rose with the ♥A and cashed the ♠Q, then played his last spade to his partner’s 10. Declarer threw a diamond and a low club from dummy on the spades while parting with a diamond from hand. After winning the fourth round of spades, East exited with a diamond, taken by declarer with the ace. Declarer then led a low club to dummy’s king and cashed the ♥K. When both opponents followed, declarer had nine tricks: the six top winners and three hearts.
Note that if the ♥K had revealed the suit to have been 4-2, declarer could still have made nine tricks if East had had the ♣Q and either the suit was 3-3 or there was a squeeze in hearts and clubs. The full deal: