Check if all array elements can be removed by the given operations | C # program to implement the above approach ; Function to check if it is possible to remove all array elements ; Condition if we can remove all elements from the array ; Driver Code
using System ; class GFG { static void removeAll ( int [ ] arr , int n ) { if ( arr [ 0 ] < arr [ n - 1 ] ) Console . Write ( " YES " ) ; else Console . Write ( " NO " ) ; } public static void Main ( String [ ] args ) { int [ ] Arr = { 10 , 4 , 7 , 1 , 3 , 6 } ; int size = Arr . Length ; removeAll ( Arr , size ) ; } }