Masai Airline
EasyP3Coding
Passenger i has a check-in bag weighing checkIn[i] kg and a hand bag weighing hand[i] kg. The limits are 15 kg for the check-in bag and 7 kg for the hand bag, both inclusive. Return one string per passenger: "Boarding" if both bags are within their limits, otherwise "Stop".
Example 1
- Input
- checkIn = [10,16,15], hand = [5,5,8]
- Output
- ["Boarding","Stop","Stop"]
- Why
- Passenger 1 is within both limits; passenger 2's check-in bag is over; passenger 3's hand bag is over.
Example 2
- Input
- checkIn = [15], hand = [7]
- Output
- ["Boarding"]
Example 3
- Input
- checkIn = [16], hand = [7]
- Output
- ["Stop"]
Constraints
- 1 <= checkIn.length == hand.length <= 10^5
- 0 <= weights <= 100
Hints
Give it a real attempt first. Run shows which examples fail.
Saved automatically
Run checks the 3 visible tests, Submit all 8. ⌘Enter runs, ⌘⇧Enter submits.