The solution to the "how to wreck your life" problem posed here was also pointed out accurately in the comments. Partner would have led a diamond from an original holding of Qxxx. Also, we can extend our counting exercise to partner's hand. They led their fourth best club, are marked with a singleton heart, so their most likely shape is 4144.
Here is a more advanced example of the count-crunching-machine in play.
1S = no four card major
When East elected to lead his diamond and West gave him a ruff, can you deduce the East-West hands ?
Diamonds are known to be 1- 5; hearts are known to be 4-3; spades rate to be 4-1 and so the clubs have to be 4-4. A check of our calculations shows that 1354 (West) and 4414 (East) is consistent with the bidding and their system.
On the question of high cards, East has to have AKJ10 of spades (ruffs the diamond with the spade ten)and the Ace of clubs. West has already shown up with the diamond ace.
At the table, the defence (after the diamond ruff) continued with Ace and another club. Only the Club/heart jacks are unaccounted for; can declarer make this contract irrespective of their location or is it another case of the patient dying ?