CARVANS - Editorial

Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

Edit:

Neither mind - I can figure it out. Pay attention to compiler warnings!

[simon@simon-laptop][13:37:52]
[~/devel/hackerrank/otherpeoples]>./compile-latest-cpp.sh 
Compiling ansh2002-CARVANS.cpp
Executing command:
  g++ -std=c++17 ansh2002-CARVANS.cpp -O3 -g3 -Wall -Wextra -Wconversion -DONLINE_JUDGE -D_GLIBCXX_DEBUG    -fsanitize=undefined -ftrapv
ansh2002-CARVANS.cpp: In function ‘int main()’:
ansh2002-CARVANS.cpp:5:18: warning: ‘N’ is used uninitialized in this function [-Wuninitialized]
    5 |     int T,N,arr[N],max=1;
      |                  ^
Successful