Help ! showing wrong answer

hey its working fine for test cases but i cant find where its going wrong
https://www.codechef.com/viewsolution/48615641
@darshancool25

Important compiler warnings to address, first :slight_smile:

[simon@simon-laptop][20:32:22]
[~/devel/hackerrank/otherpeoples]>./compile-latest-cpp.sh 
Compiling piesush-CENS20G.cpp
+ g++ -std=c++14 piesush-CENS20G.cpp -O3 -g3 -Wall -Wextra -Wconversion -DONLINE_JUDGE -D_GLIBCXX_DEBUG -fsanitize=undefined -ftrapv
piesush-CENS20G.cpp: In function ‘int main()’:
piesush-CENS20G.cpp:17:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      for (long long int i=0;i<s.length();i++)
                             ~^~~~~~~~~~~
piesush-CENS20G.cpp:27:5: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
 else;
     ^
piesush-CENS20G.cpp:53:9: warning: statement has no effect [-Wunused-value]
    test2==true;
    ~~~~~^~~~~~
+ set +x
Successful

1 Like

As correctly pointed out by @ssjgz analysis - Please fix line no. 53. It should be test2 = true; :slight_smile:

1 Like

P.S : You could have asked this under official editorial of the problem as well (that way relevant discussions remain at one place), no need to create a new Discuss post !! :slight_smile:

1 Like

hey thanks its working …
but hey this was my first solution… can u pls tell where its going wrong
https://www.codechef.com/viewsolution/48614933