I was in the bus today, and noticed this sign:
seated standing wheelchairs
max1 37 30 00
max2 36 26 01
max3 34 32 00
The number of seated passengers, standees, and wheelchairs all have to be no larger than some row in the table. (See chat for details.)
For the purposes of this challenge we will generalise this idea: Given a non-negative integer list of a strictly positive length N (number of passenger types) and a non-negative integer matrix of strictly positive dimensions (N columns and one row per configuration, or the transpose of this), return a list of indices/truthy-falsies/two-unique-values indicating which configurations limits are fulfilled.
E.g. with the above matrix:
30,25,1
→ [1]
(0-indexed) [2]
(1-indexed) or [false,true,false]
(Boolean) or ["Abe","Bob","Abe"]
(two unique values) etc.
The following test cases use the above matrix and the 0/1 for false/true:
[30,30,0]
→ [1,0,1]
[30,31,0]
→ [0,0,1]
[35,30,0]
→ [1,0,0]
[0,0,1]
→ [0,1,0]
[0,0,0]
→ [1,1,1]
[1,2,3]
→ [0,0,0]
The following test cases use the following matrix:
1 2 0 4
2 3 0 2
[1,2,1,2]
→ [0,0]
[1,3,0,1]
→ [0,1]
[1,2,0,3]
→ [1,0]
[1,2,0,1]
→ [1,1]
[30,31,0]
be[1, 1, 1]
because it's covered bymax3
? \$\endgroup\$0
and any falsy one in place of1
?) \$\endgroup\$[x,31,z]
rules outmax1
andmax2
because they don't allow 31 standees. \$\endgroup\$