My solution shows runtime error on codechef but works perfectly on my pc (problem code: GIT01)

this is my code
i checked other solution they are using different methods. so just need to know why codechef is showing run time error. kindly help anyone :slight_smile:

your solution runtime error is removed now you can look to it. But your logic gives wrong answer kindly check that.
you are getting runtime bcoz in when you are declaring pattern array of char you are giving it m size which is not initialized yet and may contains some garbage value. I am not giving you an AC code you can work upon that :wink: