i ran code on my ide it ran properly and produced output but on submission it is giving
runtime error SIGSEGV. I could understand i am getting here is my solution.
https://www.codechef.com/viewsolution/31838043
try this case,
1
((#^#)|(#&#))
It gave me segmentation fault in your code. I used to code in C++ and moved on to JAVA completely and I’ll leave the debugging part to you. Hope this test case helps in resolving your problem.
thanks i understood my mistake.