text:
Visible Dice Faces
A traditional Western die is a cube, on which the integers 1 to 6 are marked on the faces. Pairs that add to 7 are placed on opposite faces.
As it is cube, we can only see between 1 and 3 faces (inclusive)1 at any given time. Opposite faces can never be seen at the same time.
Your task is to write a program or function which, given a list of integers representing sides on a die, determines if it is possible to see these faces at the same time.
1Okay, maybe you can see 4 or 5 faces with a pair of eyes, but for the purpose of this challenge we observing the die from a single point.

Rules:

Your submission may assume the input list:

Is non-empty.
Only contains values which satisfy 1 ≤ n ≤ 6.
Contains no duplicate elements.

You may not assume that the input is sorted.
Your submission should output a truthy / falsy value: truthy is the faces can be seen at the same time, falsy otherwise.
This is code-golf, so the shortest answer (in bytes) wins!
Standard loopholes are forbidden by default.

Test Cases
Truthy:
[6]                 (One face)
[6, 2]              (Share a side)
[1, 3]              (Share a side)
[2, 1, 3]           (Share a vertex)
[3, 2, 6]           (Share a vertex)

Falsy:
[1, 6]              (1 and 6 are opposite)
[5, 4, 2]           (2 and 5 are opposite)
[3, 1, 4]           (3 and 4 are opposite)
[5, 4, 6, 2]        (Cannot see 4 faces)
[1, 2, 3, 4, 5, 6]  (Cannot see 6 faces)

Related.

It seems that the last two falsey cases are superfluous as any list longer than 3 will contain opposing values, no?

@WeckarE yes, obviously - if you have a look at the answers they all exploit this. It was just an easier explanation to write.

@FlipTack Actually you don't have to check the length at all, every list longer than 3 elements has at least one pair of opposite sides.

@EriktheOutgolfer Yes, that's exactly the point I was making - of course I realised that when making the challenge, but it doesn't make my explanations for those test cases invalid.

You can still see up to 5 faces from a single point if you bent the light waves with something heavy like a black hole

@Ferrybig So a mirror would be cheating, but a black hole is fair game? :-)

Suggested test case: [1, 2, 4]. There's a 33 byte regex that, if abbreviated to 26 bytes, gives this a false negative because it has three or more numbers that add up to 7.

Suggested test case: [2, 3, 4]. All of the current Falsy test cases have the first and last element add up to 7, and will still pass if the first .*\b is removed from all of my unary regexes, dropping their length by 4 bytes.

JavaScript (ES6),  38 34 30 29  28 bytes
Takes input as any number of separate parameters. Returns 0 or 1.
(a,b,c,d)=>!(d|(a^b^c)%7)^!c

Test cases

let f =

(a,b,c,d)=>!(d|(a^b^c)%7)^!c

console.log('[Truthy]')
console.log(f(6      ))
console.log(f(6, 2   ))
console.log(f(1, 3   ))
console.log(f(2, 1, 3))
console.log(f(3, 2, 6))

console.log('[Falsy]')
console.log(f(1, 6            ))
console.log(f(5, 4, 2         ))
console.log(f(3, 1, 4         ))
console.log(f(5, 4, 6, 2      ))
console.log(f(1, 2, 3, 4, 5, 6))

How?
Below are simplified versions of the main expression according to the number of parameters provided, undefined variables being coerced to either 0 or false:
# of param. | simplified expression        | comment
------------+------------------------------+---------------------------------------------
     1      | !(a % 7) ^ 1                 | always true
     2      | !((a ^ b) % 7) ^ 1           | false for (1,6), (2,5) and (3,4)
     3      | !((a ^ b ^ c) % 7)           | see the table below
     4+     | !(d | (a ^ b ^ c) % 7)       | always false

NB: The order of (a,b,c) doesn't matter because they're always XOR'd together.
The trickiest case is the 3rd one. Here is a table showing all possible combinations:
a | b | c | a^b^c | %7 | =0? | faces that sum to 7
--+---+---+-------+----+-----+--------------------
1 | 2 | 3 |   0   |  0 | Yes | none
1 | 2 | 4 |   7   |  0 | Yes | none
1 | 2 | 5 |   6   |  6 | No  | 2 + 5
1 | 2 | 6 |   5   |  5 | No  | 1 + 6
1 | 3 | 4 |   6   |  6 | No  | 3 + 4
1 | 3 | 5 |   7   |  0 | Yes | none
1 | 3 | 6 |   4   |  4 | No  | 1 + 6
1 | 4 | 5 |   0   |  0 | Yes | none
1 | 4 | 6 |   3   |  3 | No  | 1 + 6
1 | 5 | 6 |   2   |  2 | No  | 1 + 6
2 | 3 | 4 |   5   |  5 | No  | 3 + 4
2 | 3 | 5 |   4   |  4 | No  | 2 + 5
2 | 3 | 6 |   7   |  0 | Yes | none
2 | 4 | 5 |   3   |  3 | No  | 2 + 5
2 | 4 | 6 |   0   |  0 | Yes | none
2 | 5 | 6 |   1   |  1 | No  | 2 + 5
3 | 4 | 5 |   2   |  2 | No  | 3 + 4
3 | 4 | 6 |   1   |  1 | No  | 3 + 4
3 | 5 | 6 |   0   |  0 | Yes | none
4 | 5 | 6 |   7   |  0 | Yes | none

Alt. version #1, 32 bytes
Takes input as an array. Returns a boolean.
a=>a.every(x=>a.every(y=>x+y-7))

Test cases

let f =

a=>a.every(x=>a.every(y=>x+y-7))

console.log('[Truthy]')
console.log(f([6]      ))
console.log(f([6, 2]   ))
console.log(f([1, 3]   ))
console.log(f([2, 1, 3]))
console.log(f([3, 2, 6]))

console.log('[Falsy]')
console.log(f([1, 6]            ))
console.log(f([5, 4, 2]         ))
console.log(f([3, 1, 4]         ))
console.log(f([5, 4, 6, 2]      ))
console.log(f([1, 2, 3, 4, 5, 6]))

Alt. version #2, Chrome/Firefox, 34 bytes
This one abuses the sort methods of Chrome and Firefox. It doesn't work with Edge.
Takes input as an array. Returns 0 or 1.
a=>a.sort((a,b)=>k&=a+b!=7,k=1)&&k

Test cases

let f =

a=>a.sort((a,b)=>k&=a+b!=7,k=1)&&k

console.log('[Truthy]')
console.log(f([6]      ))
console.log(f([6, 2]   ))
console.log(f([1, 3]   ))
console.log(f([2, 1, 3]))
console.log(f([3, 2, 6]))

console.log('[Falsy]')
console.log(f([1, 6]            ))
console.log(f([5, 4, 2]         ))
console.log(f([3, 1, 4]         ))
console.log(f([5, 4, 6, 2]      ))
console.log(f([1, 2, 3, 4, 5, 6]))

Python 2, 35 bytes
lambda a:any(7-i in a for i in a)<1

Try it online!

-1 byte in Python 3.

@notjagan -1 more by replacing …<{1} with plain not…

Haskell, 24 bytes
-3 bytes thanks to H.PWiz.
f l=all(/=7)$(+)<$>l<*>l

Try it online!
Explanation
f l=all(/=7)$(+)<$>l<*>l

f l=                      -- make a function f that takes a single argument l
             (+)<$>l<*>l  -- take the sum of each pair in the cartesian product...
    all(/=7)$             -- ...and check if they're all inequal to 7

Regex (Perl / Java / PCRE2 v10.34+), 30 29 27 bytes
^(?!.*:(x(\2?+:.*\b)?){7}:)

