Important compiler warnings to address, first
[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
As correctly pointed out by @ssjgz analysis - Please fix line no. 53. It should be
test2 = true;
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 !!
hey thanks its working …
but hey this was my first solution… can u pls tell where its going wrong