text: Find a point that lies inside exactly K given squares | PHP implementation of the approach ; Driver Code
code: < ? php function PointInKSquares ( $ n , $ a , $ k ) { sort ( $ a ) ; return $ a [ $ n - $ k ] ; } $ k = 2 ; $ a = array ( 1 , 2 , 3 , 4 ) ; $ n = sizeof ( $ a ) ; $ x = PointInKSquares ( $ n , $ a , $ k ) ; echo " ( " . $ x . " , " ▁ . ▁ $ x ▁ . ▁ " ) " ; ? >