Takes its input in unary, as a concatenation of strings of x characters whose lengths represent the numbers, separated and enclosed on both sides by : characters. Example: :x:xxxxxx: represents [1, 6].
Try it online! - Perl
Try it online! - Java
Attempt This Online! - PCRE2 v10.40+
This is an adaptation of the 31 30 28 byte version below, but it prevents more than one split from occurring in a somewhat more complex manner. Upon matching a split, \2 captures the intervening elements, including commas – or just a single comma if there are no intervening elements.
How this prevents more than one split would be simple to explain if (?(2)\2) were used instead of \2?+. Then the mechanism would be that on subsequent attempts to match a splitting after one has already occurred, that would be forced to coincide with matching a duplicate element, or two commas in a row.
But \2?+ will successfully make an empty match if \2 is not an exact match at that position. However, note that if this did happen, it could only result in false negatives (returning "False" incorrectly) – never false positives – because it could make the pattern inside the negative lookahead match when it shouldn't, but it can't prevent a match that should have happened.
All lists of 4 or more numbers will return "False", so the addition of false negatives won't matter. And lists of 2 or fewer elements can only match one split anyway (where \2 captures a single comma alone), so no false negatives could result there.
So we only need to consider lists of 3 elements:

Only two splits can occur at most, and if that is the case, \2 will contain exactly one comma. The first split prevents a second split from being matched because \2?+, would only match two commas in a row.
Or if a split matches one intervening element, only one split can occur anyway, so there's no place for a second split to match.

And here is a test harness with all 156 lists of 3 or fewer elements, demonstrating this regex to work correctly:
Try it online! - Perl
Regex (Perl / Java / Pythonregex / Ruby / PCRE), 31 30 28 bytes
^(?!.*:(x\2?+(:).*\b|x){7}:)

Try it online! - Perl
Try it online! - Java
Try it online! / Attempt This Online! - Python (with regex)
Try it online! - Ruby
Try it online! - PCRE
This is an adaptation of the 33 32 31 29 byte version below, but it prevents more than one split from occurring with \2?+(,), which forces a split to coincide with matching two commas in a row (which can never happen in the input specification) if a split has already occurred.
Regex (Perl / Boost / Python / Pythonregex / Ruby / PCRE / .NET), 33 32 31 29 bytes
^(?!.*:(?(1)x|x(:.*\b)?){7}:)

Try it online! - Perl
Try it online! - Boost
Try it online! / Attempt This Online! - Python
Try it online! / Attempt This Online! - Python (with regex)
Try it online! - Ruby
Try it online! - PCRE
Try it online! - .NET
This works by asserting that no two numbers add up to exactly 7. It does this by consuming exactly 7 x characters – a split is allowed to occur at any point within this, but not more than once.
^             # Anchor to start
(?!           # Negative lookahead - assert that the following can't match:
    .*:           # Skip to after any occurrence of a bounding character,
                  # which denotes the beginning of a number's unary
                  # representation.
    (?(1)         # Conditional upon whether \1 is set:
        # If \1 is set:
        x             # tail -= 1
    |
        # If \1 is unset:
        # (This is only allowed to match once within this loop. There is no
        # need to verify afterward that it matched exactly once, because the
        # input specification allows us to assume there will be no numbers
        # greater than 6 – so, 7 will never appear.)
        x             # tail -= 1
        (
            :.*\b         # Complete the match for the current number, and
                          # skip to the beginning of any subsequent number's
                          # unary representation.
        )?            # Match the above optionally
    ){7}          # Iterate the above exactly 7 times; this can never result in
                  # the 7th iteration ending in a split, as that would require
                  # matching 7 x's in a row, but the input is guaranteed not to
                  # contain a 7.
    :             # Assert that tail == 0 (i.e, that this is the end of a
                  # number's unary representation)
)

Strangely, this actually works with Python's re library, even though (?(2)...) is a forward-declared conditional, and re doesn't support forward-declared or nested backreferences; \2 in that position would throw an error.
Equally strangely, it works in Boost, even though that regex engine doesn't support nested or forward-declared backreferences either, and a \2 in that position would cause Boost to throw an error as well.
The previous 33 byte version did not work properly with Python's re; it used a nested conditional, and Python silently treated that as a no-op, making the regex return some false negatives. But strangely, that version works in Pythonregex, even though that engine doesn't support nested backreferences either.
Regex (Perl / Java / Pythonregex / Ruby / PCRE / .NET), 34 33 32 30 bytes
^(?!.*:(x(?!\2):.*\b()|x){7}:)

Try it online! - Perl
Try it online! - Java
Try it online! / Attempt This Online! - Python (with regex)
Try it online! - Ruby
Try it online! - PCRE
Try it online! - .NET
This adds Java support to the above 33 32 31 29 byte version, by removing the use of the conditional (?(2)...). Support for Python and Boost is dropped, due to the use of the nested backreference \2.
Regex (ECMAScript 2018 / Pythonregex / .NET), 41 36 34 bytes
^(?!(.*:)(\b(?<=^\1x+).*:x|x){7}:)

Try it online! - ECMAScript 2018
Try it online! / Attempt This Online! - Python (with regex)
Try it online! - .NET
^             # Anchor to start
(?!           # Negative lookahead - assert that the following can't match:
    (.*:)         # Skip to after any occurrence of a bounding character,
                  # which denotes the beginning of a number's unary
                  # representation;
                  # \1 = the entire portion of the string that has been
                  # skipped, going all the way back to its beginning.
    (
        \b            # Assert that we're on a word boundary
        # The below is only allowed to match once within this loop. There is
        # no need to verify afterward that it matched exactly once, because
        # the input specification allows us to assume there will be no numbers
        # greater than 6 (so, 7 will never appear).
        (?<=          # Lookbehind - evaluated from right to left (so in this
                      # listing, read it from bottom to top)
            ^         # Assert this is the start of the string
            \1        # Match \1
            x+        # Skip back to the beginning of the unary representation
                      # of the current number
        )
        .*:           # Complete the match for the current number, and skip
                      # to the beginning of any subsequent number's unary
                      # representation.
        x             # tail -= 1
    |              # or...
        x             # tail -= 1 (and do nothing else)
    ){7}          # Iterate the above exactly 7 times; this can never result in
                  # the 7th iteration ending in a split, as that would require
                  # matching 7 x's in a row, but the input is guaranteed not to
                  # contain a 7.
    :             # Assert that tail == 0 (i.e, that this is the end of a
                  # number's unary representation)
)

A previous 41 byte version using lookbehind appears to expose a bug in Pythonregex:
^(?!(.*\b)x+(,.*\b)x+\b(?<=^\1(\2?x){7}))

Try it online! - ECMAScript 2018 - works
Attempt This Online! - Python (with regex) - does not work
Try it online! - .NET - works
Upon investigation, the bug actually has nothing to do with lookbehind. I reported it here and it is now fixed.
Regex (ECMAScript or better), 73 69 46 41 40 39 37 bytes
^(?!.*:(?=x*(.*))(x(?=\1).+\b|x){7}:)

Try it online! - ECMAScript (SpiderMonkey)
Try it online! - ECMAScript 2018 (Node.js)
Try it online! - Perl
Try it online! - Java
Try it online! - Boost
Try it online! - Python
Try it online! / Attempt This Online! - Python (with regex)
Try it online! - Ruby
Try it online! - PCRE
Try it online! - .NET
This now ports the 33 32 31 byte version's algorithm to support ECMAScript:
^             # Anchor to start
(?!           # Negative lookahead - assert that the following can't match:
    .*:           # Skip to after any occurrence of a bounding character,
                  # which denotes the beginning of a number's unary
                  # representation.
    (?=x*(.*))    # \1 = the entire string following the current number's
                  #      unary representation
    (
        x             # tail -= 1
        # The below is only allowed to match once within this loop. There is
        # no need to verify afterward that it matched exactly once, because
        # the input specification allows us to assume there will be no numbers
        # greater than 6 (so, 7 will never appear).
        (?=\1)        # Assert that the entire string following the current
                      # position matches what was captured in \1, which
                      # accomplishes two things – it asserts that we
                      # haven't skipped to another number yet, and that
                      # we've finished consuming the entire current number,
                      # i.e. that tail == 0.
        .+\b          # Skip to the beginning of any subsequent number's
                      # unary representation (the first character skipped
                      # will be a comma).
    |              # or...
        x             # tail -= 1 (and do nothing else)
    ){7}          # Iterate the above exactly 7 times; this can never result in
                  # the 7th iteration ending in a split, as that would require
                  # matching 7 x's in a row, but the input is guaranteed not to
                  # contain a 7.
    \b            # Assert that tail == 0 (i.e, that this is the end of a
                  # number's unary representation)
)

