Write a program that would determine the total number of stops an elevator has taken to serve X number of people.
There is an elevator in a building with M floors. This elevator can take a max of X people at a time or max of total weight Y. Given that a set of people has arrived and their weight and the floor they need to stop at is given, how many stops does the elevator need to take to serve all the people? Considering the elevator serves on a first come first serve basis. (N people in Queue)
Let Array A be the weight of people to be considered A = [60, 80, 40] Let Array B be the floors where person needs to be dropped respectively B = [2, 3, 5] Total building floors be 5, max allowed people in the elevator be 2 at a time with max weight capacity being 200.