https://hack.codingblocks.com/app/contests/2022/1054/problem
in this question do we simply need to find the greatest number from i+1 till the last element for all elements,
if so what is the use of circular queue?
if not please give a hint
https://hack.codingblocks.com/app/contests/2022/1054/problem
in this question do we simply need to find the greatest number from i+1 till the last element for all elements,
if so what is the use of circular queue?
if not please give a hint
Reread the question Array is circular
I’m not able to see the use of circular array here maybe I don’t understand the question properly
A circular array is nothing but a normal array only. In this, it is considered that the last element is attached to the first element. Like after the last element, the next element just after it will be the first element. So it’s connected in a circular form.
For example: if the array is [4,3,2], answer would be -1,4,4 as 4 will be the next greater element after both 2 and 3.
Approach Regarding find greater element