The previous 73 69 byte version worked by treating every possible pair of numbers that add to 7 as a separate case, like the decimal version below:
^(?!(?=.*\bx\b).*x{6}|(?=.*\bxx\b).*\bx{5}\b|(?=.*\bxxx\b).*\bx{4}\b)

Regex (.NET), 46 bytes
^(?!.*\b(){7}(?<-1>x)+,.*\b(?<-1>x)+(?(1)^)\b)

Obsoleted by the 33 32 byte version above.
Regex (Perl / Boost / Python / Ruby / PCRE / .NET), 58 bytes
^(?!.*\b(x)?(xx)?(xxxx,.*\b|,.*\bxxxx)(?(2)|xx)(?(1)|x)\b)

Obsoleted by the versions above. Worked by capturing two numbers in binary, and asserting that the second number has all 3 of its lowermost bits flipped when compared to the first number (and asserting that this doesn't occur anywhere in the input).
Regex (ECMAScript or better), 38 37 bytes
^(?!(?=.*1).*6|(?=.*2).*5|(?=.*3).*4)

Takes its input in decimal. There is no need for delimiters, because the full range fits into a single digit.
Try it online! - ECMAScript / Perl / Java / Python / .NET
Pure regex is very limited in what math can be done on decimal input, so this version just asserts that no two numbers occur anywhere in the list that add up to 7, by exhaustively listing all the pairs that could do so.

Test harness for Python

Cubically, 41 34 bytes
$(7:*-!F-!S-!B'-!B'-!S-!F$):0+>2=%

Try it online!

Takes input as a space-separated list of integers, printing 1 for true and 0 for false.
Explanation:
$(7 ... $)

For every integer in the input...
:*

Place it in the notepad, and multiply it by itself.
Cubically can only use values in one of its nine memory locations, and the notepad is the only one that can be freely read or written, so I perform the next calculation "scaled up" by the current input value itself, memory location 7--since it's nonzero and doesn't change until we read a new integer (or character) with $ (or ~). This is shorter than using a face we don't modify as the scale factor, because the notepad is the implicit argument for * and the input is the implicit argument for -.
-!F

Subtract the input from the notepad. If this makes it 0 (the original input was 1), rotate the front face of the memory Rubik's Cube once clockwise.
Doing this once replaces a row of 0s on face 0 with 1; doing this again replaces those 1s with 5s.
-!S-!B'-!B'-!S-!F

Repeat for the other five possible values: rotate the front if it's 6, the middle if it's 2 or 5, and the back if it's 3 or 4. (The back rotations have to be clockwise with respect to the front, so they're actually counterclockwise B' with respect to the back.)
:0+>2

After the loop, set the notepad to the sum of face 0, add it to itself, and check if it's strictly greater than the sum of face 2.
Face 0 contains a mix of 0, 1, and 5, and we want to discriminate between cases where it contains any 5s and cases where it doesn't. The greatest sum it can have without 5s is 9, and the least sum it can have with 5s is 15 (since only whole rows at a time are moved without being mixed, it has to be a multiple of 3), so doubling it turns 9 into 18, which is the sum of face 2 (since none of the rotations performed in the loop affected face 2).
=%

Output whether or not the notepad equals the input buffer.
The input buffer is set to 0 after exhausting the input, and the notepad contains 1 if the faces can't all be seen or 0 if they can, so comparing them for equality inverts that to satisfy the challenge's truthiness requirement.

Mathematica, 20 bytes
xFreeQ[#+x&/@x,7]

The  is \[Function]
-12 bytes from Martin Ender
-7 bytes from  Misha Lavrov
Try it online!

APL (Dyalog), 7 bytes
~7∊∘.+⍨

Try it online!
∘.+⍨ - addition table (every element with every element)
7∊ - 7 exists?
~ - negate

APL (Dyalog), 7 bytes
⍬≡⊢∩7-⊢

Try it online!
7-⊢ - subtract each element from 7
⊢∩ - intersect with the original array
⍬≡ - empty?

R, 27 bytes
thanks to Gregor for fixing a bug
function(d)!any((7-d)%in%d)

Try it online!
Port of Chas Brown's answer. Having vectorized operations helps make this much shorter in R.

I think you need some parens around (7-d), other wise d%in%d takes precedence.

@Gregor you're absolutely right.

Retina, 21 20 bytes
O`.
M`1.*6|2.*5|34
0

Try it online! Link includes test cases. Edit: Saved 1 byte thanks to @MartinEnder. Explanation:
O`.

Sort the input.
M`1.*6|2.*5|34

Check for a pair of opposite sides (3 and 4 sort next to each other). This returns 1 for an invalid die or 0 for a valid one.
0

Logically negate the result.

Nibbles, 5.5 bytes (11 nibbles)
-~+.$?@- 7

For each element x of input, checks tbat 7-x is not present in the input.
Outputs 1 (truthy) if faces can be seen at the same time, and negative value (falsy) if they cannot.
-~+.$?@- 7
   .        # map over
    $       # input:
     ?      #   index of (or 0 if absent)
      @     #   in input
            #   of
       - 7  #   7 minus
            #   (implicit) each element
  +         # sum the list
-~          # and subtract from 1.
            # (0 and negative values are falsy,
            # 1 is truthy)

Thunno D, 7 \$5\log_{256}(96)\approx\$ 4.12 bytes
7_Gze

Attempt This Online!
7_     # subtract each from 7
  G    # map each to the input with it removed
   ze  # all equal?

Now beating tied with the language's creator!

Wow, you beat the language's creator!

@Deadcode And all because of a weird interpreter thing--G is supposed to run on the whole array, but for some reason it vectorizes to each element which is why I have to check if all are equal instead of check if it is empty.

Wow. I didn't even know I had implemented a command like G - especially a one-character command

@TheThonnu I think you implemented it incorrectly because its function doesn't really match its description... But it still came in handy here!

Also, sorry for posting my own answer after yours. If I had seen your answer, I would have commented it as a suggestion.

@TheThonnu That's alright, competition is fun :) Especially when I win :P

You're not winning any more :P

Nekomata + -e, 4 bytes
ᵒ+7f

Attempt This Online!
ᵒ+     Generate a 2d table with addition
  7f   Check if the result is free of 7.

-e prints True if the computation has any result, and False otherwise.
Let's take [3,1,4] as an example. ᵒ+ returns the 2d array [[6,4,7],[4,2,5],[7,5,8]], which contains 7. So the result is False.

Jelly, 5 bytes
7_f⁸Ṇ

Try it online!
Port of Chas Brown's answer.
Explanation
7_f⁸Ṇ
7_    Subtract each element from 7
  f⁸  Filter with the original list
    Ṇ Check if empty

Haskell, 26 bytes
f x=null[1|7<-(+)<$>x<*>x]

Try it online!

Pyth, 5 bytes
!@-L7

Try it here.

I could swear I tried this two minutes ago and it didn’t work... Huh I wonder what went wrong

First thing I thought of? The Sandlot.

Actually, 8 bytes
;∙♂Σ7@cY

Try it online! (runs all the test cases)
Explanation:
;∙♂Σ7@cY
;∙        Cartesian product with self
  ♂Σ      sum all pairs
    7@c   count 7s
       Y  logical negate

Husk, 5 bytes
Ëo≠7+

Try it online!
Explanation
Ëo     Check that the following function gives a truthy value for all pairs
       from the input.
    +    Their sum...
  ≠7     ...is not equal to 7.

Perl 6, 18 bytes
!(1&6|2&5|3&4∈*)

Try it online!
1 & 6 | 2 & 5 | 3 & 4 is a junction consisting of the numbers 1 and 6, OR the numbers 2 and 5, OR the numbers 3 and 4.  This junction is an element of (∈) the input list * if it contains 1 and 6, or 2 and 5, or 3 and 4.  That result is then negated (!) to get the required boolean value.

Jelly, 4 bytes
7_ḟƑ

Try it online!
Relatively trivial golf of Erik's solution.
7_      For each face, subtract it from 7.
   Ƒ    Is the list of results unchanged by
  ḟ     filtering out elements of the original input?

Needless to say, a simple 7_f would win if inverted output were permitted.

Nibbles, 6 bytes
-~,`&.$- 7$

Attempt This Online!
Disgusting. Surely there is a better way to do this.

Well, still disgusting, but at least half a byte shorter...

Vyxal, 4 bytes
7ε↔¬

Try it Online!
Very simple answer, ports the approach of the 5 byte Jelly.
Explained
7ε↔¬
7ε    # Abs difference of 7 with each item in the input
  ↔   # Remove items in that list that are also in the input
   ¬  # Logical negation - empty list turns into 1, non-empty turns into 0

Shouldn't the explanation of '↔' read 'keep' instead of 'remove'?

Thunno D, \$ 5 \log_{256}(96) \approx \$ 4.12 bytes
7_cS!

Attempt This Online! or verify all test cases
Explanation
7_cS!  # Implicit input
7_     # Subtract each from 7
  c    # Is each in the input?
   S!  # All are false?
       # Implicit output

Pyth, 5 bytes
-7sM*

Test suite.
isaacg saved a byte!

Ruby, 36 31 24 23 bytes
->l{l-l.map{|x|7-x}==l}

Try it online!
It was so simple, I was looking for the solution to the wrong problem all the time.

Alice, 18 bytes
/..y1nr@
\iReA6o/

Try it online!
Prints Jabberwocky for valid inputs and nothing otherwise.
Explanation
Unfolding the zigzag control flow, the program is really just:
i.e16r.RyAno

i.  Read all input and duplicate it.
e16 Push "16".
r   Range expansion to get "123456".
.R  Duplicate and reverse.
y   Transliterate, replaces each face with its opposite.
A   Intersection with input.
n   Logical NOT, turns empty strings into "Jabberwocky"
    and everything else into an empty string.

Retina, 20 bytes
T`_654`d
M`(.).*\1
0

Try it online!
An alternative to Neil's approach.
Explanation
T`_654`d

Turn 6,5, 4 into 1, 2, 3, respectively.
M`(.).*\1

Try to find repeated characters and count the number of matches.
0

Make sure the result was zero (effectively a logical negation).

C (GCC), 77 bytes
i,j;r;f(v,l)int*v;{for(i=r=-1;++i<l;)for(j=0;j<l;)r*=v[i]+v[j++]-7;return r;}

Try It Online!
Explanation:
i,j;r;
f(v,l)int*v;
{
    // i and r are both initialized to -1. i is incremented by 1 before the
    // loop, making its value equal 0, and for each iteration of the loop,
    // until it's out of bounds of v.
    for(i=r=-1;++i<l;)
        // j also loops through the vector
        for(j=0;j<l;)
            // If v[i]+v[j] == 7, set r to 0, otherwise multiply it by
            // something. If i == j, the sum will never equal 7 since a whole
            // number multiplied by 2 is never odd. Otherwise, the numbers
            // will equal 7 if they're on opposite sides of the die.
            r*=v[i]+v[j++]-7;
    return r;
}

65 bytes

Desmos, 45 39 bytes
f(x)=0^{[(7-i-x)^2.minfori=x.sort].min}

Try it on Desmos!

TI-Basic, 26 bytes
max(seq(min(7-I≠Ans),I,1,dim(Ans

Takes input in Ans.

Vyxal, 4 bytes
7εF⁼

Try it Online!
7ε   # 7 - each item
  F  # Remove values that are in ^
   ⁼ # Is it equal to the original?

Factor + sets.extras, 24 bytes
[ 7 over n-v disjoint? ]

Try it online!
          ! { 2 1 3 }
7         ! { 2 1 3 } 7
over      ! { 2 1 3 } 7 { 2 1 3 }
n-v       ! { 2 1 3 } { 5 6 4 }
disjoint? ! t    (i.e. is the intersection empty?)

Japt -x!, 5 bytes
fUma7

Try it or verify test cases
-1 byte thanks to Shaggy
This is basically a port of Lyxal's Vyxal answer.
fUma7  x!
f          # elements in both the input and
 Um        #   the input, with each num mapped to
   a7      #     its absolute difference with 7
       x!  # flags: x = sum, ! = logical not

Nicely done :) You can reverse it for 5 bytes: fUma7.

Japt -!, 5 bytes
ï+ ø7

Try it

Wow took me until today to realize that builtin meant cartesian product, very confusing description LOL. I thought it was [1, 2, 3] [4, 5, 6] -> [[1, 4], [2, 5], [3, 6]]

Scala, 50 bytes
Try it online!
def f(a:Seq[Int])=a.forall(i=> !(a.contains(7-i)))

Thunno 2, 4 bytes
7_ṗ⁼

Attempt This Online!
Explanation
      # implicit input
7_    # subtract from 7
  ṗ   # set difference
   ⁼  # exactly equal
      # implicit output

05AB1E, 5 bytes
7αå_P

Try it online!
Explanation
7α      # absolute difference between 7 an each in input list
  å     # check each element if it exist in input
   _    # logical negate
    P   # product of list

One of several ways to do this in 5 bytes in 05AB1E

Perl 5, 51 + 1 (-a) = 52 bytes
say$F[0]+($t=$F[1])-7&&$F[0]+$t-7&&$t+$F[2]-7&&@F<4

Try it online!

3 1 4 gives true, what about say 1>grep{$x=$_;grep$_+$x==7,@F}@F

25 + 1 (-p) inspired from sed solution

Clean, 49 bytes
import StdEnv
f l=and[(a+b)<>7\\(a,b)<-diag2 l l]

Try it online!

@StephenLeppik I don't think this answer is necessarily using the file name to store information.

@StephenLeppik Oh fair point there, the import is required but the function doesn't need to be declared in a specific module. Thanks.

GNU sed, 37 22 + 1 = 23 bytes
+1 byte for -r flag. Takes input as digits; prints the input for truthy and 0 for falsy.
-10 bytes thanks to @MartinEnder.
y/123/654/
/(.).*\1/c0

Try it online!
Explanation
Similar to @MartinEnder’s Alice answer.
y/123/654/   # Transliterate 1-3 to 6-4
/(.).*\1/c0  # If a digit appears twice, replace the pattern space with 0

It doesn't exactly print the input for truthy, it prints the input with 1-3 replaced by 6-4.

J, 12 bytes
7-.@e.[:,+/~

This is pretty much the same as the first APL solution by Uriel
Try it online!

Java (OpenJDK 8), 43 bytes
l->l.stream().noneMatch(x->l.contains(7-x))

Try it online!

Swift, 46 bytes
f(a:Int)->[Int]{!a.contains{a.contains(7-$0)}}

Takes input as [Int] (integer array) and returns a Bool (boolean).
Short Explanation (ungolfed)
f(a:Int)->[Int]{
    !a.contains (where: {n in    // The input doesn't have an element where
        a.contains(7 - n)        //    the opposite side is in the input
    })
}

Clojure, 89 80 72 bytes
-9 bytes because I realized use of reduced is unnecessary
-8 bytes by changing from using reduce to using some
#(if(< 0(count %)4)(not(some(fn[[a b]](=(+ a b)7))(for[a % b %][a b]))))

I tried writing this without looking at any of the tricks other answers use. I may be able to improve on this later.
Returns true for true cases, false if any sides sum to 7, and nil if the number of sides is illegal.

(defn can-see? [dice-sides]
  ; Ensure its a valid length
  (if (< 0 (count dice-sides) 4)

    ; Then check if any of the permutations sum to 7
    (not (some (fn [[a b]]
                 (= (+ a b) 7))

               ; Generate all permutations
               (for [a dice-sides, b dice-sides] [a b])))))

jq, 25 bytes
[.[] as $s|$s+.[]==7]|any

Try it online!
Generates all comparisons side + side == 7, and outputs true if any are.
Saves quite a bit over the obvious answer:
[combinations(2)|add]|contains([7])

Python, 55 Bytes
lambda x:all(all(int(a)+int(b)-7 for a in x)for b in x)

7ry 17 0n11n3

Haskell, 46 41 37 bytes
f z=all ((/=7).sum) [[x,y]|x<-z,y<-z]

Takes the Cartesian product of the list with itself, then checks if all of the resulting lists do not sum to 7. (If any of them summed to 7, opposite faces would be visible, and "all do not" is shorter than "not any do".)

IBM/Lotus Notes Formula, 7 bytes
!7-i*=i

Takes input from a multi-value number field i.
Recursively subtracts each value of i from 7 and checks to see if it is in the original list. ! changes the 1 if it is to a 0 (faces cannot all be seen).
Test Cases (no TIO available for Notes Formula)


text:
Google's doodle on kids coding: shortest program solving all the levels
Today's Google doodle is about Celebrating 50 years of Kids Coding:
The goal is program the path of a little bunny so that it can eat all the carrots. There are 4 types of blocks (see pictures below):

From left to right:

O("...", k) = orange piece: these are for loops which executes k times the program "...".
G = green piece: go one step forward if you can, otherwise do nothing
Bl = blue piece: turn right and stay on the same block
Br = blue piece: turn left and stay on the same block

The code above can be written as
O(O(G G Br, 4) Bl Bl, 23)

Each block (G, Bl, Br, O(...,k)) counts as 1 unit, so this program is of length 7. Note than the value of k is included inside the 1 unit of O.
There are 6 levels. To finish a level you need to eat all the carrots. It is not a problem if your program is not fully executed, the level finishes directly when you eat the last carrot.
We assume that all the 4 types of blocks are available in every level.

Your task is to find a single program which solves every level of the game.
   Shortest program in blocks wins.

Screen shots of each level:
Level 1:
Level 2:
Level 3:
Level 4:
Level 5:
Level 6:

Not my answer
6 blocks
The user Alex found a shorter solution, of length 6. I can confirm that their solution works:
O(O(Br G G, 6) Br, 5)

They attempted to edit this question to add this answer, so I'm assuming they want it to be displayed here. I don't like how the reputation system works around here.
The message they left:

The editor doesn't have 10 rep, but does have a solution of length 6. O(O(RGG,6)R,5)

After a few days they responded again via editing the post with: "Thanks for doing this. Editing this was the only way I saw to get a message. I am happy it exists at all. Feel free to bring it into a new post if you want though."
Old answer
7 Blocks
O(O(G G Br, 4) G Br, 100)

Patience required.
Edit: The image was wrong.

Good find! I did try this approach but didn't happen on this particular combination before giving up and going for my 9 block solution.

The user Alex claims to have found a shorter solution.

@JonathanFrech indeed he has! That 10-rep limit is annoying. I get that we have to prevent spam, but shouldn't new users have at least a moderated way of posting answers? Freedom of speech and stuff.

@R.M I was also a bit irritated upon seeing the problem. I guess SE simply is not designed for one-off answers, as frustrating this probably is for Alex ...

Why did you edit this into your own old answer instead of posting it as a new answer?

I believe this is optimal as I made a quick brute forcer today and it spat out 72 variations of that answer (although I only verified a few).

Actually, I found a solution with 8 blocks
O(O(O(G,4)R,4)GGR,4)

Manually found, 9 blocks
O(O(GRGLGR,4)L,4)
I started with the obvious O(O(GGR,4)L,4) that solves levels 1-5 then tried a few variations adding effectively-null moves on those levels to find one that would complete level 6. The shortest was a simple right-forward-left in the middle of each "bridge" so the forward move had no effect.

This is probably optimal which means the challenge is already over. :(

@totallyhuman turns out the community's not quite done with this yet :P

"The obvious O(O(GGR,4)L,4)" disproves that the shortest solution for level 4 is 7, as shown in the game.

@mik The game solutions don't rely on changing the loop size or moves that do nothing.

@totallyhuman you're forecasting was quite wrong :). Even more than a year after the question was posted, a better solution was found.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Make sets disjoint without emptying them
Suppose you have a set of sets of integers. It's possible that some of the sets will overlap (i.e. sharing elements). You could get rid of the overlaps by deleting elements from the sets, but then some of them might end up empty; that would be a shame. Can we make all the sets disjoint without emptying any of them?
Note that in this situation, there's never any reason to leave multiple elements in a set, so this problem can always be solved by reducing each set to just one element. That's the version of the problem we're solving here.
The task
Write a program or function, as follows:
Input: A list of sets of integers.
Output: A list of integers, of the same length as the input, for which:

All integers in the output are distinct; and
Each integer in the output is an element of the corresponding set of the input.

Clarifications

You can represent a set as a list if you wish (or whatever's appropriate for your language), disregarding the order of elements.
You don't have to handle the case where no solution exists (i.e. there will always be at least one solution).
There might be more than one solution. Your algorithm must always produce a valid solution, but is allowed to be nondeterministic (i.e. it's OK if it picks a different valid solution each time it runs).
The number of distinct integers appearing in the input, n, will be equal to the number of sets in the input, and for simplicity, will be the integers from 1 to n inclusive (as their actual values don't matter). It's up to you whether you wish to exploit this fact or not.

Testcases
[{1,2},{1,3},{1,4},{3,4}] -> [2,3,1,4] or [2,1,4,3]
[{1,3},{1,2,4},{2,3},{3},{2,3,4,5}] -> [1,4,2,3,5]
[{1,3,4},{2,3,5},{1,2},{4,5},{4,5}] -> [1,3,2,4,5] or [3,2,1,4,5] or [1,3,2,5,4] or [3,2,1,5,4]

Victory condition
A program requires an optimal time complexity to win, i.e. if an algorithm with a better time complexity is found, it disqualifies all slower entries. (You can assume that your language's builtins run as fast as possible, e.g. you can assume that a sorting builtin runs in time O(n log n). Likewise, assume that all integers of comparable size to n can be added, multiplied, etc. in constant time.)
Because an optimal time complexity is likely fairly easy to obtain in most languages, the winner will therefore be the shortest program among those with the winning time complexity, measured in bytes.

If it makes no sense then why is it that they understood it over here http://www.dreamincode.net/forums/topic/408035-has-this-algorithm-been-written-yet/

@fredrussell maybe, just maybe, it's about how you explain it, and not about, e. g. the notation on the image?

@fredrussell This is the wrong stackexchange for this question. On our site we host programming competitions. You may be able to get help on Computer Science Stackexchange, but be sure to read their help center first.

@fredrussell your explanation of the "challenge" is unclear and not formatted. On this site you'll usually find properly formatted and ordered questions, for example following a layout like "Input; Output; Rules; Testcases", but you aren't providing anything of that. Additionally, you don't have a winning criteria which could determine a winner. And after your insult I don't think anyone is willing to solve the question now. Even on SO, you should always keep in mind that the people answering are doing this in their free time, so you should not be rude like that.

Open question: is an optimal time complexity (i.e. without actually giving an upper bound) really covered by the restricted-complexity tag? Right now, it looks more like a fastest-code challenge with code-golf as the 2nd winning criterion.

@Arnauld [tag:fastest-code] would imply that if we both write O(n) algorithms, but yours is 100 times faster, then you win. If we only require an optimal time complexity, then it's okay if my code is 100 times slower, as long as it's one byte smaller. But this challenge might well count as [tag:fastest-algorithm].

Wikipedia leads me to think that the optimal known time complexity for this problem is O(n^ω), the speed of fast matrix multiplication. I'm looking forward to seeing solutions based on that.

This is exactly the problem of finding a full matching in a bipartite graph. The time complexities of the best known algorithms depend on how large the sets are compared to the number of sets. Related challenge.

I don't like that because perfect matching is a famous problem, likely the thing to do is to copy published algorithms.

@fredrussell Do you want the question to be formed this way? 1 If you do, then just keep it this way, and keep in mind how to write a challenge next time. (Sandbox) 2 If you don't like "obscure answers written in obscure languages", and what you do is purely asking for homework/algorithm/problem, then this is not the correct SE. Go to Computer-science SE for that. 3 Be nice when comment.

Wolfram Language (Mathematica), 87 bytes and ϴ(n3)
-Range[n=Length@#]/.Rule@@@FindIndependentEdgeSet[Join@@Table[-i->j,{i,n},{j,#[[i]]}]]&

Try it online!
Builds a bipartite graph whose vertices on one side are the sets (indexed by -1,-2,...,-n) and whose vertices on the other side are the elements 1,2,...,n, with an edge from -i to j when j is contained in the i-th set. Finds a perfect matching in this graph using a built-in. Then lists out the elements corresponding to -1,-2,...,-n in that order in the perfect matching.
Mathematica's FindIndependentEdgeSet is the bottleneck here; everything else takes O(n2) operations to do. Mathematica probably uses the Hungarian algorithm, and so I'll assume that it runs in ϴ(n3) time, though it's possible that Mathematica has a naive implementation with O(n4) complexity.

Well... Mathematica is bad at [tag:restricted-complexity], not for the first time.

Jelly, 8 bytes
Œp⁼Q$ÐfḢ

Try it online!
Explanation
Œp⁼Q$ÐfḢ  Main Link
Œp        Cartesian Product of the elements; all possible lists
     Ðf   Filter; keep elements that are
  ⁼Q$     Equal to themselves uniquified
      Ḣ   Take the first one

Extremely inefficient. Asymptotic to ϴ(n^(n+1)) according to Misha Lavrov; I think it's right.

I think this is at least Ω(n^n): the maximum possible size of the Cartesian product.

More precisely, ϴ(n^(n+1)), since the "equal to itself uniquified" check should be ϴ(n) time.

@MishaLavrov Ah okay, thanks.

@HyperNeutrino unique function in Jelly use O(n) containment (x in s) check, each one should take O(n) according to this page, so Q should take O(n^2) worst case / average case time complexity. Therefore the algorithm is O(n^(n+2)). (unique can be O(n) in case all elements are equal, where each containment check runs in O(1)) --- On an unrelated note, it is possible to implement unique in O(n) using Python builtin set data structure which is hash-set. Anyway Jelly is not designed to be efficient.

Haskell, 48 bytes
-1 byte thanks to nimi.
import Data.List
head.filter((==)<*>nub).mapM id

Try it online!

mapM id instead of sequence

Mathematica 39 Bytes
Last@Union[DeleteDuplicates/@Tuples@#]&

On the issue of complexity, I think it is very dependent upon the length of each sublist, as well as a measure of how disjoint the sublists are.
So, I think this algorithm is O(n Log n + n^2 Log m) where m is roughly the average length of each sublist.
Something like this would have complexity O(a^n) where a>1 is a measure of the overlap in sublists:
(For[x={1,1},!DuplicateFreeQ@x,x=RandomChoice/@#];x)&

Hard to say which is really faster without knowing the properties of possible inputs.

The DeleteDuplicates /@ Tuples@# step takes ϴ(n^(n+1)) time by the same arguments as in the other solutions. Then Union has a list of length n^n to sort, which takes O(n^(n+1) log(n)) time - but maybe it's faster since at most 2^n n! elements in that list are distinct. Either way, the complexity is ϴ(n^(n+1)) up to a log(n) factor.

I think this problem requires a multivariate definition of big O notation to have any practical meaning.  Obviously the length of the sublists is incredibly important.

My interpretation of the problem statement is that only the dependence on n (the number of sublists) matters, and we assume the worst case about the length of the sublists. In any case, even if every sublist has length 2, Tuples@# has size 2^n, so your first asymptotic estimate can't possibly be true.

Huh? Why is multivariate BigO problematic? It's done all the time.

05AB1E, 13 bytes, O(n!*n)
āœʒ‚øε`QO}P}н

