code working but test cases giving run time error.
Sort Game challenge
Hi @GreatCoderboy123
You are getting run time error because you are making f[1000] but in the question it is mentioned that n<=100000 so you have to make f[100001] . Also after doing this you will get rid of run error but still face wrong ans because of the way your are comparing the strings. You have to add bool operator> for comparing the two strings.
Here is your corrected code :
ok…
is it possible to not use the bool datatype in a function and solve this question
Yes you can avoid using bool operator by simply in the if case include all the conditions in bool operator function and then return true or false according. In this ques you have to compare strings so you have to use all these conditions in order to compare strings.
ok…thanks…