While, I had initially marked my answer as 8, I realised my mistake and then ended up getting the correct answer as 10.
Here's what I got incorrect in my first approach and how I rectified it:
First Approach: 5H + 4S = 56 (Notice I have equated the amount to 56 as that's the max. amount that he can spend)
H = (56-4S)/5
S min = 1 (as he purchases both, hamburgers and shakes)
When S = 1, H = (56-4)/5 which is not a positive integral value, hence we drop this as the number of hamburgers has to be a positive interger.
Similarly, for S = 2 and 3, we obtain fractional values of H, which are invalid.
When S = 4, H = (56-16)/5 = 8
Hence, I marked the answer as 8 in my first attempt. HOWEVER, NOTICE: WE HAD EQUATED THE AMOUNT TO 56, WHICH IS WRONG!
It is wrong because we did not account for the cases when amount is less than 56, for example - what about the number of hamburgers when the amount = 55 or 54 or 53 or so on?
To solve this in the best possible way, use the Trial and Error Method using S min:
5H + 4S = 56 (S min = 1)
Let's try for H = 11 and S = 1 => 5*11 + 4*1 => 55+ 4 = 59 (invalid as it is greater than 56)
Now, let's try for H = 10 => 5*10 + 4*1 = 54 (valid as it is lesser than 56)
Here, if you observe, we get H = 10 (as opposed to 8 in the first approach), hence the correct answer is 10. (Option D)