Try it online! Explanation:
ā               Make a range 1..n
 œ              Generate all permutations
  ʒ        }    Filter
   ‚ø           Zip with input
     ε   }      Loop over sets
      `QO       Check each element for membership
          P     All sets must match
            н   Take the first result

Husk, 5 bytes
►oLuΠ

Try it online!
Explanation
Just saw the thing about complexity: As so often it is the case with golfing languages' solution they are not very efficient - this one has complexity O(n·nⁿ).
►(Lu)Π  -- input as a list of lists, for example: [[1,2],[1,3],[1,4],[3,4]]
     Π  -- cartesian product: [[1,1,1,3],...,[2,3,4,4]]
►(  )   -- maximum by the following function (eg. on [1,1,1,3]):
   u    --   deduplicate: [1,3]
  L     --   length: 2

Pyth, 9 bytes (ϴ(nn+1))
Since this works exactly like the Jelly solution, it most likely has the same complexity.
h{I#.nM*F

Try it here!
How?

h{I#.nM*F | Full program.

       *F | Fold Cartesian product.
    .nM   | Flatten each.
   #      | Keep those:
 {I         That are invariant over duplicate elements removal.
h         | Take the first element.

JavaScript (ES6), 74 73 bytes
1 byte saved, thanks to @Neil.
f=([a,...A],s=[],S)=>a?a.map(c=>s.includes(c)||(S=S||f(A,[...s,c])))&&S:s

Recursively iterates through the array looking for a solution.
Ungolfed:
f=(
   [a, ...A],                        //a is the first array, A is the rest
   s = [],                           //s is the current trial solution
   S                                 //S holds the solution (if one exists) at this branch
  )=>
     a ? a.map(                      //if we're not done, iterate through a
           c => s.includes(c) ||     //  if this element already exists, short-circuit
                (S = S ||            //  else if S has a solution, keep it
                 f(A, [...s, c])     //  else look for a solution down this branch
                )
         ) && S                      //return S

Test Cases:

f=([a,...A],s=[],S)=>a?a.map(c=>s.includes(c)||(S=S||f(A,[...s,c])))&&S:s

console.log(f([[1,2],[1,3],[1,4],[3,4]])) // [2,3,1,4] or [2,1,4,3]
console.log(f([[1,3],[1,2,4],[2,3],[3],[2,3,4,5]])) // [1,4,2,3,5]
console.log(f([[1,3,4],[2,3,5],[1,2],[4,5],[4,5]])) // [1,3,2,4,5] or [3,2,1,4,5] or [1,3,2,5,4] or [3,2,1,5,4],4]

Why not a?a.map(...)&&S:s?

@Neil, because Duh.  Thanks!

Python3, 93 84 bytes
-9 bytes thanks to caird coinheringaahing
lambda I:next(filter(lambda x:len(x)==len({*x}),product(*I)))
from itertools import*

Try it online!

84 bytes

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Find the smallest number of participants with resulting percentages
Programs often list outcome statistics, such as this:

54% of participants received an award
69% of participants got a promotion
85% of participants increased their salary

These percentages are the result of dividing a/x, where both a and x are whole numbers, and the result is rounded to the nearest hundredth.
Your task is to, given a set of percentages of arbitrary length and an arbitrary precision to which these percentages are rounded, find the three smallest whole numbers x of participants which could result in the given statistics.
To standardize answers, let's presume your input percentages are given as floating or fixed point decimals (your choice) like 0.54 and 0.69, and a precision given as an integer such as 2 meaning two digits past the decimal point.
For the above statistics, the first smallest number of participants is 13, and the 7, 9, and 11 participants had each of the given outcomes. Thus, 13 would be the first number in a set of three output numbers.
The winner will be the shortest piece of code counted in bytes. Any rounding method is acceptable in solutions, but solutions that offer solutions for multiple rounding schemes (floor, ceiling, or nearest) are encouraged.
Another example in Ruby
percentages = [ 0.5, 0.67, 0.83, 1.0 ]
precision = 2
smallest_group_size(percentages, precision) # Should produce [6, 12, 18]

Could you provide more test cases?

Are occasional floating point rounding errors acceptable? For instance, in JS: (1.35).toFixed(1) is 1.4 but (0.35).toFixed(1) is 0.3.

Very similar: Reverse Engineer Polling Statistics

05AB1E, 17 bytes
3µNLN/².ò¹åPi¼N])

Try it online!

Python 3, 80 bytes
lambda l,p:[i for i in range(1,10**p)if[round(round(e*i)/i,p)for e in l]==l][:3]

Try it online!

JavaScript (ES6), 84 bytes
Takes input in currying syntax (a)(p), where a is an array of percentages and p is the precision.
a=>p=>(b=[],g=n=>b[2]?b:g(n+1,a.some(x=>((n*x+.5|0)/n).toFixed(p)-x)||b.push(n)))(1)

Test case

let f =

a=>p=>(b=[],g=n=>b[2]?b:g(n+1,a.some(x=>((n*x+.5|0)/n).toFixed(p)-x)||b.push(n)))(1)

console.log(f([ 0.5, 0.67, 0.83, 1.0 ])(2))

APL (Dyalog), 37 bytes
{3↑x/⍨((⍺⍕⍵)≡⍺⍕⊢÷⍨(⌊.5+⍵×⊢))¨x←⍳10*⍺}

Try it online!


text:
Advent Challenge 5: Move the presents to the transport docks!
<< Prev Next >>
Thanks to the PPCG community, Santa has managed to remanufacture all of his presents and after the assembly line, the presents are now ready to be moved into the transport docks!
Each of Santa's transport docks only holds a range of present sizes because the transport sleighs are specialized for a specific size (any lighter and it would be wasteful, any heavier and the sleigh wouldn't be able to handle the load). Thus, he needs you to help him take his presents and sort them into the correct transport docks.
Challenge
Given a list and the transport dock ranges, stably organize the presents into the correct order.
Let's take this for example: the presents are [5, 3, 8, 6, 2, 7] and the dock ranges are [[1, 5] and [6, 10]].
The presents 5, 3, and 2 go into the first dock and the presents 8, 6, and 7 go into the second dock. This can be shown as [[5, 3, 2], [8, 6, 7]]. This list will be closer to being sorted than the input, but stably means that within each dock, the order of the presents must be the same as the order of the input (otherwise you could just sort the entire list).
Your final output for this case would be [5, 3, 2, 8, 6, 7] (as a flat list).
Formatting Specifications
You will be given input as a flat list of integers and a list of ranges in any reasonable format (for example, the range for the above case could be given as [[1, 5], [6, 10]], [1, 5, 6, 10], or [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]]). Your output should be a flat list of integers in any reasonable format.
The input can contain duplicate values; in this case, you need to return all instances of them. All present sizes will be in exactly one size range, and you can assume that the ranges will never overlap. There can be gaps in the ranges as long as all present sizes are covered.
Rules

Standard Loopholes Apply
This is code-golf, so the shortest answer in bytes wins
No answer will be accepted
You can assume that there will be no empty ranges ([7, 4] would be invalid because ranges go up)

Test Cases
[1, 2, 3, 4, 5, 6, 7] ; [[1, 3], [4, 7]] => [1, 2, 3, 4, 5, 6, 7]
[1, 2, 3, 4, 5, 6, 7] ; [[4, 7], [1, 3]] => [4, 5, 6, 7, 1, 2, 3]
[7, 3, 5, 4, 6, 1, 2] ; [[1, 3], [4, 5], [6, 7]] => [3, 1, 2, 5, 4, 7, 6]
[4, 7, 6, 3, 5, 2, 1] ; [[1, 4], [5, 7]] => [4, 3, 2, 1, 7, 6, 5]
[1, 1, 3, 3, 6, 4, 7] ; [[1, 4], [6, 7]] => [1, 1, 3, 3, 4, 6, 7]

Note: I drew inspiration for this challenge series from Advent Of Code. I have no affiliation with this site
You can see a list of all challenges in the series by looking at the 'Linked' section of the first challenge here.

Always just 2 docks?

Can the ranges overlap?

@LiefdeWen See the 3rd test case.

Will the docks pairs always be {small,big}

@RamenChef No..

@LiefdeWen Yes (You can assume that there will be no empty ranges ([7, 4] would be invalid because ranges go up))

Can the first input contain duplicates? Can it contain values not in any range? Can there be gaps between the ranges?

@Zgarb Yes, No, Yes. I will specify that and make my test cases reflect that, thanks.

presents are always positive integers?

@Giuseppe Sure, you can assume that.

Haskell, 26 bytes
a#s=[x|r<-s,x<-a,elem x r]

Try it online! Example usage: [1,2,3,4,5,6,7] # [[1,2,3],[4,5,6,7]] yields [1,2,3,4,5,6,7].

Mathematica, 39 bytes
x##&@@Cases[x,#|##&@@Range@##]&@@@#&

-22 bytes from JungHwan Min
-4 bytes from Martin
Try it online!

You can also get rid of the entire Range thing by just taking the expanded ranges as input.

Jelly, 4 bytes
fÐ€Ẏ

Try it online!
Takes input as present list, full ranges.

yaay that's the jelly solution I expected :DDD

@HyperNeutrino Hehe the expected solution turns out not to be the shortest. By finding the way 05ab1e's outer product works, I figured that fþF works in Jelly too, for 3 bytes. Credit goes to Adnan.

@Mr.Xcoder Either you or Adnan should post that.

@Mr.Xcoder I'll wait a bit and see :P but it looks considerably different, if I end up posting it, I will post another answer.

05AB1E, 3 bytes
δÃ˜

Try it online! (thanks to Adnan for letting me know δ exists, -1 byte)
How it works

δÃ˜  | Full program.

δ    | Double-vectorize the next command (something like an outer product).
 Ã   | List intersection. Since this is a dyad, the first input is automatically
     | used to fill the missing argument (as far as I know).
  ˜  | Flatten.

Well, €Ã˜ doesn't seem to work.

No, there isn't. BTW the reason €Ã˜ fails is because Ã takes two arguments, and € expects a function with one argument, so it returns [[]] instead (I think that's a bug), so then ˜ will flatten, returning []. ε, though, works differently. For each element of the top item, it makes a new stack and then returns the top of each new stack, so when there aren't enough items in it for a function, it takes an implicit input instead.

I haven't tested it yet, but is δÃ˜ what you are looking for?

@Mr.Xcoder I don't think that's exactly the dyadic map Pyth has, it behaves more like outer product or something.

Pyth, 5 bytes
s@Rvz

Try it here!
Pyth, 10 bytes
s.gx}LkQ1E

Try it here!
How they work

s@Rvz  | Full program.

  R    | Right map...
 @     | ... Using intersection.
   vz  | Of the first input with the second.
s      | Flatten by one level.

s.gx}LkQ1E  | Full program.

 .g      E  | Group the items in the second input by...
    }LkQ    | Map over the first input, and check if the current item is in the list.
   x    1   | Take the index of the first truthy element.
s           | Flatten.

Takes the docks first, with all the integers in the ranges, and then the presents on a new line.

Python 2, 49 46 bytes
thanks to @HyperNeutrino for -3 bytes
lambda p,b:[x for l in b for x in p if x in l]

Try it online!

Ungolfed
def f(presents, groups):
  result = []
  for group in groups:
    for present in presents:
      if present in group:
        result.append(present)
  return result

Try it online!

Retina, 37 36 bytes
O$`(\d+)(?=.*¶(.*)\[.*\b\1\b)
$2
G1`

Try it online! Takes input as a list of presents on the first line and a list of ranges on the second line; the link includes a header to split the test cases into the desired format. Edit: Saved 1 byte thanks to @MartinEnder. Explanation: The first stage matches the presents and finds the matching dock. The presents are sorted by the substring from the start of the line to the [, thus grouping the presents by dock. The second stage then deletes the docks.

APL+WIN, 29 bytes
(,⍉<\p←n∘.≤∊¯1↑¨⎕)/(×/⍴p)⍴n←⎕

Prompts for screen input for both the integers and ranges. The integers as a flat list and the ranges as a nested vector, e.g case 3:
(1 3) (4 5) (6 7)

Explanation:
(×/⍴p)⍴n←⎕ prompt for screen input of integers and replicate by the number of ranges

∊¯1↑¨⎕ prompt for screen input of ranges and select the top of each

p←n∘.≤ create a boolean matrix using outer product with less than the top of each range

,⍉<\ identify the first range which each element fits in and ravel into a partition vector

(.....)/.... use the partition vector to select the elements in each range in order

Enlist, 3 bytes
f₱Ẏ

Try it online!
How it works

f₱Ẏ  | Full program.

 ₱   | Map over right argument.
f    | Using list intersection, counting multiplicities.
  Ẏ  | Tighten (flatten by 1 level).

:D Enlist was not forgotten :D Actually it kinda was, just not by the community but rather by me :( :P

J, 26 24 bytes
2 bytes thanks to cole
[:;]<@#~1=-&1 0"1@[I."1]

How it works:
The left argument holds the ranges.
-&1 0"1@[ decreases the lower boundary of each range by 1
I."1] checks in which range fits each present
1= is it in the correct range
]<@#~ copies and boxes the presents which are in the current range
; - raze (unboxing)
Try it online!

I'm pretty sure you can't remove zeroes since the input is integral (e.g. fails this test case (0 4,:_3 _1) f _2 _1 0 1 2)

@cole Hm, I had totally neglected these cases. I'll need to think about them.

Yeah I think that the easiest way would probably be to box and then raze. 24 bytes that way.

@cole Thank you! It's not only shorter but easily solves the problem with 0.

J, 15 bytes
[/:[:I.e.&>"0 1

Takes the input as the left argument and the ranges as the right argument. The ranges are boxed lists of the complete ranges.
e.g. for the first range:
   NB. This produces the range
   (1 2 3 ; 4 5 6 7)
┌─────┬───────┐
│1 2 3│4 5 6 7│
└─────┴───────┘

Try it online!
Explanation
[/:[:I.e.&>”0 1
          >”0 1  Pair each element on the left with each range on the right
       e.        Is the element in the range?
     I.          Indices of ones
[/:              Sort the elements by this array

C++, 127 bytes
Take input as two arrays represented by pairs of pointers [start, end).
#import<algorithm>
[](int*A,int*x,int*B,int*y){for(;B!=y;B+=2)A=std::stable_partition(A,x,[&](int a){return a>=*B&&a<=B[1];});}

Try it online!

Well, C++ has a built-in for everything... or does it? / Given that the input ranges doesn't contains 0, it is possible to golf down some bytes using null-terminated array B, although it may be considered cheating. / Unfortunately [&](int a)->int{a=a>= instead of [&](int a){return a>= doesn't save any bytes. / #import<algorithm> can be #import<regex>, at least on TIO. I found that after search exhaustively ("manual binary search") all header listed in this page and this one is the shortest. / Also, +1 from me.

R, 113 48 55 41 bytes
A previous version didn't correctly sort objects when the docks weren't in increasing order.
function(P,D)for(d in D)cat(P[P%in%d],"")

Try it online!
Takes D as a list of vectors of ranges, i.e., list(4:7,1:3) would be [[4, 7], [1, 3]].
Probably the naive answer I should have arrived at ages ago; prints to stdout.

Japt, 6 bytes
ñ@VbøX

Try it

Explanation
Implicit input of array U (presents) and 2d-array V (full ranges). Sort (ñ) the presents by passing them through a function (@) that gets the index of the first element (b) in V that contains (ø) the current present (X).

Javascript ES6, 53 47 45 bytes
p=>l=>l.map(d=>p.filter(a=>d.includes(a)))+''

Try it online!

45 bytes. You can take the whole ranges as input. A slightly nicer alternative 47 byter

Python 2, 97 85 bytes
l,d=input()
k=lambda i,j=0:-~j*(d[j][0]<=i<=d[j][1])or k(i,j+1)
print sorted(l,key=k)

-11 bytes from ovs
-1 byte from Mr. Xcoder
Try it online!
Sorts the list using a recursive lambda as the key. Explanation coming soon™ below.
Explanation:
l,d=input()             # l is the lsit of presents, d is the list of ranges
k=lambda i,j=0:-~j*(d[j][0]<=i<=d[j][1])or k(i,j+1)# recursive lambda to sort with
k=lambda i,j=0:                                    # i is the present
                                                   # j is the index in the list of ranges
               -~j*(d[j][0]<=i<=d[j][1])           # return the index of the list of
                                                   # ranges(plus one) if the present is
                                                   # in the range
                                        or k(i,j+1)# if the present is not in the range,
                                                   # try the next range
print sorted(i,key=k)   # print the list of presents sorted by the lambda

PowerShell, 37 bytes
param($a,$b)$b|%{$i=$_;$a|?{$_-in$i}}

Try it online!
Takes $a as a literal array of the presents and $b as an array of arrays, each of which are the full range (e.g., @(1,2,3,4,5) instead of @(1,5)). We then loop over each item in $b with |%{...}. Inside, we need to set a helper $i to be the current item, then use a Where-Object clause against $a to pull out only those items that are -in the current $b array.
Those are left on the pipeline and output is implicit. Since the default behavior of Write-Output inserts a newline between array elements, that's what we get. Here is a slightly tweaked version that is -joined together via commas instead of a newline, just to show differences.

Red, 73 bytes
f: func[b r][n: copy[]foreach p r[foreach a b[if find p a[append n a]]]n]

Try it online!

Windows Batch (CMD), 90 79 bytes
set/pX=||exit
set/pY=
for %%n in (%*)do if %X% LEQ %%n if %%n LEQ %Y% %%n
%0 %*

Use LF end-of-line format. Each end-of-line character can be counted as 1 byte.
No TIO (because TIO uses Linux)
Take the list from command line arguments, and ranges from stdin.
For example, if the program is run (assume the file is named r1.cmd)
r1 7 3 5 4 6 1 2

and with stdin input
1
3
4
5
6
7

, the program will output to stderr with format
'3' is not recognized as an internal or external command,
operable program or batch file.
'1' is not recognized as an internal or external command,
operable program or batch file.
'2' is not recognized as an internal or external command,
operable program or batch file.
'5' is not recognized as an internal or external command,
operable program or batch file.
'4' is not recognized as an internal or external command,
operable program or batch file.
'7' is not recognized as an internal or external command,
operable program or batch file.
'6' is not recognized as an internal or external command,
operable program or batch file.

(corresponds to output sequence 3 1 2 5 4 7 6)

Explanation:
set /p X=       Prompt for variable X (min range)
   ||exit       If failed (end of file), exit - similar to short-circuit of logical OR
set /p Y=       Prompt for variable Y
for %%n in (%*)do     For each number %%n in all command-line arguments
   if %X% LEQ %%n     If X <= n
      if %%n LEQ %Y%  and n <= Y
         %%n          run command named "n", which lead to an error.

%0 %*           Call itself, process other ranges

Ungolfed code (with interaction enabled if true is passed as argument 1; prompt for the list from stdin, use goto to avoid stack overflow - actually I've just tried to run a script that call itself over 70000 times without seeing any problem, so I guess it should be pretty safe):
@echo off

set INTERACTIVE=%1

if "%INTERACTIVE%" == "true" (
    set rangeMinPrompt=Enter range min:
    set rangeMaxPrompt=Enter range max:
    set listPrompt=Enter list:
) else (
    set rangeMinPrompt=
    set rangeMaxPrompt=
    set listPrompt=
)

set /p list=%listPrompt%

:loop_label

set /p rangeMin=%rangeMinPrompt%&& set /p rangeMax=%rangeMaxPrompt%|| exit /b

for %%n in (%list%) do (
    if %rangeMin% LEQ %%n (
        if %%n LEQ %rangeMax% (
            echo %%n
        )
    )
)

goto :loop_label

You can save more bytes by requiring the presents to be command-line arguments and use (%*). Having done this, you can then use %0 %* to restart the script after processing each range. (I actually ended up with a larger byte count because I used your interactive version with the nice touches &&, exit/b and echo as my starting point.)

@Neil Nice, thanks! I originally tried using %1 but the quotes " make the space not working as separators, so I ended up using set /p.

Oh wow, there is even $~1...

C# (.NET Core), 50 + 18 bytes
a=>b=>b.SelectMany(x=>a.Where(y=>y>=x[0]&y<=x[1]))

+18 bytes from
using System.Linq;

It takes a collection for presents and a collection of arrays for docks.
Try it online!

Clean, 59 bytes
import StdEnv;f p l=flatten[[n\\n<-p|a<=n&&n<=b]\\[a,b]<-l]

Try it online!
Takes two lists, returns a list.

Wolfram Language (Mathematica), 34 bytes
r#~SortBy~{#&@@@r~Position~#&}&

Try it online!
 is the Function operator.
This is an unnamed curried function which should be called first with the list of (expanded) dock ranges and then with the list of presents. For example, if you assign the function to f:
f[ {{4,5,6,7},{1,2,3}} ][ {1,2,3,4,5,6,7} ]

The list of presents simply sorted by the first-level position of the value in the list of dock ranges. We need to wrap the SortBy function in a list to make the sort stable.

Julia 0.6, 31 30 bytes
p%d=vcat((∩(p,x)for x=d)...)

Try it online!
Redefines the % operator and maps the set intersection∩() over the docks d maintaining order and multiplicity of the first imput, the list of presents p. vcat with the input expanded to multiple arguments via ... flattens the resulting nested array.
Edit, -1Byte: List comprehension instead of map().