Driver code
public static void main ( String [ ] args ) { ArrayList mat = new ArrayList ( ) ; mat . add ( new pair ( 0 , 0 ) ) ; mat . add ( new pair ( 1 , 0 ) ) ; mat . add ( new pair ( 2 , 0 ) ) ; System . out . println ( numTrip ( mat ) ) ; } }