Please let me know why code is giving segmentation fault
@7nishit
I have fixed your code.
there were 2 mistakes, declaring such a big array (> 1e6) in main().
and comparing s[i] and not s[i-1].
@7nishit
I have fixed your code.
there were 2 mistakes, declaring such a big array (> 1e6) in main().
and comparing s[i] and not s[i-1].