C (GCC), 6363 60 bytes
-3 bytes thanks to @Juan Ignacio Díaz
f(v,n,b,j)int*v;{for(b=j=0;j<n-1;b=j=0;n+~j;)b|=v[j/2]<v[++j];return 1-!b;}
Attempt This Online!Attempt This Online!
I know 2 bytes can be saved by inverting the meaningOriginal note of the values 0
and 1
, but I prefer to keep it this way.63 bytes version:
I know 2 bytes can be saved by inverting the meaning of the values
0
and1
, but I prefer to keep it this way.