Is the bus load legal?
Clash Royale CLAN TAG#URR8PPP
up vote
7
down vote
favorite
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]
code-golf number matrix classification
 |Â
show 1 more comment
up vote
7
down vote
favorite
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]
code-golf number matrix classification
Am I misunderstanding this challenge or can[30,31,0]
be[1, 1, 1]
because it's covered bymax3
?
â Okx
10 hours ago
Is swapping truth values allowed? (e.g. any truthy value in place of0
and any falsy one in place of1
?)
â Mr. Xcoder
10 hours ago
@Okx You're misunderstanding something.[x,31,z]
rules outmax1
andmax2
because they don't allow 31 standees.
â Adám
9 hours ago
@Mr.Xcoder Is that usually allowed in challenges like this?
â Adám
9 hours ago
I used to think (see (2)) (also see Martin's comment) this is allowed by default, but I haven't found a meta consensus. I have proceeded by posting this meta question, whose conclusion that the OP should be asked first. I usually allow it, I don't see the reason why they shouldn't be swapped.
â Mr. Xcoder
9 hours ago
 |Â
show 1 more comment
up vote
7
down vote
favorite
up vote
7
down vote
favorite
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]
code-golf number matrix classification
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]
code-golf number matrix classification
edited 10 hours ago
asked 10 hours ago
Adám
27.3k266180
27.3k266180
Am I misunderstanding this challenge or can[30,31,0]
be[1, 1, 1]
because it's covered bymax3
?
â Okx
10 hours ago
Is swapping truth values allowed? (e.g. any truthy value in place of0
and any falsy one in place of1
?)
â Mr. Xcoder
10 hours ago
@Okx You're misunderstanding something.[x,31,z]
rules outmax1
andmax2
because they don't allow 31 standees.
â Adám
9 hours ago
@Mr.Xcoder Is that usually allowed in challenges like this?
â Adám
9 hours ago
I used to think (see (2)) (also see Martin's comment) this is allowed by default, but I haven't found a meta consensus. I have proceeded by posting this meta question, whose conclusion that the OP should be asked first. I usually allow it, I don't see the reason why they shouldn't be swapped.
â Mr. Xcoder
9 hours ago
 |Â
show 1 more comment
Am I misunderstanding this challenge or can[30,31,0]
be[1, 1, 1]
because it's covered bymax3
?
â Okx
10 hours ago
Is swapping truth values allowed? (e.g. any truthy value in place of0
and any falsy one in place of1
?)
â Mr. Xcoder
10 hours ago
@Okx You're misunderstanding something.[x,31,z]
rules outmax1
andmax2
because they don't allow 31 standees.
â Adám
9 hours ago
@Mr.Xcoder Is that usually allowed in challenges like this?
â Adám
9 hours ago
I used to think (see (2)) (also see Martin's comment) this is allowed by default, but I haven't found a meta consensus. I have proceeded by posting this meta question, whose conclusion that the OP should be asked first. I usually allow it, I don't see the reason why they shouldn't be swapped.
â Mr. Xcoder
9 hours ago
Am I misunderstanding this challenge or can
[30,31,0]
be [1, 1, 1]
because it's covered by max3
?â Okx
10 hours ago
Am I misunderstanding this challenge or can
[30,31,0]
be [1, 1, 1]
because it's covered by max3
?â Okx
10 hours ago
Is swapping truth values allowed? (e.g. any truthy value in place of
0
and any falsy one in place of 1
?)â Mr. Xcoder
10 hours ago
Is swapping truth values allowed? (e.g. any truthy value in place of
0
and any falsy one in place of 1
?)â Mr. Xcoder
10 hours ago
@Okx You're misunderstanding something.
[x,31,z]
rules out max1
and max2
because they don't allow 31 standees.â Adám
9 hours ago
@Okx You're misunderstanding something.
[x,31,z]
rules out max1
and max2
because they don't allow 31 standees.â Adám
9 hours ago
@Mr.Xcoder Is that usually allowed in challenges like this?
â Adám
9 hours ago
@Mr.Xcoder Is that usually allowed in challenges like this?
â Adám
9 hours ago
I used to think (see (2)) (also see Martin's comment) this is allowed by default, but I haven't found a meta consensus. I have proceeded by posting this meta question, whose conclusion that the OP should be asked first. I usually allow it, I don't see the reason why they shouldn't be swapped.
â Mr. Xcoder
9 hours ago
I used to think (see (2)) (also see Martin's comment) this is allowed by default, but I haven't found a meta consensus. I have proceeded by posting this meta question, whose conclusion that the OP should be asked first. I usually allow it, I don't see the reason why they shouldn't be swapped.
â Mr. Xcoder
9 hours ago
 |Â
show 1 more comment
10 Answers
10
active
oldest
votes
up vote
3
down vote
Haskell, 22 bytes
map.(and.).zipWith(<=)
Try it online!
add a comment |Â
up vote
2
down vote
APL (Dyalog Unicode), 5 bytes
â§/â¤â¤1
Try it online!
add a comment |Â
up vote
2
down vote
Haskell, 30 bytes
map.((.).(==)<*>(zipWith min))
Try it online!
add a comment |Â
up vote
1
down vote
Jelly, 3 bytes
<Ẹâ¬
Try it online!
0
= True, 1
= False.
If the values needn't be distinct,<§
would work
â Mr. Xcoder
10 hours ago
@Mr.Xcoder I don't think that option is given here. I guess I'll wait and see.
â Erik the Outgolfer
10 hours ago
It is allowed.
â Mr. Xcoder
10 hours ago
1
@Mr.Xcoder Hm, it looks like<§
isn't exactly "truthy-falsy" but rather "falsy-truthy", which, unfortunately, isn't what the challenge asks for.
â Erik the Outgolfer
10 hours ago
@Mr.Xcoder Jelly needsâÂÂ¥
.
â Adám
10 hours ago
add a comment |Â
up vote
1
down vote
Ohm v2, 3 bytes
>ãy
Try it online!
Algorithm: vectorized >
(greater than), ã
sum each, y
sign.
add a comment |Â
up vote
1
down vote
JavaScript (ES6), 38 bytes
Takes input as (matrix)(vector)
. Returns a Boolean array.
m=>v=>m.map(r=>!r.some((t,x)=>v[x]>t))
Try it online!
add a comment |Â
up vote
1
down vote
Japt, 6 bytes
eÃÂèVgY
Try it online!
add a comment |Â
up vote
1
down vote
Python 2, 38 bytes
lambda m,l:[l==map(min,l,r)for r in m]
Try it online!
add a comment |Â
up vote
1
down vote
Retina 0.8.2, 57 bytes
d+
$*
;(?=.*;(.*))
;$1ö
%(+`,1*(1*)(;.*),1$
$2
(1*);1$
Try it online! Link includes test cases, but the output is all run together. Explanation:
d+
$*
Convert to unary.
;(?=.*;(.*))
;$1ö
Give each row of the matrix its own copy of the list.
%(
Operate separately on each row of the matrix.
+`,1*(1*)(;.*),1$
$2
Repeatedly remove the last number of the row and list while the last number of the row is at least as big as that of the list.
(1*);1$
There should then be one number left in the list and the number in the row should be at least as big as that.
add a comment |Â
up vote
0
down vote
MATL, 3 bytes
<~A
Try it online!
Takes the input matrix as a transpose of the format in the question (as allowed by OP), with one column per configuration. Outputs boolean 0 and 1 for false and true.
add a comment |Â
10 Answers
10
active
oldest
votes
10 Answers
10
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Haskell, 22 bytes
map.(and.).zipWith(<=)
Try it online!
add a comment |Â
up vote
3
down vote
Haskell, 22 bytes
map.(and.).zipWith(<=)
Try it online!
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Haskell, 22 bytes
map.(and.).zipWith(<=)
Try it online!
Haskell, 22 bytes
map.(and.).zipWith(<=)
Try it online!
answered 7 hours ago
nimi
29.6k31880
29.6k31880
add a comment |Â
add a comment |Â
up vote
2
down vote
APL (Dyalog Unicode), 5 bytes
â§/â¤â¤1
Try it online!
add a comment |Â
up vote
2
down vote
APL (Dyalog Unicode), 5 bytes
â§/â¤â¤1
Try it online!
add a comment |Â
up vote
2
down vote
up vote
2
down vote
APL (Dyalog Unicode), 5 bytes
â§/â¤â¤1
Try it online!
APL (Dyalog Unicode), 5 bytes
â§/â¤â¤1
Try it online!
answered 8 hours ago
jslip
4316
4316
add a comment |Â
add a comment |Â
up vote
2
down vote
Haskell, 30 bytes
map.((.).(==)<*>(zipWith min))
Try it online!
add a comment |Â
up vote
2
down vote
Haskell, 30 bytes
map.((.).(==)<*>(zipWith min))
Try it online!
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Haskell, 30 bytes
map.((.).(==)<*>(zipWith min))
Try it online!
Haskell, 30 bytes
map.((.).(==)<*>(zipWith min))
Try it online!
answered 8 hours ago
ovs
16.3k2955
16.3k2955
add a comment |Â
add a comment |Â
up vote
1
down vote
Jelly, 3 bytes
<Ẹâ¬
Try it online!
0
= True, 1
= False.
If the values needn't be distinct,<§
would work
â Mr. Xcoder
10 hours ago
@Mr.Xcoder I don't think that option is given here. I guess I'll wait and see.
â Erik the Outgolfer
10 hours ago
It is allowed.
â Mr. Xcoder
10 hours ago
1
@Mr.Xcoder Hm, it looks like<§
isn't exactly "truthy-falsy" but rather "falsy-truthy", which, unfortunately, isn't what the challenge asks for.
â Erik the Outgolfer
10 hours ago
@Mr.Xcoder Jelly needsâÂÂ¥
.
â Adám
10 hours ago
add a comment |Â
up vote
1
down vote
Jelly, 3 bytes
<Ẹâ¬
Try it online!
0
= True, 1
= False.
If the values needn't be distinct,<§
would work
â Mr. Xcoder
10 hours ago
@Mr.Xcoder I don't think that option is given here. I guess I'll wait and see.
â Erik the Outgolfer
10 hours ago
It is allowed.
â Mr. Xcoder
10 hours ago
1
@Mr.Xcoder Hm, it looks like<§
isn't exactly "truthy-falsy" but rather "falsy-truthy", which, unfortunately, isn't what the challenge asks for.
â Erik the Outgolfer
10 hours ago
@Mr.Xcoder Jelly needsâÂÂ¥
.
â Adám
10 hours ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Jelly, 3 bytes
<Ẹâ¬
Try it online!
0
= True, 1
= False.
Jelly, 3 bytes
<Ẹâ¬
Try it online!
0
= True, 1
= False.
answered 10 hours ago
Erik the Outgolfer
29k42697
29k42697
If the values needn't be distinct,<§
would work
â Mr. Xcoder
10 hours ago
@Mr.Xcoder I don't think that option is given here. I guess I'll wait and see.
â Erik the Outgolfer
10 hours ago
It is allowed.
â Mr. Xcoder
10 hours ago
1
@Mr.Xcoder Hm, it looks like<§
isn't exactly "truthy-falsy" but rather "falsy-truthy", which, unfortunately, isn't what the challenge asks for.
â Erik the Outgolfer
10 hours ago
@Mr.Xcoder Jelly needsâÂÂ¥
.
â Adám
10 hours ago
add a comment |Â
If the values needn't be distinct,<§
would work
â Mr. Xcoder
10 hours ago
@Mr.Xcoder I don't think that option is given here. I guess I'll wait and see.
â Erik the Outgolfer
10 hours ago
It is allowed.
â Mr. Xcoder
10 hours ago
1
@Mr.Xcoder Hm, it looks like<§
isn't exactly "truthy-falsy" but rather "falsy-truthy", which, unfortunately, isn't what the challenge asks for.
â Erik the Outgolfer
10 hours ago
@Mr.Xcoder Jelly needsâÂÂ¥
.
â Adám
10 hours ago
If the values needn't be distinct,
<§
would workâ Mr. Xcoder
10 hours ago
If the values needn't be distinct,
<§
would workâ Mr. Xcoder
10 hours ago
@Mr.Xcoder I don't think that option is given here. I guess I'll wait and see.
â Erik the Outgolfer
10 hours ago
@Mr.Xcoder I don't think that option is given here. I guess I'll wait and see.
â Erik the Outgolfer
10 hours ago
It is allowed.
â Mr. Xcoder
10 hours ago
It is allowed.
â Mr. Xcoder
10 hours ago
1
1
@Mr.Xcoder Hm, it looks like
<§
isn't exactly "truthy-falsy" but rather "falsy-truthy", which, unfortunately, isn't what the challenge asks for.â Erik the Outgolfer
10 hours ago
@Mr.Xcoder Hm, it looks like
<§
isn't exactly "truthy-falsy" but rather "falsy-truthy", which, unfortunately, isn't what the challenge asks for.â Erik the Outgolfer
10 hours ago
@Mr.Xcoder Jelly needs
âÂÂ¥
.â Adám
10 hours ago
@Mr.Xcoder Jelly needs
âÂÂ¥
.â Adám
10 hours ago
add a comment |Â
up vote
1
down vote
Ohm v2, 3 bytes
>ãy
Try it online!
Algorithm: vectorized >
(greater than), ã
sum each, y
sign.
add a comment |Â
up vote
1
down vote
Ohm v2, 3 bytes
>ãy
Try it online!
Algorithm: vectorized >
(greater than), ã
sum each, y
sign.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Ohm v2, 3 bytes
>ãy
Try it online!
Algorithm: vectorized >
(greater than), ã
sum each, y
sign.
Ohm v2, 3 bytes
>ãy
Try it online!
Algorithm: vectorized >
(greater than), ã
sum each, y
sign.
answered 9 hours ago
Mr. Xcoder
28.5k755191
28.5k755191
add a comment |Â
add a comment |Â
up vote
1
down vote
JavaScript (ES6), 38 bytes
Takes input as (matrix)(vector)
. Returns a Boolean array.
m=>v=>m.map(r=>!r.some((t,x)=>v[x]>t))
Try it online!
add a comment |Â
up vote
1
down vote
JavaScript (ES6), 38 bytes
Takes input as (matrix)(vector)
. Returns a Boolean array.
m=>v=>m.map(r=>!r.some((t,x)=>v[x]>t))
Try it online!
add a comment |Â
up vote
1
down vote
up vote
1
down vote
JavaScript (ES6), 38 bytes
Takes input as (matrix)(vector)
. Returns a Boolean array.
m=>v=>m.map(r=>!r.some((t,x)=>v[x]>t))
Try it online!
JavaScript (ES6), 38 bytes
Takes input as (matrix)(vector)
. Returns a Boolean array.
m=>v=>m.map(r=>!r.some((t,x)=>v[x]>t))
Try it online!
answered 9 hours ago
Arnauld
60k472252
60k472252
add a comment |Â
add a comment |Â
up vote
1
down vote
Japt, 6 bytes
eÃÂèVgY
Try it online!
add a comment |Â
up vote
1
down vote
Japt, 6 bytes
eÃÂèVgY
Try it online!
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Japt, 6 bytes
eÃÂèVgY
Try it online!
Japt, 6 bytes
eÃÂèVgY
Try it online!
answered 9 hours ago
Luis felipe De jesus Munoz
2,282939
2,282939
add a comment |Â
add a comment |Â
up vote
1
down vote
Python 2, 38 bytes
lambda m,l:[l==map(min,l,r)for r in m]
Try it online!
add a comment |Â
up vote
1
down vote
Python 2, 38 bytes
lambda m,l:[l==map(min,l,r)for r in m]
Try it online!
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Python 2, 38 bytes
lambda m,l:[l==map(min,l,r)for r in m]
Try it online!
Python 2, 38 bytes
lambda m,l:[l==map(min,l,r)for r in m]
Try it online!
answered 8 hours ago
ovs
16.3k2955
16.3k2955
add a comment |Â
add a comment |Â
up vote
1
down vote
Retina 0.8.2, 57 bytes
d+
$*
;(?=.*;(.*))
;$1ö
%(+`,1*(1*)(;.*),1$
$2
(1*);1$
Try it online! Link includes test cases, but the output is all run together. Explanation:
d+
$*
Convert to unary.
;(?=.*;(.*))
;$1ö
Give each row of the matrix its own copy of the list.
%(
Operate separately on each row of the matrix.
+`,1*(1*)(;.*),1$
$2
Repeatedly remove the last number of the row and list while the last number of the row is at least as big as that of the list.
(1*);1$
There should then be one number left in the list and the number in the row should be at least as big as that.
add a comment |Â
up vote
1
down vote
Retina 0.8.2, 57 bytes
d+
$*
;(?=.*;(.*))
;$1ö
%(+`,1*(1*)(;.*),1$
$2
(1*);1$
Try it online! Link includes test cases, but the output is all run together. Explanation:
d+
$*
Convert to unary.
;(?=.*;(.*))
;$1ö
Give each row of the matrix its own copy of the list.
%(
Operate separately on each row of the matrix.
+`,1*(1*)(;.*),1$
$2
Repeatedly remove the last number of the row and list while the last number of the row is at least as big as that of the list.
(1*);1$
There should then be one number left in the list and the number in the row should be at least as big as that.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Retina 0.8.2, 57 bytes
d+
$*
;(?=.*;(.*))
;$1ö
%(+`,1*(1*)(;.*),1$
$2
(1*);1$
Try it online! Link includes test cases, but the output is all run together. Explanation:
d+
$*
Convert to unary.
;(?=.*;(.*))
;$1ö
Give each row of the matrix its own copy of the list.
%(
Operate separately on each row of the matrix.
+`,1*(1*)(;.*),1$
$2
Repeatedly remove the last number of the row and list while the last number of the row is at least as big as that of the list.
(1*);1$
There should then be one number left in the list and the number in the row should be at least as big as that.
Retina 0.8.2, 57 bytes
d+
$*
;(?=.*;(.*))
;$1ö
%(+`,1*(1*)(;.*),1$
$2
(1*);1$
Try it online! Link includes test cases, but the output is all run together. Explanation:
d+
$*
Convert to unary.
;(?=.*;(.*))
;$1ö
Give each row of the matrix its own copy of the list.
%(
Operate separately on each row of the matrix.
+`,1*(1*)(;.*),1$
$2
Repeatedly remove the last number of the row and list while the last number of the row is at least as big as that of the list.
(1*);1$
There should then be one number left in the list and the number in the row should be at least as big as that.
answered 7 hours ago
Neil
73.1k742166
73.1k742166
add a comment |Â
add a comment |Â
up vote
0
down vote
MATL, 3 bytes
<~A
Try it online!
Takes the input matrix as a transpose of the format in the question (as allowed by OP), with one column per configuration. Outputs boolean 0 and 1 for false and true.
add a comment |Â
up vote
0
down vote
MATL, 3 bytes
<~A
Try it online!
Takes the input matrix as a transpose of the format in the question (as allowed by OP), with one column per configuration. Outputs boolean 0 and 1 for false and true.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
MATL, 3 bytes
<~A
Try it online!
Takes the input matrix as a transpose of the format in the question (as allowed by OP), with one column per configuration. Outputs boolean 0 and 1 for false and true.
MATL, 3 bytes
<~A
Try it online!
Takes the input matrix as a transpose of the format in the question (as allowed by OP), with one column per configuration. Outputs boolean 0 and 1 for false and true.
answered 7 hours ago
sundar
3,196820
3,196820
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f170005%2fis-the-bus-load-legal%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Am I misunderstanding this challenge or can
[30,31,0]
be[1, 1, 1]
because it's covered bymax3
?â Okx
10 hours ago
Is swapping truth values allowed? (e.g. any truthy value in place of
0
and any falsy one in place of1
?)â Mr. Xcoder
10 hours ago
@Okx You're misunderstanding something.
[x,31,z]
rules outmax1
andmax2
because they don't allow 31 standees.â Adám
9 hours ago
@Mr.Xcoder Is that usually allowed in challenges like this?
â Adám
9 hours ago
I used to think (see (2)) (also see Martin's comment) this is allowed by default, but I haven't found a meta consensus. I have proceeded by posting this meta question, whose conclusion that the OP should be asked first. I usually allow it, I don't see the reason why they shouldn't be swapped.
â Mr. Xcoder
9 hours ago