Why segmentation fault?
Hello @adityakaunhai,
There are mistakes in your code.
I have corrected them all:
Refer to comments for better understanding.
Hope, this would help.
Give a like if you are satisfied.
1 Like
how to debug code in code blocks? dry running the code is hectic and also sometimes itβs not easy
Hello @adityakaunhai,
What do i do?
-
Read the question again and see if i have missed something.
-
Check if the constraints are being followed properly.
-
Use print statements (i.e. cout) to see the flow of the code.
-
Comment different modules(functions) to identify which module is causing error.
-
Test your code for different possible test cases you can think of.
-
At last, I dry run the code.
Hope, this would help.