I will show you the full hand
But I am not sure what is the best line. You have option of finesse spade, finesse
♦Q, try to guess diamonds, or some kind of endplay - squeeze.
Problem is that you can not safely rectify the count and as you see, playing on diamonds loses. But this is one of those hand where, there is a pressure on a defender who has too many goodies, so strip squeeze w/o the count operate. Only problem is you have to guess what to discard from dummy on the last H ( spade or club), but if you play for the above disctribution, you will be rich rewarded.
Now you cash last heart throwing club from dummy and play a king of spades. RHO last 3 cards and Qxx
♠ and A
♦.. Now diamond play finishes east as he has to lead into spade menace.
Can this line lose compared to other? It can, if RHO has a club to cash for example or keeps Ax
♦. I guess it takes some good reading at the ending whether to play for this, or finesse a spade. ( you had to discard club threat previously)