I was going through a problem and got stuck in its sub-problem. In simple terms, the sub-problem is ---<br><br>↵
↵
Given an array of size n and q queries. <br>In each query you will get an element **x** and you have to return the largest index **idx** such that **arr[idx] >= x** or state that such index does not exists. If such an index exists, then update its value to x.↵
<br><br>↵
Constraints :<br>↵
1 <= n,q <= 1e5<br>↵
1 <= arr[i],x <= 1e9
↵
Given an array of size n and q queries. <br>In each query you will get an element **x** and you have to return the largest index **idx** such that **arr[idx] >= x** or state that such index does not exists. If such an index exists, then update its value to x.↵
<br><br>↵
Constraints :<br>↵
1 <= n,q <= 1e5<br>↵
1 <= arr[i],x <= 1e9