Find the Jar with contaminated pills

You have 5 jars of pills. Each pill weighs 10 gram, except for contaminated pills contained in one jar, where each pill weighs 9 gm. Given a scale, how could you tell which jar had the contaminated pills in just one measurement?

Solution:
Step 1: Take 1,2,3,4 & 5 pills from jars 1,2,3,4 & 5 respectively.
Step 2: The ideal weight should be (1+2+3+4+5)x10= 150gms.
Step 3: Calculate taken pills weight.
Step:4 if jar 1 contains contaminated pills then weight = 1*9 + (2+3+4+5)*10 = 149
if jar 2 contains contaminated pills then weight = 2*9 + (1+3+4+5)*10 = 148
if jar 3 contains contaminated pills then weight = 3*9 + (1+2+4+5)*10 = 147
if jar 4 contains contaminated pills then weight = 4*9 + (1+2+3+5)*10 = 146
if jar 5 contains contaminated pills then weight = 5*9 + (1+2+3+4)*10 = 145

Asked in:

MICROSOFT LOGICAL REASONING QUESTION