Is the bus load legal?

The name of the pictureThe name of the pictureThe name of the pictureClash 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]







share|improve this question





















  • 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










  • @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










  • 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















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]







share|improve this question





















  • 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










  • @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










  • 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













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]







share|improve this question













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]









share|improve this question












share|improve this question




share|improve this question








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 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










  • @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










  • 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










  • 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










  • @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











10 Answers
10






active

oldest

votes

















up vote
3
down vote













Haskell, 22 bytes



map.(and.).zipWith(<=)


Try it online!






share|improve this answer




























    up vote
    2
    down vote














    APL (Dyalog Unicode), 5 bytes



    ∧/≤⍤1


    Try it online!






    share|improve this answer




























      up vote
      2
      down vote














      Haskell, 30 bytes





      map.((.).(==)<*>(zipWith min))


      Try it online!






      share|improve this answer




























        up vote
        1
        down vote














        Jelly, 3 bytes



        <Ẹ€


        Try it online!



        0 = True, 1 = False.






        share|improve this answer





















        • 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

















        up vote
        1
        down vote














        Ohm v2, 3 bytes



        >Σy


        Try it online!



        Algorithm: vectorized > (greater than), Σ sum each, y sign.






        share|improve this answer




























          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!






          share|improve this answer




























            up vote
            1
            down vote














            Japt, 6 bytes



            eȨVgY


            Try it online!






            share|improve this answer




























              up vote
              1
              down vote














              Python 2, 38 bytes





              lambda m,l:[l==map(min,l,r)for r in m]


              Try it online!






              share|improve this answer




























                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.






                share|improve this answer




























                  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.






                  share|improve this answer





















                    Your Answer




                    StackExchange.ifUsing("editor", function ()
                    return StackExchange.using("mathjaxEditing", function ()
                    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
                    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
                    );
                    );
                    , "mathjax-editing");

                    StackExchange.ifUsing("editor", function ()
                    StackExchange.using("externalEditor", function ()
                    StackExchange.using("snippets", function ()
                    StackExchange.snippets.init();
                    );
                    );
                    , "code-snippets");

                    StackExchange.ready(function()
                    var channelOptions =
                    tags: "".split(" "),
                    id: "200"
                    ;
                    initTagRenderer("".split(" "), "".split(" "), channelOptions);

                    StackExchange.using("externalEditor", function()
                    // Have to fire editor after snippets, if snippets enabled
                    if (StackExchange.settings.snippets.snippetsEnabled)
                    StackExchange.using("snippets", function()
                    createEditor();
                    );

                    else
                    createEditor();

                    );

                    function createEditor()
                    StackExchange.prepareEditor(
                    heartbeatType: 'answer',
                    convertImagesToLinks: false,
                    noModals: false,
                    showLowRepImageUploadWarning: true,
                    reputationToPostImages: null,
                    bindNavPrevention: true,
                    postfix: "",
                    onDemand: true,
                    discardSelector: ".discard-answer"
                    ,immediatelyShowMarkdownHelp:true
                    );



                    );








                     

                    draft saved


                    draft discarded


















                    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






























                    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!






                    share|improve this answer

























                      up vote
                      3
                      down vote













                      Haskell, 22 bytes



                      map.(and.).zipWith(<=)


                      Try it online!






                      share|improve this answer























                        up vote
                        3
                        down vote










                        up vote
                        3
                        down vote









                        Haskell, 22 bytes



                        map.(and.).zipWith(<=)


                        Try it online!






                        share|improve this answer













                        Haskell, 22 bytes



                        map.(and.).zipWith(<=)


                        Try it online!







                        share|improve this answer













                        share|improve this answer



                        share|improve this answer











                        answered 7 hours ago









                        nimi

                        29.6k31880




                        29.6k31880




















                            up vote
                            2
                            down vote














                            APL (Dyalog Unicode), 5 bytes



                            ∧/≤⍤1


                            Try it online!






                            share|improve this answer

























                              up vote
                              2
                              down vote














                              APL (Dyalog Unicode), 5 bytes



                              ∧/≤⍤1


                              Try it online!






                              share|improve this answer























                                up vote
                                2
                                down vote










                                up vote
                                2
                                down vote










                                APL (Dyalog Unicode), 5 bytes



                                ∧/≤⍤1


                                Try it online!






                                share|improve this answer














                                APL (Dyalog Unicode), 5 bytes



                                ∧/≤⍤1


                                Try it online!







                                share|improve this answer













                                share|improve this answer



                                share|improve this answer











                                answered 8 hours ago









                                jslip

                                4316




                                4316




















                                    up vote
                                    2
                                    down vote














                                    Haskell, 30 bytes





                                    map.((.).(==)<*>(zipWith min))


                                    Try it online!






                                    share|improve this answer

























                                      up vote
                                      2
                                      down vote














                                      Haskell, 30 bytes





                                      map.((.).(==)<*>(zipWith min))


                                      Try it online!






                                      share|improve this answer























                                        up vote
                                        2
                                        down vote










                                        up vote
                                        2
                                        down vote










                                        Haskell, 30 bytes





                                        map.((.).(==)<*>(zipWith min))


                                        Try it online!






                                        share|improve this answer














                                        Haskell, 30 bytes





                                        map.((.).(==)<*>(zipWith min))


                                        Try it online!







                                        share|improve this answer













                                        share|improve this answer



                                        share|improve this answer











                                        answered 8 hours ago









                                        ovs

                                        16.3k2955




                                        16.3k2955




















                                            up vote
                                            1
                                            down vote














                                            Jelly, 3 bytes



                                            <Ẹ€


                                            Try it online!



                                            0 = True, 1 = False.






                                            share|improve this answer





















                                            • 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














                                            up vote
                                            1
                                            down vote














                                            Jelly, 3 bytes



                                            <Ẹ€


                                            Try it online!



                                            0 = True, 1 = False.






                                            share|improve this answer





















                                            • 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












                                            up vote
                                            1
                                            down vote










                                            up vote
                                            1
                                            down vote










                                            Jelly, 3 bytes



                                            <Ẹ€


                                            Try it online!



                                            0 = True, 1 = False.






                                            share|improve this answer














                                            Jelly, 3 bytes



                                            <Ẹ€


                                            Try it online!



                                            0 = True, 1 = False.







                                            share|improve this answer













                                            share|improve this answer



                                            share|improve this answer











                                            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
















                                            • 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










                                            up vote
                                            1
                                            down vote














                                            Ohm v2, 3 bytes



                                            >Σy


                                            Try it online!



                                            Algorithm: vectorized > (greater than), Σ sum each, y sign.






                                            share|improve this answer

























                                              up vote
                                              1
                                              down vote














                                              Ohm v2, 3 bytes



                                              >Σy


                                              Try it online!



                                              Algorithm: vectorized > (greater than), Σ sum each, y sign.






                                              share|improve this answer























                                                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.






                                                share|improve this answer














                                                Ohm v2, 3 bytes



                                                >Σy


                                                Try it online!



                                                Algorithm: vectorized > (greater than), Σ sum each, y sign.







                                                share|improve this answer













                                                share|improve this answer



                                                share|improve this answer











                                                answered 9 hours ago









                                                Mr. Xcoder

                                                28.5k755191




                                                28.5k755191




















                                                    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!






                                                    share|improve this answer

























                                                      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!






                                                      share|improve this answer























                                                        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!






                                                        share|improve this answer













                                                        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!







                                                        share|improve this answer













                                                        share|improve this answer



                                                        share|improve this answer











                                                        answered 9 hours ago









                                                        Arnauld

                                                        60k472252




                                                        60k472252




















                                                            up vote
                                                            1
                                                            down vote














                                                            Japt, 6 bytes



                                                            eȨVgY


                                                            Try it online!






                                                            share|improve this answer

























                                                              up vote
                                                              1
                                                              down vote














                                                              Japt, 6 bytes



                                                              eȨVgY


                                                              Try it online!






                                                              share|improve this answer























                                                                up vote
                                                                1
                                                                down vote










                                                                up vote
                                                                1
                                                                down vote










                                                                Japt, 6 bytes



                                                                eȨVgY


                                                                Try it online!






                                                                share|improve this answer














                                                                Japt, 6 bytes



                                                                eȨVgY


                                                                Try it online!







                                                                share|improve this answer













                                                                share|improve this answer



                                                                share|improve this answer











                                                                answered 9 hours ago









                                                                Luis felipe De jesus Munoz

                                                                2,282939




                                                                2,282939




















                                                                    up vote
                                                                    1
                                                                    down vote














                                                                    Python 2, 38 bytes





                                                                    lambda m,l:[l==map(min,l,r)for r in m]


                                                                    Try it online!






                                                                    share|improve this answer

























                                                                      up vote
                                                                      1
                                                                      down vote














                                                                      Python 2, 38 bytes





                                                                      lambda m,l:[l==map(min,l,r)for r in m]


                                                                      Try it online!






                                                                      share|improve this answer























                                                                        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!






                                                                        share|improve this answer














                                                                        Python 2, 38 bytes





                                                                        lambda m,l:[l==map(min,l,r)for r in m]


                                                                        Try it online!







                                                                        share|improve this answer













                                                                        share|improve this answer



                                                                        share|improve this answer











                                                                        answered 8 hours ago









                                                                        ovs

                                                                        16.3k2955




                                                                        16.3k2955




















                                                                            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.






                                                                            share|improve this answer

























                                                                              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.






                                                                              share|improve this answer























                                                                                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.






                                                                                share|improve this answer














                                                                                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.







                                                                                share|improve this answer













                                                                                share|improve this answer



                                                                                share|improve this answer











                                                                                answered 7 hours ago









                                                                                Neil

                                                                                73.1k742166




                                                                                73.1k742166




















                                                                                    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.






                                                                                    share|improve this answer

























                                                                                      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.






                                                                                      share|improve this answer























                                                                                        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.






                                                                                        share|improve this answer














                                                                                        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.







                                                                                        share|improve this answer













                                                                                        share|improve this answer



                                                                                        share|improve this answer











                                                                                        answered 7 hours ago









                                                                                        sundar

                                                                                        3,196820




                                                                                        3,196820






















                                                                                             

                                                                                            draft saved


                                                                                            draft discarded


























                                                                                             


                                                                                            draft saved


                                                                                            draft discarded














                                                                                            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













































































                                                                                            Comments

                                                                                            Popular posts from this blog

                                                                                            What is the equation of a 3D cone with generalised tilt?

                                                                                            Color the edges and diagonals of a regular polygon

                                                                                            Relationship between determinant of matrix and determinant of adjoint?