code ran into segmentation fault error.how to fix? : <p>The attached image is the code on hackerrank for a problem i dont know why but it runs into segmentation fault error.Please help me to fix this problem.<a href="https://i.stack.imgur.com/ezoLQ.png" rel="nofollow noreferrer">Code</a>
The error shown is in this link<a href="https://i.stack.imgur.com/QKWky.png" rel="nofollow noreferrer">Error</a></p>
