Strongest fighter problem

/*
in line 17 why is is not <= same as line 28?
*/

#include
#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int arr[n];
for(int i=0; i<n; i++){
cin>>arr[i];
}
int k;
cin>>k;
deque dq(k);
int i;
for( i=0; i<k; i++)
{
while(!dq.empty() and arr[dq.back()]<arr[i]){
dq.pop_back();
}
dq.push_back(i);
}
for(; i<n; i++)
{
cout<<arr[dq.front()]<<" “;
while(!dq.empty() and dq.front()<=i-k){
dq.pop_front();
}
while(!dq.empty() and arr[dq.back()]<=arr[i]){
dq.pop_back();
}
dq.push_back(i);
}
cout<<arr[dq.front()]<<” ";

return 0;

}

hello @tasfikrahman007
please share ur code using cb ide .
and mention the line no according to it

Here it is -> https://ide.codingblocks.com/s/337918

@tasfikrahman007
use <= at both the places