C # program previous greater element An efficient solution to print previous greater element for every element in an array .
using System ; using System . Collections . Generic ; class GFG { static void prevGreater ( int [ ] arr , int n ) {