I am printing the max in every window of k using a queue
What's wrong with my logic?
hello @Avi-Kasliwal-315786729062203

u are pushing element value in place of their index.
due to which this line will not make any sense becuase here u are comparing index with value.
.
to rectify it push index in place of value.
and use a[q.back()] in place of q.back for element comparision.
rest everthing is correct in ur code.