Rain water trapping : run error

Showing run-error in the contest, but working perfectly on the coding blocks IDE.
https://ide.codingblocks.com/#/s/24267

Array you used is of size 100, so if n>100, it will produce a segfault runtime error.

1 Like

Thanks, It worked :slight_smile: