human
What is a code to find if k bookings possible with given arrival and departure times and the other steps required given the following:
Find if k bookings possible with given arrival and departure times | Python Code Implementation of the above approach.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to find if k bookings possible with given arrival and departure times and the other steps required.
 def areBookingsPossible ( A , B , K ) :
	A . sort ( )
	B . sort ( )
	for i in range ( len ( A ) ) :
		if i + K < len ( A ) and A [ i + K ] < B [ i ] :
			return " No "
	return " Yes "
if __name__ == " _ _ main _ _ " :
	arrival = [ 1 , 2 , 3 ]
	departure = [ 2 , 3 , 4 ]
	K = 1
	print areBookingsPossible ( arrival , departure , K )