sir, in this whole code arr[i] ki value har loop chalne ke baad increment to kahi ho nhi rhi ???
Increment of arr[i] value
for (int i = 0; i < arr.length; i++) {
int num = arr[i];
nextGreaterElement(arr, i + 1, num);
}
thats incrementing i every time