Driver code
int main ( ) { int arr [ ] [ 2 ] = { { 5 , 0 } , { 3 , 0 } , { 2 , 0 } , { 6 , 4 } , { 1 , 0 } , { 4 , 3 } } ; int n = sizeof ( arr ) / sizeof ( arr [ 0 ] ) ; int a = 6 , b = 5 ; cout << getDistance ( arr , n , a , b ) ; return 0 ; }