(b) $W = JH \Rightarrow P \times t = J \times ms\ \mathrm{\Delta}\theta$
$\Rightarrow t = \frac{J \times m \times s\mathrm{\Delta}\theta}{P}\ \ \lbrack For\ water\ 1\ litre = 1\ kg\rbrack$
$\Rightarrow t = \frac{4.2 \times 1 \times 1000 \times (40 - 10)}{836} = 150\ sec$
Short Trick : use formula $t = \frac{4200 \times m \times \mathrm{\Delta}\theta}{P}$