Ad
  • Custom User Avatar
    1. first refused because there are no tables for one (+1)
    2. second refused for the same reason (+1)
    3. third and four accepted because there is an available table for two (+0).

    Finally, there is one empty table for two and another one used for ne group of two clients.

    The first and second clients may have been proposed a table for two if a > 0 and if all tables for one were used.

  • Custom User Avatar

    Yes,

    1. tables for two can be full moon or last quarter or new moon.
    2. tables for one can only be full moon or new moon.
  • Custom User Avatar

    (...looks like moon phases to me... 8o ... XD )

  • Custom User Avatar

    Nice one.
    I suggest to add a visual description.

    First example :

    1 || 🌕 || 🌑 🌑 || 0

    2 || 🌕 || 🌕 🌑 || 0

    1 || 🌕 || 🌕 🌗 || 0

    1 || 🌕 || 🌕 🌕 || 0

    Denied : 0

    Second example :

    1 || 🌕 || 🌑 || 0

    1 || 🌕 || 🌗 || 0

    2 || 🌕 || 🌗 || 2

    1 || 🌕 || 🌕 || 0

    Denied : 2

  • Custom User Avatar

    13 people are denied service, and 13 is the expected answer. Where's the problem?

  • Custom User Avatar

    in javascript, total denied number is more than N group, and even bigger than N person, is it a bug?

    restaurant( 2, 1, [2,1,2,2,2,2,1,2,1,2] ) = 13 ???