//{ Driver Code Starts #include using namespace std; // } Driver Code Ends class Solution { public: //Function to find the next greater element for each element of the array. vector nextLargerElement(vector arr, int n){ // Your code here stack s; vector ans(n,0); for(int i=0;i>t; while(t--) { int n; cin>>n; vector arr(n); for(int i=0;i>arr[i]; Solution obj; vector res = obj.nextLargerElement(arr, n); for (long long i : res) cout << i << " "; cout<