text: Find a point that lies inside exactly K given squares | C # implementation of the approach ; Driver Code
code: using System ; class GFG { static int PointInKSquares ( int n , int [ ] a , int k ) { Array . Sort ( a ) ; return a [ n - k ] ; } public static void Main ( String [ ] args ) { int k = 2 ; int [ ] a = { 1 , 2 , 3 , 4 } ; int n = a . Length ; int x = PointInKSquares ( n , a , k ) ; Console . WriteLine ( " ( " + x + " , ▁ " + x + " ) " ) ; } }