Histogram area/////////////////////////


why run time error

Hello @dakshi,

  1. The answer could also be greater than the range of int as per the constraints given.

  2. The logic you have applied does not covers all cases.

Refer to the following code:


Comments are to increase the understandability.

Let me know if you still have any doubt.