# Question
Title: Remove vowels without using too many different characters
The challenge is to remove vowels (a, e, i, o, u) from string from STDIN (yes, I know, simple). You can expect that your program will be not ran with any arguments in `argv`.

Example:

```
This program will remove VOWELS.
So we can now speak without them.

```

Is changed to:

```
Ths prgrm wll rmv VWLS.
S w cn nw spk wtht thm.

```

There is a catch. The winning entry is decided basing on number of different bytes. For example `a ab` has three different bytes (`a`, `b` and space). If two or more entries will have this same ammount of different bytes, then fallback is done on number of bytes for those entries.

# Answer
## Binary Whitespace (2 distinct chars, 324 total chars)

`TTSSSTTSSSSTTTSTTTSSSSSSTTSSSTSSSSSSTSTTSSSTSSSSTSSTSTTSSSTSSSTSSSTSTTSSSTSSSTSTSTSTSTTSSSTSSTSSTSSTSTTSSSTSTSSSSSTSTTSSSTSTSSSTSSTSTTSSSTSTSSTSSSTSTTSSSTSTSSTSTSTSTSTTSSSTSTSTSSTSSTSTTTTSSSTSTTSTTSTTTSSTSTTSSSSTTTSTSTSTSSSTSTTTSSTTTTSTTSTSTTTTSSTTTTTSSSTTTTSTTTTTTSSTSTTSSSSTTTSTSTSSTTSTTTSSSSTTTSTTSSTTSTTSTTTTSSSSTTTTTTTT`

where S,T,L denotes Space,Tab,Linefeed, respectively. (Shamelessly obtained by converting the Whitespace answer by "breadbox" into Binary Whitespace -- this posting should probably be a comment to his answer, but it's too long.)

Binary Whitespace is Whitespace converted to a prefix-code language by everywhere using TS instead of T and using TT instead of L; e.g. the BWS instruction to push -5 onto the stack is SSTSTSSTSTT instead of SSTTSTL, etc. Link: A both-ways translator for an arbitrary 3-symbol language and its binary prefix-code versions \[archive\].

NB: It would be straightforward to design a true *bitwise* interpreter for Binary Whitespace programs regarded as *bit*-sequences, rather than char-sequences (e.g. using 0,1 bit-values instead of S,T characters, respectively). The above would then be a 324-*bit* program requiring 41 bytes of storage.
> 4 votes

# Answer
## Brainfuck, 8 distinct (2121 total)

```
>,+[-<>>>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>[-]+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>[-]++<[-<+>>>>->>>->>>->>>->>>->>>->>>->>>->>>->>>-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[<<<]+>-[<-<.>>-]<[<<<]<[-]>,+]

```

The distict characters: `<>+-[],.`. Works with interpreters that use `-1` for `EOF`.

> $ echo '
> This program will remove VOWELS.
> So we can now speak without them.
> ' | bf vowel-rm.bf
> Ths prgrm wll rmv VWLS.
> S w cn nw spk wtht thm.
> 13 votes

# Answer
## Whitespace, 3 points (218 chars)

You knew it was coming.

```
↲___↲____↲⇥↲⇥_____↲___⇥_____⇥↲___⇥___⇥_⇥↲___⇥__⇥__⇥↲___⇥__⇥⇥⇥⇥↲___⇥_⇥_⇥_⇥
↲___⇥⇥____⇥↲___⇥⇥__⇥_⇥↲___⇥⇥_⇥__⇥↲___⇥⇥_⇥⇥⇥⇥↲___⇥⇥⇥_⇥_⇥↲↲___⇥↲_↲_↲⇥_⇥↲___
_↲⇥⇥⇥⇥__⇥↲⇥_↲↲_↲_⇥↲↲__↲↲⇥__↲↲_↲↲↲__⇥↲____↲⇥⇥⇥_↲_↲⇥___↲⇥↲__↲_↲_↲↲____↲↲↲↲

```

(\_ = space, ⇥ = tab, ↲ = newline)

Here's the script encoded in base64:

```
CiAgIAogICAgCgkKCSAgICAgCiAgIAkgICAgIAkKICAgCSAgIAkgCQogICAJICAJICAJCiAgIAkg
IAkJCQkKICAgCSAJIAkgCQogICAJCSAgICAJCiAgIAkJICAJIAkKICAgCQkgCSAgCQogICAJCSAJ
CQkJCiAgIAkJCSAJIAkKCiAgIAkKIAogCgkgCQogICAgCgkJCQkgIAkKCSAKCiAKIAkKCiAgCgoJ
ICAKCiAKCgogIAkKICAgIAoJCQkgCiAKCSAgIAoJCiAgCiAKIAoKICAgIAoKCgo=

```

And here's the program written in visible assembler-like form:

```
ioloop: charin  0
        push    0, 'A', 'E', 'I', 'O', 'U', 'a', 'e', 'i', 'o', 'u'
ckloop: dup
        jz      out
        get     0
        sub
        jz      skip
        jump    ckloop
skip:   jz      ioloop
        jump    skip
out:    get     0
        dup
        jz      done
        charout
        jump    ioloop
done:   exit

```
> 11 votes

# Answer
### SED (10 distinct bytes, 13 total)

```
s/[aeIou]//gI

```

Sample usage:

```
echo The quick brown fox jumps over the lazy dOg. | sed -e s/[aeIou]//gI

```

outputs:

```
Th qck brwn fx jmps vr th lzy dg.

```
> 9 votes

# Answer
## C, 22 20 19 distinct characters.

Letters needed for `main`, `putchar`, `getchar` = 12.
Punctuation - `(){};` = 5.
Operators - `&-`= 2.

```
i;ii;
p(c){
    (c&ii-(-ii-ii))-(i-ii-ii-ii-ii-ii-ii)&&
    (c&ii-(-ii-ii))-(i-ii-ii-ii-ii-ii-ii-i-i-i-i)&&
    (c&ii-(-ii-ii))-(i-ii-ii-ii-ii-ii-ii-ii-(-i-i-i))&&
    (c&ii-(-ii-ii))-(-ii-ii-ii-ii-ii-ii-ii-i-i)&&
    (c&ii-(-ii-ii))-(i-ii-ii-ii-ii-ii-ii-ii-ii-(-i-i))&&
    putchar(c);
}
a(c){c-i&&n(p(c));}
n(c){a(getchar());}
main(){
    n(i---ii---ii---ii---ii---ii---ii---ii---ii---ii---ii---ii---i);
}

```

`main` invokes undefined behavior (too much `--` in one line).
I don't care about the expression value, and it does decrement `ii` the right number of times.
Can be fixed easily by separating the decrements with `;`. But it's so much nicer as it is.

Old version, 20 characters:
Actually 21, because I didn't notice that some spaces are significant and must be counted, but they can be replaced with parentheses easily.

```
ii;iii;c;a;
main(i){
    i=c;i-=--c;
    ii=-i-i-i-i-i-i-i-i-i-i-i;
    iii=i-ii-ii-ii-ii-ii-ii-ii-ii-ii-ii;
    -(c=a=getchar())-i&&main(
        (c&=ii- -ii- -ii)- -            a&&
        -ii-ii-ii-ii-ii-ii-  i-         c&&
        -ii-ii-ii-ii-ii-ii- -i- -i- -i- c&&
        iii- -ii- -ii- -ii-  i-i-i-i-i- c&&
        iii- -ii- -ii- -ii- -i-         c&&
        iii- -ii- -ii-       i-i-i-i-   c&&
        putchar(a));
}

```

Can perhaps be improved further, by compiling with `gcc -nostartfiles`, and renaming `main` to `_start`. `min` are removed (after some variable renaming), `_s` added. But then I need to use `exit()`, which adds 3 chars.
Instead of `_start`, any name can be used, and it works in Linux. This allows going down to 18 chars, but is very non-standard.
> 7 votes

# Answer
# Perl: 8 or 10 distinct characters

## `s///` solution: 10 distinct, 13 total

The (purported; see below) sed technique always works in perl, too, and yields the name number of distinct characters (10):

```
s/[aeiou]//gi

```

For example:

```
$ echo 'This program will remove VOWELS. So we can speak without them.' |
  perl -ple 's/[aeiou]//gi'
Ths prgrm wll rmv VWLS. S w cn spk wtht thm.

```

That’s 10 distinct characters, as this proves:

```
$ echo 's/[aeiou]//gi' | perl -nle '@s{split//}=(); print scalar keys %s'
10

```

The problem with the sed solution is that its `/i` is *not* part of POSIX sed, and thus is not portable:

```
$ echo 'This program will remove VOWELS. So we can speak without them.' |
  sed -e 's/[aeiou]//gi'
sed: 1: "s/[aeiou]//gi": bad flag in substitute command: 'i'

```

That’s running on an OpenBSD system. In contrast, because `/i` is indeed always part of standard perl, you ***can*** count on its always being there. Unlike sed.

If you want to include “y” in the list of vowels, it is of course one greater if you use the same technique:

```
$ echo 'This nifty program remove any VOWELS. So we easily can speak without them.' |
  perl -ple 's/[aeiouy]//gi'
Ths nft prgrm rmv n VWLS. S w sl cn spk wtht thm.

$ echo 's/[aeiouy]//gi' | perl -nle '@s{split//}=(); print scalar keys %s'
11

```

And it is now 14 total characters.

## `tr[][]` solution: 8 distinct 10 total

You could also use `tr///` to remove anything it matches. Perl can even use sed’s `y///` alias for `tr`:

```
y/aeiou//d

```

which is now 8 distinct characters, but does’t work on uppercase. You end up having to add 5 more characters to cope with the casemaps:

```
$ echo 'y/aeiouAEIOU//d' | perl -nle '@s{split//}=(); print scalar keys %s'
13

```

and of course that’s now 15 total.

However, adding “y” to the mix as a vowel doesn’t up the number of distinct characters as it did with the `s///` version:

```
$ echo 'This nifty program remove any VOWELS. So we easily can speak without them.' |
  perl -ple 'y/aeiouy//d'
Ths nft prgrm rmv n VOWELS. S w sl cn spk wtht thm.

```

So that’s still just the original 8 distinct out of 11 total:

```
$ echo 'y/aeiouy//d' | perl -nle '@s{split//}=(); print scalar keys %s'
8

```

---

# *EDIT*: Accounting for Diacritics

And what about inputs like `Renée’s naïveté`? The correct output should of course be `Rn’s nvt`. Here’s how to do that, using v5.14’s `/r` flag for `s///`:

```
$ echo 'Renée’s naïveté' |
  perl5.14.0 -CS -MUnicode::Normalize -nle 'print NFD($_)=~s/[aeiou]\pM*//rgi'
Rn’s nvt

```

That’s 27 distinct characters:

```
$ echo 'print NFD($_) =~ s/[aeiou]\pM*//rgi' |
  perl -nle '@s{split//}=(); print scalar keys %s'
27

```

You can trim that to 26 if you can guarantee that you’re running at least v5.10 by swapping out the `print` for a `say`:

```
$ echo 'Renée’s naïveté' |
  perl -Mv5.14 -CS -MUnicode::Normalize -nlE 'say NFD($_) =~ s/[aeiou]\pM*//rgi'
Rn’s nvt

$ echo 'say NFD($_) =~ s/[aeiou]\pM*//rgi' |
  perl -nle '@s{split//}=(); print scalar keys %s'
26

```

And you can get it down to 22 if you don’t mind moving the diacritics instead of removing them:

```
$ echo 'Renée’s naïveté' |
  perl -Mv5.14 -CS -MUnicode::Normalize -nlE 'say NFD($_) =~ s/[aeiou]//rgi'
Rń’s n̈vt́

```

Which is ... *interesting* to look at, to say the least. :) Here’s its distinct-count:

```
$ echo 'say NFD($_) =~ s/[aeiou]//rgi' |
  perl -nle '@s{split//}=(); print scalar keys %s'
22

```

## *Good luck getting any other language to properly deal with diacritics using fewer characters than this!*
> 7 votes

# Answer
## GolfScript (7 distinct bytes, 103 total)

Sufficiently much of an improvement over w0lf's answer that I think it qualifies as a separate one:

```
[9-99))--9+99))99))))))99)9+))9-9)99--)99-9+9--9+9-))99-9+9)))--9+99-9+-9+9-)99-9+9)))-)99)9-9-)))]''+-

```

### 12 distinct bytes, 13 total:

```
'aeiouAEIOU'-

```
> 6 votes

# Answer
### Golfscript (8 distinct bytes, 837 total)

```
[9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))]''+-

```

Explanation:

1. The program creates the following array of integer values: `[97 101 105 111 117 65 69 73 79 85]` (corresponding to the ASCII codes of `a,e,i,o,u,A,E,I,O,U`). Each number is represented by pushing on stack the value `9`, followed by the needed number of `)` (increment operators). For example, the number `67` is obtained using `9` and 58 `)`s
2. Using `''+`, the array is converted into the string `"a,e,i,o,u,A,E,I,O,U"`, representing all vowels
3. The subtraction sign ('-') is then used to subtract all vowels from the source string

The 8 unique characters that were used: `[`,`]`,`9`,`)`,`+`,`-`,`'` and `(space)`
> 4 votes

# Answer
## Unreadable (2 distinct, 2666 total)

Since everyone is posting Turing tarpits, I thought I'd use this one. It's not a very well-known one but it does exist ( http://esolangs.org/wiki/Unreadable ) and it has only two characters.

```
'""""'""""'""""'""""""'"""'""'""'""'""'""'""'""'""'""'"""'""""'"""""'"""""""'"""'""""'"""
"'""""'""""""'"""'""""""""'"""""""'"""'""""""'""'"""'""'""'""'""'""'""'"""""""'""'"""'"""
"'""""""'""'""'"""'""'""'""'""'""'""'""'"""""""'""'""'"""'""""""'""'""'""'"""'""'""'""'""
'""'""'""'""'"""""""'""'""'""'"""'""""'""""'""""""'""'""'""'""'"""'""'""'""'""'""'""'""'"
"'""'"""""""'""'""'""'""'"""'""""""'""'""'""'""'""'"""'""'""'""'""'""'""'""'""'""'""'""""
"""'""'""'""'""'""'"""'""""'""""""'""'""'""'""'""'""'"""'""'""'""'""'""'""'""'""'""'""'""
'"""""""'""'""'""'""'""'""'"""'""""""'""'""'""'""'""'""'""'"""'""'""'""'""'""'""'""'""'""
'""'""'""'"""""""'""'""'""'""'""'""'""'"""'""""""'""'""'""'""'""'""'""'""'""'""'"""'"""""
"""'""""""""'"""""""'""'""'""'""'""'""'""'"""'""""'""""""'""'""'""'""'""'""'""'""'""'"""'
""'""'"""""""'""'""'""'""'""'""'"""'""""'""""""'""'""'""'""'""'""'""'""'"""'""""""""'""""
""""'""""""""'""""""""'"""""""'""'""'""'""'""'""'"""'""""""'""'""'""'""'""'""'""'"""'""'"
"'"""""""'""'""'""'""'""'"""'""""'""""'""""""'""'""'""'""'""'""'"""'""""""""'""""""""'"""
""""'""'""'""'""'""'"""'""""'""""""'""'""'""'""'""'"""'""""""""'""""""""'""""""""'"""""""
"'"""""""'""'""'""'""'"""'""""""'""'""'""'""'"""'"""""""'""'""'""'"""'""""'""""'""""""'""
'""'""'"""'""'""'""'""'"""""""'""'""'"""'""""""'""'"""'""'""'""'""'""'""'"""""""'""'"""'"
"""'""""""'"""'""'""""""""""'"""""'"""""""'"""'""""'""""'""""""'""'""'""'""'""'""'""'""'"
"'""'""'"""'""'""'""'""'""'""'""'""'""'""'"""'""""""'""'""'""'""'""'""'""'""'""'""'""'""'
"""'""""""""'"""'""""'"""""""""'""""""""'"""""""'""'""'""'""'""'""'""'""'""'""'""'"""'"""
""'""""""""'"""""""'""'""'""'""'""'""'""'""'""'""'""'"""'""""'""""'""""""'""'""'""'""'""'
""'""'""'""'""'""'""'""'"""'"""""""'"""'""""""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'
"""'"""""""'"""""""'""'""'""'""'""'""'""'""'""'""'""'"""'""""'"""""""""'"""""""'""'""'""'
""'""'""'""'""'""'""'""'""'""'""'"""'"""""'"""""""'""'""'""'""'""'""'""'""'""'""'""'""'""
'""'"""'""""'""""""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'"""'""""""""'"""""""'""'""'
""'""'""'""'""'""'""'""'""'""'""'""'"""'""""""'""'""'""'""'""'""'""'""'""'""'""'""'""'"""
'""""""""'"""""""'""'""'""'""'""'""'""'""'""'""'""'""'""'"""'"""'""""'"""""""""'"""""""'"
"'""'""'""'""'""'""'""'""'""'""'""'""'"""'""""""'""'""'""'""'""'""'""'""'""'""'""'""'"""'
""'"""""""'""'""'""'""'""'""'""'""'""'""'""'""'"""'"""'""""""'""'""'""'""'""'""'""'""'""'
""'""'"""'""""""""'"""""""'""'""'""'""'""'""'""'""'""'""'""'"""'"""'""""'"""""""""'""""""
""'""""""""'""""""""'""""""""'""""""""'""""""""'""""""""'""""""""'""""""""'"""""""'""'""'
""'""'""'""'""'""'""'""'""'""'"""'"'""""""""'"""""""'"""'"""'""""""'"""'""'""""""""""

```
> 4 votes

# Answer
## VBA - 25 22 distinct bytes (120 total)

I know this won't win with so many different bytes, but here it is in VBA.

`(space)`,`(newline)`,`"`,`,`,`(`,`)`,`=`,`a`,`b`,`c`,`d`,`e`,`E`,`I`,`l`,`n`,`O`,`p`,`R`,`S`,`u`,`1`

```
Sub S(u)
u=Replace(Replace(Replace(Replace(Replace(u,"u","",,,1),"O","",,,1),"I","",,,1),"e","",,,1),"a","",,,1)
End Sub

```

*<sub>`,,,1` allows for ignoring case. (`1` represents the constant `vbTextCompare`)</sub>
> 2 votes

# Answer
# JavaScript, 6 (7325 total)

```
[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(+(!+[]+!+[]+!+[]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+!+[]+[!+[]+!+[]])+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]])()((!![]+[])[+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[+!+[]]]+([]+[])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[!+[]+!+[]]+(!![]+[])[+!+[]]+(+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(+(!+[]+!+[]+[+!+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+!+[]+[+!+[]])[+!+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[+!+[]+[!+[]+!+[]+!+[]]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+([][(!![]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()+[])[+[]]+(![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+[]]+([][(!![]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()+[])[!+[]+!+[]+[!+[]+!+[]]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+(![]+[+[]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+[[]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]([[]])+[]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]]+([+[]]+![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[!+[]+!+[]+[+[]]])

```

This uses JSFuck to turn `r=>r.replace(/[aeiou]/g,"")` into six unique characters.
> 2 votes

# Answer
# Scala, 25 total bytes, 15 distinct bytes

```
_ filterNot "aeiou".toSet

```

Try it in Scastie!
> 2 votes

# Answer
# Itr, 4 distinct characters, 5197 bytes

*newlines for readability*

```
(
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
(()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()())L
)©

```

online interpreter

## Explanation

It is possible to execute arbitrary Itr code using only `()L©`:
`(()...())` creates an array of empty arrays
`L` gets the length of that array
`©` interprets the (flattened) array as a sequence of characters and executes that sequence

The code that is encoded by this program is `äµ»»AEIOUaeiou«=S¬«×`:

```
ä                     ; duplicate the (implicit) input
 µ»               «   ; map over all characters in the input
   »AEIOUaeiou«=S     ; is the character in the string "AEIOUaeiou"
                 ¬    ; negated
                    × ; pick the elements that have a one in the second array

```
> 2 votes

# Answer
# K, 29. (18 distinct bytes)

```
{i@&~(i:0:0)in(_i),i:"AEIOU"}

```

distinct bytes: {@&~(:0)in\_,"AEIOU}

```
k){i@&~(i:0:0)in(_i),i:"AEIOU"}`
Hello WoOOrld
"Hll Wrld"

```
> 1 votes

# Answer
## Python 3.x, 19 distinct chars, 62 total

```
print(''.join(x for x in input() if x.lower() not in 'aeiou'))

```
> 1 votes

# Answer
## J, 21 characters (18 distinct)

```
'AEIOUaeiou'-.~1!:1[1

```
> 1 votes

# Answer
**ASM - 6 distinct characters 520 source characters** (MsDOS .com)

Assembled using A86

```
db 10110100xb
db 00000110xb
db 10110010xb
db 11111111xb
db 11001101xb
db 00100001xb
db 01110101xb
db 00000001xb
db 11000011xb
db 10001010xb
db 11010000xb
db 10111110xb
db 00011101xb
db 00000001xb
db 10111001xb
db 00001010xb
db 00000000xb
db 01000110xb
db 00101010xb
db 00000100xb
db 01110100xb
db 11101010xb
db 11100010xb
db 11111001xb
db 10110100xb
db 00000110xb
db 11001101xb
db 00100001xb
db 11101011xb
db 11100010xb
db 01000001xb
db 00000100xb
db 00000100xb
db 00000110xb
db 00000110xb
db 00001100xb
db 00000100xb
db 00000100xb
db 00000110xb
db 00000110xb

```
> 1 votes

# Answer
# MATL, 8 bytes (all distinct)

```
t13Y2m~)

```

Try it on MATL Online

Just a straight up golf, didn't really find any trick to reuse characters to reduce unique bytecount.

`13Y2` is a literal containing `aeiouAEIOU`.

Take a duplica`t`e of the input string, make a logical (boolean) array indicating which letters of the input are not (`~`) `m`embers of that literal, and index (`)`) at those places, to return an array of only non-vowel characters.
> 1 votes

# Answer
# K (oK), 16 bytes, 14 distinct

**Solution:**

```
^[;v,_v:"AEIOU"]

```

Try it online!

**Explanation:**

Using except (`^`) to filter out the vowels.

```
^[;v,_v:"AEIOU"] / the solution
^[;            ] / except (^) projection
      v:"AEIOU"  / save vowels as v
     _           / lowercase (_), "AEIOU" => "aeiou"
    ,            / join (,)
   v             / uppercase vowels

```
> 1 votes

# Answer
# Vyxal, 4 bytes, 4 distinct characters

```
k∨$F

```

Try it Online!

Only works with single-line strings. Explanation:

```
      # Implicit input
k∨    # Constant "aeiouAEIOU"
  $   # Swap top two values
   F  # Remove from second string any characters in first string
      # Implicit output

```
> 1 votes

# Answer
# Unary, ~3.081e<sup>1915</sup> bytes, 1 distinct character

Specifically, this is how many `0`s are required. Simply a Unary port of the brainfuck answer by @ceased to turn clockwis.
> 1 votes

# Answer
# Jelly, 3 bytes

```
ḟØc

```

Try it online!
> 1 votes

# Answer
# APL (Dyalog Extended), 17 bytes, 13 distinct

```
((⌊,⊢)'AEIOU')~⍨⊢
 (⌊,⊢)'AEIOU' ⍝ concatenate with lower case version of string
   ~⍨⊢ ⍝ remove vowels

```

Try it online!
> 1 votes

# Answer
# Python 2, 7 distinct bytes, ~~2091~~ 2082 bytes

```
c="%c%%c%%%%c%%%%%%%%c"
ex=c==c
ee=c==""
exec"e=%x%%x"%ex%ex
exec"e%%%%%%%%=%x%%x%%%%x"%ee%ex%ee
exec"ee=%x%%x"%e%ee
exec"ee%%%%=%x%%x"%ex%e
exec"e=%x%%x"%ee%e
exec"ec=ex%cex"%e
exec"xe=ec%cec"%e
exec"xx=xe%cxe"%e
exec"xc=xx%cxx"%e
exec"ce=xc%cxc"%e
exec"cc=ce%cce"%e
exec"xee=ce%cec"%e
exec"cee=ce%cxx"%e
exec"exe=ce%cex%%cxx"%e%e
exec"xxe=ce%cec%%cxe%%%%cxx"%e%e%e
exec"cxe=ce%cec%%cxx%%%%cxc"%e%e%e
exec"ece=cc%cex"%e
exec"xce=cc%cex%%cxe"%e%e
exec"cce=cc%cex%%cxx"%e%e
exec"eex=cc%cex%%cec%%%%cxe%%%%%%%%cxx"%e%e%e%e
exec"xex=cc%cex%%cxe%%%%cxc"%e%e%e
exec"cex=cc%cex%%cec%%%%cxx%%%%%%%%cxc"%e%e%e%e
exec"exx=cc%cex%%cxe%%%%cxx%%%%%%%%cxc"%e%e%e%e
exec"xxx=cc%cex%%cec%%%%cxe%%%%%%%%cxx%%%%%%%%%%%%%%%%cxc"%e%e%e%e%e
exec"cxx=cc%cex%%cce"%e%e
exec"ecx=cc%cex%%cec%%%%cce"%e%e%e
exec"xcx=cc%cex%%cxe%%%%cce"%e%e%e
exec"ccx=cc%cec%%cxe%%%%cce"%e%e%e
exec"eec=cc%cxx%%cce"%e%e
exec"xec=cc%cex%%cxx%%%%cce"%e%e%e
exec"cec=cc%cec%%cxx%%%%cce"%e%e%e
exec"exc=cc%cxe%%cxx%%%%cce"%e%e%e
exec"xxc=cc%cec%%cxe%%%%cxx%%%%%%%%cce"%e%e%e%e
exec"cxc=cc%cex%%cec%%%%cxe%%%%%%%%cxx%%%%%%%%%%%%%%%%cce"%e%e%e%e%e
exec"ecc=cc%cxc%%cce"%e%e
exec"xcc=cc%cec%%cxc%%%%cce"%e%e%e
exec"ccc=cc%cex%%cec%%%%cxc%%%%%%%%cce"%e%e%e%e
exec"eeee=cc%cxe%%cxc%%%%cce"%e%e%e
exec"xeee=cc%cex%%cxe%%%%cxc%%%%%%%%cce"%e%e%e%e
exec"ceee=cc%cec%%cxe%%%%cxc%%%%%%%%cce"%e%e%e%e
exec"exee=cc%cex%%cec%%%%cxe%%%%%%%%cxc%%%%%%%%%%%%%%%%cce"%e%e%e%e%e
exec"xxee=cc%cxx%%cxc%%%%cce"%e%e%e
exec"""x=""
"""
exec"x%c=c%%xcx%%xxee%%xcx%%ecx"%e
exec"x%c=c%%xee%%xee%%xxe%%cec"%e
exec"x%c=c%%cxc%%xec%%xxc%%cee"%e
exec"x%c=c%%ecx%%eec%%xcc%%cee"%e
exec"x%c=c%%xcx%%ceee%%cxx%%exc"%e
exec"x%c=c%%cee%%ecx%%exe%%exe"%e
exec"x%c=c%%ccx%%cxc%%xcc%%ce"%e
exec"x%c=c%%ecx%%ce%%xec%%xxc"%e
exec"x%c=c%%ce%%ecx%%xxee%%xxe"%e
exec"x%c=c%%ccc%%ecc%%exc%%xec"%e
exec"x%c=c%%eeee%%cee%%exe%%exe"%e
cx="""ecc
xcc
xec
xxc
eeee
xee
xee
xxe
cec
cxc
xec
xxc
cee
cxx
cex
cxx
ce
xec
xxc
xee
cxx
xcx
xec
cxc
xeee
ece
xce
cce
eex
xex
xee
cxe
exx
ccx
cxc
xcc
ce
cxx
ce
xec
xxc
ce
xcc
cxx
exee
xxx
xec
xxc
ecc
xeee
eeee
cee
exe
exe"""
exec"exec%cx"%ce

```

Try it online!

I'm using the algorithm of this question to translate the following code in the code above to only use `e`, `x`, `c`, `"`, `=`, `%` and newline. Make sure to follow the link to understand how the transformation works

## code before transformation: (~~57~~ 54 bytes)

```
print"".join(a[a in"aeiouAEIOU":]for a in raw_input())

```

Try it online!

Even if the first code isn't golfed, this one is :p

Thanks to dingledooper for -3 bytes on the second program
> 1 votes

# Answer
# Lua, 12 distinct characters, 3245 2924 bytes

```
load(('').char(#'################################################################################################################')..'r'..('').char(#'#########################################################################################################')..('').char(#'##############################################################################################################')..('').char(#'####################################################################################################################')..'(('..('').char(#'#########################################################################################################')..'o'..('').char(#'##############################################')..'r'..('').char(#'#####################################################################################################')..'ad'..('').char(#'#######################################')..('').char(#'##########################################')..'a'..('').char(#'#######################################')..('').char(#'##########################################################')..('').char(#'#######################################################################################################')..('').char(#'###################################################################################################################')..('').char(#'#####################################################################################################################')..('').char(#'##################################################################################################')..'('..('').char(#'#######################################')..('').char(#'###########################################################################################')..'a'..('').char(#'#####################################################################################################')..('').char(#'#########################################################################################################')..'o'..('').char(#'#####################################################################################################################')..('').char(#'#################################################################')..('').char(#'#####################################################################')..('').char(#'#########################################################################')..('').char(#'###############################################################################')..('').char(#'#####################################################################################')..('').char(#'#############################################################################################')..('').char(#'#######################################')..('').char(#'############################################')..('').char(#'#######################################')..('').char(#'#######################################')..')))')()

```

Try it online!

Uses the characters `#load(').chr`. Essentially, this program builds the string `print((io.read'*a':gsub('[aeiouAEIOU]','')))`, loads it as a function, and then runs it.

Thanks to xigoi for saving about 300 bytes.
> 1 votes

# Answer
# Ruby, 8 distinct, 557 bytes

```
eval""<<11+11+11+1+1+1<<11+11+11+11+11+1+1+1+1+1+1+1<<"<<"<<11+11+11+1+1+1<<"<"<<11+11+11+11+1+1<<111+1+1+1<<"ea"<<11+11+11+11+11+11+11+11+11+1<<11+11+11+11+1+1<<11+11+11+11+11+11+11+11+11+1+1+1+1<<111+1+1+1+1<<111+1+1+1+1+1+1<<11+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1<<11+11+11+1+1+1+1+1+1+1<<11+11+11+11+1+1+1<<11+11+11+11+11+11+11+11+1+1+1<<"ae"<<11+11+11+11+11+11+11+11+11+1+1+1+1+1+1<<111<<111+1+1+1+1+1+1<<11+11+11+11+11+11+11+11+1+1+1+1+1<<11+11+11+11+1+1+1<<11+11+11+11+11+11+11+11+11+1+1+1+1+1+1<<11+11+11+1+1+1+1+1+1+1+1<<111+11+1<<111+11+1+1+1

```

Attempt This Online!

Encodes the following 30 byte (21 unique) program in the minimum distinct characters `eval"<1+` using the technique from GB's answer to this question.

```
$><<$<.read.gsub(/[aeiou]/i){}

```
> 1 votes

# Answer
# Lexurgy, 17 distinct, 28 bytes

```
a:
{a,e,i,o,u,A,E,I,O,U}=>*

```

If we didn't have to support uppercase letters, **12 distinct, 18 bytes**:

```
a:
{a,e,i,o,u}=>*

```
> 1 votes

# Answer
# Vyxal, 18 bits<sup>v2</sup>, 2.25 bytes, 2 distinct characters

```
011110011111001000

```

Try it Online! (link is to bitstring)

Vyncode FTW! The actual program is encoded as a bitstring. I also shaved a character off of @Aaroneous Miller's answer
> 1 votes

# Answer
## PHP - 30 distinct bytes

```
<?=preg_replace('/[aeiou]/i','',fgets(STDIN));

```
> 0 votes

# Answer
### bash 26 distinct, 37 total

```
c=$(cat -)
echo "${c//[aeiouAEIOU]/}"

```

sorted:

```
""$$()-///=AEIOU[]aacccceehiootu{}"

scala> code.toList.distinct.length
res51: Int = 26

scala> code.length
res52: Int = 37

"
  ""$$()-///=AEIOU[]aacccceehiootu{}"

scala> code.distinct.sorted
res56: String =
"
 "$()-/=AEIOU[]acehiotu{}"

```

Result (preserves linefeeds):

```
echo "This program will remove VOWELS.
So we can now speak without them." | ./cg-6025-remove-vowels.sh
Ths prgrm wll rmv VWLS.
S w cn nw spk wtht thm.

```

For tr, it isn't clear how to count: '-d aeiouAEIOU' as 10 or 13:

```
echo "This program will remove VOWELS.
So we can now speak without them." | tr -d aeiouAEIOU

```
> 0 votes

# Answer
## F# 105 121 91 characters

```
Console.ReadLine()|>Seq.filter(fun c->not("aeiouAEIOU".Contains(c)))|>Seq.iter(printf"%c")

```
> 0 votes

# Answer
## Excel Formula - 19 distinct bytes (196 total)

`=`,`S`,`B`,`T`,`(`,`)`,`,`,`"`,`a`,`e`,`i`,`o`,`u`,`A`,`E`,`I`,`O`,`U`,`1`

```
Cell A1: <Value>
Cell B1: =SUBSTITUTE(SUBSTITUTE(A1,"a",""),"e","")
Cell C1: =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B1,"i",""),"o",""),"u",""),"A",""),"E",""),"I",""),"O",""),"U","")

```

\*This actually is too many nested functions to work in Excel 2003, but the concept is there.

**Splitting the formulas into two cells achieved the desired effect.** -- Result is in C1.
> 0 votes

# Answer
# Noether, 16 individual bytes (17 total)

```
I"[aeiouAEIOU]"-P

```

**Try it online!**

Uses the regex

```
[aeiouAEIOU]

```

to remove the vowels from the input string.
> 0 votes

# Answer
# jq, 119 bytes, 15 distinct characters

```
explode-[121-2-2,111,111-2-2-2,111-2-2-2-2-2,111-12-2,111-22-2-2,111-21-11,111-22-12-2-2,111-21-21,111-22-22-2]|implode

```

Try it online!

Here's how is works.

```
explode

```

Converts the input, which has to be a quoted string or `jq` can't parse it, to an array of codepoints.

```
-[121-2-2,111,111-2-2-2,111-2-2-2-2-2,111-12-2,111-22-2-2,111-21-11,111-22-12-2-2,111-21-21,111-22-22-2]

```

Remove all occurrences of upper and lower case vowels, which are representing as numeric expressions that map to the codepoints. You COULD make a program with one less unique character by limiting the expressions to `1` and `-`, but it would be very long...

```
|implode

```

Converts the array of codepoints left into a string and prints it.
> 0 votes

# Answer
# PowerShell, 26 bytes

```
|%{$_-replace'[aeiou]',''}

```

Anything before the `|` will be devowel'd.
> 0 votes

# Answer
# Befunge-98 (PyFunge), 11 distinct characters, 263 bytes

```
<,_v#-''-''-'':_v#----'<'~':_v#--'-<':_v#--#'''-:'-'':_v#-:'-'':_v#---''-'-#'~':_v#--''v':_v#---,'-'-,'v':_v#--,'-'--:'~':_v#--,'-'-@':~@#
v<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

```

Try it online!

Basically, checks each character against each of `AEIOUaeiou`, whose code points are constructed from the code points of the characters used elsewhere in the program, `#',-:<@_v~`.

The program also contains a newline. I'm pretty sure with much editing this could get down to 10 or even 9 characters by replacing `v` and the newline with some other method of returning to the start without the extra line, and there may be a way to also remove `<` in that case by leveraging a `_`.

For example:

The first chunk of code after the character read (right to left above, presented here left to right for clarity) is `:'@-'-',--#v_`. `:` duplicates the character, `'@-` subtracts the value `@` (64) from the character, `'-',-` subtracts `,` (44) from `-` (45) to get 1, which is then subtracted (`-`) from the character, in total subtracting by 65, the code point for `A`. Then `#v_` checks if this total is 0 (the character is A), and either sends the program down and to the next input or continues through the other vowels. If it passes all the checks, the character is printed.
> 0 votes

# Answer
## Pascal, 35 distinct characters

This complete `program` requires a processor supporting features of Extended Pascal (as defined by ISO standard 10206), in particular the `index` function needs to be present. Note, to avoid the drama associated with all sorts of various end‑of‑line markers, Pascal (as defined by the ISO standard 7185 and 10206) says that for a `text` file (such as `input`) substitutes the end‑of‑line marker (whatever it may be) with a single space character (`' '`). Therefore the `program` does not reproduce the example’s *two* lines but *one* line joined by a space.

```
program p(input,output);var c:char;begin while not eof do begin read(c);if 0=index('AEIOUaeiou',c)then write(c)end end.

```

Ungolfed:

```
program removeVowelsWithoutUsingTooManyDifferentCharacters(input, output);
    var
        currentCharacter: char;
    begin
        while not EOF(input) do
        begin
            { This is equivalent to `currentCharacter ≔ input↑; get(input);`. }
            read(input, currentCharacter);

            { `index` returns zero if the pattern `currentCharacter`
              does not appear in the sample `'AEIOUaeiou'`. }
            if index('AEIOUaeiou', currentCharacter) = 0 then
            begin
                { Equivalent to `output↑ ≔ currentCharacter; put(output);`. }
                write(output, currentCharacter);
            end;
        end;
    end.

```
> 0 votes

# Answer
# Python (23)

Somebody had to do it.

```
print filter(lambda x:x not in'aeiou',raw_input())

```
> -1 votes

---
Tags: code-challenge, string
---


title: Prefix code generator

text:
# Question
Title: Prefix code generator
In this challenge, we consider an encoding from positive integers (up to a limit) to binary sequences. Some examples:

```
A. 1 -> 00, 2 -> 01, 3 -> 10, 4 -> 11

B. 1 -> 0, 2 -> 1, 3 -> 01

C. 1 -> (empty sequence)

```

A prefix code is a coding where no code is a prefix of another. `B` is not a prefix code because the code for 1 (`0`) is a prefix of that for 3 (`01`). Fibonacci coding and Elias omega coding are examples of prefix codes that can encode all positive integers.

It is possible to construct a prefix code where 1 encodes to a code of length \\$l\_1\\$, 2 to \\$l\_2\\$, ..., \\$n\\$ to \\$l\_n\\$ if the sum of \\$\tfrac{1}{2}\\$ raised to the power of each length does not exceed 1, i.e. \\$\sum\_{i=1}^{n}{\tfrac{1}{2^{l\_i}}} \le 1\\$. Your task is to construct such a prefix code where \\$l\_1, \cdots, l\_n\\$ is the input.

The following I/O are allowed:

* Take the list as input, and output the list or mapping of encodings for each positive integer
* Take the list and a number to encode as input, and output the encoding for the given number

Each encoding (binary sequence) can be given as a list or a string. Outputting as a single integer is not allowed, as leading zeros are not representable. You can choose to output an encoding for \\$0, \cdots, n-1\\$ instead of \\$1, \cdots, n\\$.

### Examples

```
[0] -> {1 -> ""}
[1, 1] -> {1 -> "0", 2 -> "1"}
[2, 3, 4, 4, 5, 5, 5] ->
  {1 -> "11"
   2 -> "011"
   3 -> "0011"
   4 -> "1011"
   5 -> "00011"
   6 -> "10011"
   7 -> "01011"}
[3, 3, 3, 1, 3] ->
  {1 -> "101"
   2 -> "111"
   3 -> "110"
   4 -> "0"
   5 -> "100"}
[5, 4, 3, 2, 5, 4, 3, 2] ->
  {1 -> "10101"
   2 -> "1011"
   3 -> "000"
   4 -> "01"
   5 -> "10100"
   6 -> "1001"
   7 -> "001"
   8 -> "11"}

```

# Answer
# 05AB1E, 21 bytes

```
āø{ø`soDzηO>*<b€¦sākè

```

Try it online!

Uses the same idea as arithmetic coding. Fails for lengths greater than 53 due to floating-point inaccuracies.

If we can output sorted by length, we can we 12 bytes:

# 05AB1E, 12 bytes

```
{oDzηO>*<b€¦

```

Try it online!
> 4 votes

# Answer
# Jelly, 18 bytes

```
eƤ€`Ḅ=QƑẠ
Ø.ṗŒpÇƇṪ

```

A monadic Link that accepts the lengths and yields a list of prefix-codes in the same order.

**Try it online!**

Save a byte by outputting symbols \\$1\\$ and \\$2\\$ by replacing `Ø.` with `2`.

### How?

```
eƤ€`Ḅ=QƑẠ - Link 1: isValid?: list of codes, Assignment
   `      - use {Assignment} as both arguments of:
  €       -   for each Code in {Assignment}:
 Ƥ        -     for each prefix of {Code}:
e         -       exists in {Assignment}?
    Ḅ     - convert {each exists-in vector} from binary
              -> PrefixFoundIds, a list of ints
                 ...a value is greater than 1 when a prefix was in Assignments
                    otherwise it equals 1 (only the full code was in Assignments)
       Ƒ  - is {Assignments} invariant under?:
      Q   -   deduplication
                -> AllDifferent = 0 if there are repeats, 1 if not
     =    - {PrefixFoundIds} equals {AllDifferent} (vectorises)
        Ạ - all?

Ø.ṗŒpÇƇṪ - Main Link: list of integers, CodeLengths
Ø.       - [0,1]
  ṗ      - Cartesian product {CodeLengths} (vectorises)
             -> all codes for each of the respective lengths
   Œp    - Cartesian product
             -> all possible Assignments of codes
      Ƈ  - filter keep those {Assignments} for which:
     Ç   -   call Link 1 as a monad - f(Assignment)
       Ṫ - tail

```

---

## 17 bytes (non-compliant)

Less brute force, so much faster, but outputs the prefix codes sorted by their lengths. Again `Ø.` could be replaced with `2` to save a byte. If the input were guaranteed to be sorted too, then `2ṗeƤẸ¥ÐḟḢṭð@ƒḟ` does the job at \\$14\\$ bytes.

```
Ø.ṗeƤẸ¥ÐḟḢṭ
Ṣç@ƒḟ

```

**Try it online!**

### How?

```
Ø.ṗeƤẸ¥ÐḟḢṭ - Link 1: integer NextCodeLength, list of codes, FoundAlready
Ø.          - [0,1]
  ṗ         - Cartesian power {NextCodeLength} -> PotentialCodes
       Ðḟ   - filter discard those for which:
      ¥     -   last two links as a dyad - f(PotentialCode, FoundAlready)
    Ƥ       -     for prefixes of {PotentialCode}
   e        -       exists in {FoundAlready}?
     Ẹ      -     any?
         Ḣ  - head -> first valid PotentialCode
          ṭ - tack to {FoundAlready}

Ṣç@ƒḟ - Main Link: list of integers, CodeLengths
Ṣ     - sort {CodeLengths}
    ḟ - {CodeLengths} filter discard {CodeLengths} -> [] (initial FoundAlready)
   ƒ  - starting with {[]} reduce {sorted CodeLengths} by:
  @   -   with swapped arguments:
 ç    -     call the dyadic helper above, Link 1 = f(NextCodeLength, FoundAlready)

```
> 4 votes

# Answer
# Python, 88 bytes

```
lambda s,k=0,r=2:{j:bin(r:=(r<<-k+(k:=i))-1)[3:]for i,j in sorted(zip(s,range(len(s))))}

```

Attempt This Online!

Takes a list of integers and returns a dictionary.

## How?

Sorts the prescribed lengths and then simply counts down binary numbers of that length appending zeros when the length increases.
> 1 votes

# Answer
# JavaScript (ES6), 115 bytes

A simple but quite long algorithm.

```
a=>a.map((v,i)=>(h=x=>b.some(s=>c.match("^"+s)+s.match("^"+c),c=x.toString(2).padStart(v,0))?h(-~x):b[i]=c)``,b=[])

```

Try it online!

### Method

We process all entries in the input order. For each entry, we simply start with \\$x=0\\$ and increment it while \\$x\\$ is a prefix of a previous output or a previous output is a prefix of \\$x\\$, in left-padded binary format.

### Note

Because \\$x\\$ is actually initialized to `['']`, `x.toString(2).padStart(0,0)` returns an empty string rather than `"0"`, which is the expected behavior for the edge case `a = [0]`.
> 0 votes

# Answer
# Charcoal, 30 bytes

```
→Ｆ⊕⌈θ«Ｆ⌕Ａθι«§≔θκΦ⍘ⅈ²μ→»Ｍⅈ→»θ

```

Try it online! Link is to verbose version of code. Explanation:

Start with a next code number of `1`, but all the codes will have their leading `1` removed again later.

```
Ｆ⊕⌈θ«

```

Loop over all possible code lengths.

```
Ｍⅈ→

```

Double the next code number.

```
Ｆ⌕Ａθι«

```

Loop over all indices with this length.

```
§≔θκΦ⍘ⅈ²μ

```

Generate the code of this length, but remove the leading `1`.

Increment the next code number.

```
»»θ

```

Output the resulting codes.
> 0 votes

---
Tags: code-golf, binary, open-ended-function, coding-theory
---


title: First occurrence in the Sixers sequence

text:
# Question
Title: First occurrence in the Sixers sequence
The **Sixers sequence** is a name that can be given to sequence A087409. I learned about this sequence in a Numberphile video, and it can be constructed as follows:

First, take the multiples of 6, written in base 10:

`6, 12, 18, 24, 30, 36, ...`

Next, concatenate the numbers into a stream of digits:

`61218243036...`

Finally, regroup the stream into pairs and interpret each as an integer:

`61, 21, 82, 43, 3, ...`

As we're grouping the numbers into pairs, the maximum number in the sequence will be 99, and it turns out that all non-negative integers less than 100 are represented in the sequence. This challenge is to find the index of the first instance of a number in the Sixers sequence.

## Input

An integer in the range `[0-99]`. You do not need to account for numbers outside this range, and your solution can have any behaviour if such an input is given.

## Output

The index of the first occurrence of the input number in the Sixers sequence. This may be 0- or 1-indexed; please say which you are using in your answer.

## Rules

* The procedure to generate the sequence noted in the introduction is for illustrative purposes only, you can use any method you like as long as the results are the same.
* You can submit full programs or functions.
* Any sensible methods of input and output are allowed.
* Standard loopholes are disallowed.
* Links to test your code online are recommended!
* This is , so shortest answer in each language wins!

## Test cases

Here is a list of all input and outputs, in the format `input, 0-indexed output, 1-indexed output`.

```
0   241 242
1   21  22
2   16  17
3   4   5
4   96  97
5   126 127
6   9   10
7   171 172
8   201 202
9   14  15
10  17  18
11  277 278
12  20  21
13  23  24
14  19  20
15  29  30
16  32  33
17  297 298
18  35  36
19  38  39
20  41  42
21  1   2
22  46  47
23  69  70
24  6   7
25  53  54
26  22  23
27  11  12
28  62  63
29  219 220
30  65  66
31  68  69
32  71  72
33  74  75
34  49  50
35  357 358
36  80  81
37  83  84
38  25  26
39  89  90
40  92  93
41  27  28
42  42  43
43  3   4
44  101 102
45  104 105
46  8   9
47  177 178
48  110 111
49  13  14
50  28  29
51  119 120
52  122 123
53  417 418
54  79  80
55  128 129
56  131 132
57  134 135
58  55  56
59  437 438
60  140 141
61  0   1
62  31  32
63  75  76
64  5   6
65  120 121
66  82  83
67  10  11
68  161 162
69  164 165
70  58  59
71  477 478
72  170 171
73  173 174
74  34  35
75  179 180
76  182 183
77  497 498
78  85  86
79  188 189
80  191 192
81  18  19
82  2   3
83  78  79
84  93  94
85  7   8
86  37  38
87  168 169
88  12  13
89  228 229
90  88  89
91  218 219
92  221 222
93  224 225
94  64  65
95  557 558
96  230 231
97  233 234
98  40  41
99  239 240

```

# Answer
# JavaScript (ES6),  ~~71 65~~  55 bytes

Output is 0-indexed.

```
n=>(g=([a,b,...c])=>b?a+b-n&&1+g(c):g([a]+6*++i))(i='')

```

Try it online!

### How?

Using a recursive function, we either 'consume' the first 2 characters of the string of concatenated multiples of \\$6\\$, or append new characters if we have less than 2 of them.

Example for \\$n=3\\$:

```
 string | operation                          | result
--------+------------------------------------+--------
 ''     | not enough characters: append '6'  |   0
 '6'    | not enough characters: append '12' |   0
 '612'  | consume '61', increment the result |   1
 '2'    | not enough characters: append '18' |   1
 '218'  | consume '21', increment the result |   2
 '8'    | not enough characters: append '24' |   2
 '824'  | consume '82', increment the result |   3
 '4'    | not enough characters: append '30' |   3
 '430'  | consume '43', increment the result |   4
 '0'    | not enough characters: append '36' |   4
 '036'  | consume '03': success              |   4

```

### Commented

```
n => (             // n = input
  g = (            // g is a recursive function taking either a string or an array of
                   // characters split into:
    [a, b,         //   a = 1st character, b = 2nd character,
           ...c]   //   c[] = array of all remaining characters
  ) =>             //
    b ?            // if b is defined:
      a + b - n && //   if n subtracted from the concatenation of a and b is not zero:
        1 + g(c)   //     add 1 to the final result and do a recursive call with c[]
                   //   (otherwise: yield 0 and stop recursion)
    :              // else:
      g(           //   do a recursive call with:
        [a] +      //     the concatenation of a (forced to an empty string if undefined)
        6 * ++i    //     and 6 * i, with i pre-incremented
      )            //   end of recursive call
)(i = '')          // initial call to g with an empty string,
                   // and i set to empty string as well (zero'ish)

```
> 13 votes

# Answer
# Python 2, ~~93~~ ~~92~~ ~~85~~ ~~83~~ ~~81~~ ~~68~~ ~~65~~ 59 bytes

```
f=lambda n,s='612',i=18:n-int(s[:2])and-~f(n,s[2:]+`i`,i+6)

```

Try it online!

---

* -2 bytes, thanks to Grimy
* -3 bytes, thanks to ArBo
* -6 bytes, thanks to xnor
> 12 votes

# Answer
# Perl 6, 31 bytes

```
{+(comb(2,[~] 1..ⅮX*6)...$_)}

```

Try it online!

Uses the 1-indexed sequence.

### Explanation:

```
{                            } # Anonymous code block
              1..Ⅾ             # The range 1 to 500
                   X*6         # All multiplied by 6
          [~]                  # Join as one giant string
   comb(2,            )        # Split into pairs of characters
                       ...$_   # Take up to the input
 +(                         )  # And return the length of the list

```
> 8 votes

# Answer
# Haskell, ~~82 ... 65 58~~ 54 bytes

```
k$show=<<[6,12..]
k(a:b:c)t|read[a,b]==t=0|let=1+k c t

```

Try it online!
> 7 votes

# Answer
# 05AB1E, 9 bytes

```
₄L6*J2ôIk

```

0-indexed. Accepts either a single integer, or a list of integers as input.

Try it online or verify all test cases.

**Explanation:**

```
₄L         # Create a list in the range [1,1000]
  6*       # Multiply each value by 6
    J      # Join the entire list of integers together to a string
     2ô    # Split into parts of size 2
       Ik  # Get the index of the input integer(s)
           # (and output the result implicitly)

```
> 5 votes

# Answer
# APL (Dyalog Unicode), 26 bytes

```
{⍵⍳⍨⍎¨((≠\=⍨)⊂⊢)∊⍕¨6×⍳325}

```

Try it online! \- Tests for all valid inputs.

### How:

```
{⍵⍳⍨⍎¨((≠\=⍨)⊂⊢)∊⍕¨6×⍳325} ⍝ Dfn, input is ⍵.
                    6×⍳325  ⍝ Generates the first 325 multiples of 6.
                  ⍕¨        ⍝ Format each number into a string
                 ∊          ⍝ Enlist, flattens the vector
       (      ⊂⊢)           ⍝ Dyadic enclose, takes a boolean mask as left argument
        (≠\=⍨)              ⍝ Generates the mask 1 0 1 0...
                            ⍝ Enclose then returns the Sixers sequence as a string
     ⍎¨                     ⍝ Execute each element in the string, turning it into a numeric vector
 ⍵⍳⍨                        ⍝ Find the first occurrence of ⍵ in the vector

```
> 5 votes

# Answer
# Charcoal, 12 bytes

```
Ｉ⌕Ｉ⪪⭆φ×⁶⊕ι²Ｎ

```

Try it online! Link is to verbose version of code. 0-indexed. Explanation:

```
     φ           Predefined constant 1000
    ⭆           Map over implicit range and join
        ι       Current index
       ⊕        Incremented
     ×⁶         Multiplied by 6
   ⪪      ²     Split into pairs of digits
  Ｉ             Cast to integer
           Ｎ    Input as a number
 ⌕              Find its index
Ｉ               Cast to string
                Implicitly print

```
> 4 votes

# Answer
# , ~~29~~ 26 bytes

-3 bytes thanks to FrownyFrog!

```
i.~_2(".\;)6<@":@*1+i.@325

```

Try it online!

0-based
> 4 votes

# Answer
# Python 3, ~~87~~ 81 Bytes:

```
lambda n:[*zip(*[iter(''.join(map(str,range(6,1951,6))))]*2)].index((*'%02d'%n,))

```

integer input, 0-indexed output.

Try it online!

---

<sub>-6 bytes, thanks to @TFeld.</sub>
> 3 votes

# Answer
# Wolfram Language (Mathematica), 74 bytes

```
#&@@Position[FromDigits/@Flatten@IntegerDigits[6Range@365]~Partition~2,#]&

```

Try it online!

2 bytes saved from @Expired Data
> 3 votes

# Answer
# , ~~75~~ 62 bytes

-13 bytes thanks to Giuseppe.

```
match(scan(,''),substring(Reduce(paste0,3*(a=2*1:999)),a-1,a))

```

Try it online!
> 3 votes

# Answer
# Brachylog, 14 bytes

```
;İS∧⟦×₆ᵐcġ₂iSt

```

Try it online!

Too slow for test cases with larger outputs.
> 3 votes

# Answer
# x86-16 machine code, ~~54~~ 53 bytes

```
00000000: bde5 032b e58b fc57 9633 c0b9 2701 0506  ...+...W.3..'...
00000010: 0050 e80d 0058 e2f6 965f 49f2 aff7 d103  .P...X..._I.....
00000020: e5c3 bb0a 0052 33d2 f7f3 85c0 7403 e8f4  .....R3.....t...
00000030: ff92 aa5a c3                             ...Z.

```

**Listing:**

```
BD 03E5     MOV   BP, 997       ; digits list buffer size
2B E5       SUB   SP, BP        ; allocate from stack
8B FC       MOV   DI, SP        ; DI = start of digits buffer
50          PUSH  AX            ; save input value
57          PUSH  DI            ; save buffer offset
33 C0       XOR   AX, AX        ; counter in AX = 0
B9 0127     MOV   CX, 295       ; generate 295*6 multiples
        SIX_LOOP:
05 0006     ADD   AX, 6         ; increment counter by 6
50          PUSH  AX            ; save AX (clobbered by OUT_DECU)
E8 000D     CALL  OUT_DECU      ; write AX to BCD at ES:DI
58          POP   AX
E2 F6       LOOP  SIX_LOOP      ; loop 295 times
5F          POP   DI            ; restore start of output buffer
58          POP   AX            ; restore input number
49          DEC   CX            ; loop count FFFFh (solution guaranteed)
F2 AF       REPNZ SCASW         ; search for input value
F7 D1       NOT   CX            ; ones complement sign without increment
03 E5       ADD   SP, BP        ; restore stack pointer
C3          RET
        OUT_DECU:               ; divide unsigned word AX into base 10
                                ;  decimal digits to buffer at ES:DI
BB 000A     MOV   BX, 10        ; decimal divisor = 10
        OUT_DECU_R:
52          PUSH  DX            ; save remainder digit / caller DX
33 D2       XOR   DX, DX        ; clear high word of dividend
F7 F3       DIV   BX            ; AX = DX:AX / 10, DX = DX:AX % 10
85 C0       TEST  AX, AX        ; is zero?
74 03       JZ    OUT_DECU_DONE ; loop while AX > 0
E8 FFF4     CALL  OUT_DECU_R    ; recursive call to next division
        OUT_DECU_DONE:
92          XCHG  AX, DX        ; AL = digit
AA          STOSB               ; write to digits list
5A          POP   DX            ; restore digit
C3          RET

```

Callable function, input value as little endian BCD in `AX`. Output 1-based index in `CX`.

The easy approach... generate the entire list and search it.

Note: I found experimentally that `295*6` is sufficient to generate needed values: `295*6 = 1770` of which the `77` is the value for the highest index (497 or 498). This would produce a string 997 digits long.

**Tests:**
> 3 votes

# Answer
# Jelly, 10 bytes

```
ȷ×€6DFs2Ḍi

```

Try it online!

TIO link gives all values for 0 to 99.

### Explanation

```
ȷ          | 1000
 ×€6       | each times 6 (using implicit range from 1..1000)
    D      | Convert to decimal digits
     F     | Flatten
      s2   | Split into pairs
        Ḍ  | Convert back from decimal digits to integer
         i | Find index of left argument to link

```
> 2 votes

# Answer
# Java 10, ~~119~~ ~~104~~ 102 bytes

```
n->{int i=2;for(var s="612";!s.substring(0,2).equals(""+n/10+n%10);)s=s.substring(2)+6*++i;return~-i;}

```

Port of *@TFeld*'s Python 2 answer.
-2 bytes thanks to *@Imus*.

1-indexed.

Try it online.

**Explanation:**

```
n->{                            // Method with integer as both parameter and return-type
  int i=2;                      //  Index-integer, starting at 2
  for(var s="612";              //  String, starting at "612"
      !s.substring(0,2)         //  Loop as long as the first two characters of the String
       .equals(                 //  Are not equal to:
               ""+n/10          //   The input integer-divided by 10 as String
               +n%10);)         //   Concatenated with the input modulo-10
                                //   (which will add leading 0s for inputs < 10)
    s=s.substring(2)            //   Remove the first two characters of the String
      +6*++i;                   //   And append 6 times `i`,
                                //   after we've first increased `i` by 1 with `++i`
return~-i;}                     //  Return `i-1` as result

```

---

**Original ~~119~~ 117 bytes version:**

```
n->{var s="";for(int i=0;i<2e3;)s+=i+=6;return java.util.Arrays.asList(s.split("(?<=\\G..)")).indexOf(""+n/10+n%10);}

```

0-indexed.

Try it online.

**Explanation:**

```
n->{                            // Method with integer as both parameter and return-type
  var s="";                     //  String we're building, starting empty
  for(int i=0;i<2e3;)           //  Loop `i` in the range [0, 2000):
      s+=i+=6;                  //   Increase `i` by 6 first every iteration
                                //   And then append the updated `i` to String `s`
  return java.util.Arrays.asList(
          s.split("(?<=\\G..)") //  Split the String in parts of size 2 (as array)
         )                      //  Convert the array to a List
          .indexOf(             //  And get the index of the following in this list:
                   ""+n/10      //   The input integer-divided by 10 as String
                   +n%10);}     //   Concatenated with the input modulo-10

```
> 2 votes

# Answer
# C# (Visual C# Interactive Compiler), ~~123 bytes~~ 115 bytes

```
a=>m.First(y=>int.Parse(string.Join("",m.Select((x,i)=>++i*6)).Substring(y*2,2))==a);var m=Enumerable.Range(0,640);

```

Try it online!
> 2 votes

# Answer
# APL+WIN, 37 bytes

Prompts for input of integer. 1 indexed.

```
↑(⎕=⍎,((n,2)⍴(⍕6×⍳n)~' '),' ')/⍳n←600

```

Try it online! Coutesy of Dyalog Classic
> 2 votes

# Answer
# MathGolf, 10 bytes

```
•╒6*y░2/i=

```

Try it online!

Basically the same as the 05AB1E answer, but I lose a byte by having to convert the concatenated number to string explicitly.

## Explanation

```
•╒             push [1, 2, ..., 512]
  6*           multiply by 6
    y          join array without separator to string or number
     ░         convert to string (implicit map)
      2/       split into groups of 2 characters
        i      convert to integer (implicit map)
         =     find index of implicit input in the array

```
> 2 votes

# Answer
# K (oK), 22 bytes

**Solution:**

```
(.:'0N 2#,/$6*1+!999)?

```

Try it online!

**Explanation:**

0-indexed.

```
(.:'0N 2#,/$6*1+!999)? / the solution
                     ? / lookup right in left
(                   )  / do this together
                !999   / range 0..999
              1+       / add 1, range 1...1000
            6*         / multiply by 6, 6...6000
           $           / convert to strings
         ,/            / flatten
    0N 2#              / reshape into 2xN
 .:'                   / value each, convert to numbers

```
> 2 votes

# Answer
# PHP, 58 bytes

```
<?=array_search($argn,str_split(join(range(6,1950,6)),2));

```

Try it online!

Input is 0-based via `STDIN`.

```
$ echo 0|php -F sixers.php
241

$ echo 50|php -F sixers.php
131

```
> 2 votes

# Answer
# CJam, 17 bytes

```
325,:)6f*s2/:~ri#

```

Try it online!

0-based.

### Explanation

```
325,   e# Range [0 1 2 ... 324]
:)     e# Add 1 to each: gives [1 2 3 ... 325]
6f*    e# Multiply each by 6: gives [6 12 18 ... 1950]
s      e# Convert to string: gives "61218...1950"
2/     e# Split into chunks of size 2: gives ["61" "21" ... "95" "0"]
       e# Note how the last chunk has size 1; but it is not used
:~     e# Evaluate each string in that array: gives [61 21 ... 95 0]
ri     e# Read input as an integer
#      e# Index of fist occurrence, 0-based

```
> 1 votes

# Answer
# Japt, 12 bytes

0-indexed.

```
L²õ*6 ¬ò b¥U

```

Try it or test all inputs

```
L²õ*6 ¬ò b¥U     :Implicit input of integer U
L                :100
 ²               :Squared
  õ              :Range [1,L²]
   *6            :Multiply each by 6
      ¬          :Join to a string
       ò         :Split to array of strings each of length 2
         b       :First 0-based index of
          ¥U     :Test for equality with U (bU wouldn't work here as each string would first need to be cast to an integer, costing more bytes)

```
> 1 votes

# Answer
# Swift 5/Xcode 10.2.1, ~~140~~ ~~134~~ 133 bytes

```
let s=sequence(first:6){$0+6}.lazy.map{String($0)}.joined();return(0...).first{$0%2==0&&Int(String(s.dropFirst($0).prefix(2)))==n}!/2

```

Try it online!
> 1 votes

# Answer
# Red, ~~97~~ 94 bytes

```
func[n][(index? find/skip rejoin collect[repeat i 325[keep i * 6]]pad/left/with n 2 #"0"2)/ 2]

```

Try it online!
> 1 votes

# Answer
# Stax, 11 bytes

```
Æ▒§±~>ûπ╞öt

```

Run and debug it

Input is an integer. Output is 0-indexed.
> 1 votes

# Answer
# Perl 5 `-MList::Util=any -ap`, 50 bytes

```
$\=0,$b.=6*++$,while!any{++$\;"@F"==$_}$b=~/../g}{

```

Try it online!

1-based output
> 1 votes

# Answer
# Retina, ~~83~~ 77 bytes

I am really out of practice at complicated programming in Retina, but I'm satisfied with the length I managed to do it in.

Outputs the 0-indexed result.

```
.+
6*1
325+-1%`1+
$0¶6*1$0
1+
$.0
¶

L`..
m`^0

$
¶$+
s`\b(\d+)\b.*\b\1$

C`¶

```

**Try it Online**

---

### Explanation

```
.+                   Replace the input with 6 in unary
6*1
325+-1%`1+           Do 325 times: append line with previous + 6
$0¶6*1$0
1+                   Convert all lines to decimal
$.0
¶                    Remove line breaks

L`..                 List pairs of digits
m`^0                 Remove leading zeros

$                    Append the original input N on a new line
¶$+
s`\b(\d+)\b.*\b\1$   Remove occurrences of N and anything in between

C`¶                  Count the number of line breaks

```
> 1 votes

# Answer
# Retina 0.8.2, 36 bytes

```
^
2406$*_
_{6}
$.`
^0(..)+?.*\1$
$#1

```

Try it online! Link includes test suite. 1-indexed. Explanation:

```
^
2406$*_

```

Prefix 2406 `_`s to the input.

```
_{6}
$.`

```

Replace every 6 `_`s with the number of preceding `_`s. This generates the sequence `0`, `6`, `12` ... `2400`, but automatically concatenates the numbers.

```
^0(..)+?.*\1$

```

Skip the leading 0 and find the first pair of digits that match the last two digits i.e. the zero-padded input (because the string ends in `0`; in fact the test suite uses the fact that it ends in `00`).

```
$#1

```

Output the number of pairs of digits up to and including the match.

Retina 1 saves a couple of bytes because its string repetition operator is a byte shorter and already defaults to `_` as its right-hand operand, so that the second line of code becomes just `2406*`. Another feature of Retina 1 is the `>` modifier which generates the substitution in the context of the separator after the match, which in the case of `$.>`` causes it to include the length of the match in the result. Although this costs a byte we save it immediately as we don't need to match the `0` any more. (The repetitions also have to be reduced by 6.) Retina 1 can also do basic arithmetic in a substitution. This means that we don't have to resort to tricks to take multiples of 6, instead we just generate the numbers `1..400` and multiply by 6 in the substitution. Remarkably, this also doesn't affect the overall byte count, as the final result looks like this:

```
^
400*
_
$.(6*$>`
^(..)+?.*\1$
$#1

```
> 1 votes

# Answer
# Bash, 80 bytes

1-indexed.

```
dc<<<6[p6+lax]salax|sed 's/./\n&/g;s/\n//'|sed 'N;s/\n//'|sed -n "/^0*$1$/{=;q}"

```

Try it online!
> 1 votes

# Answer
# C# (Visual C# Interactive Compiler), 88 bytes

```
n=>{int i=2;for(var s="612";!s.StartsWith($"{n:d2}");s=s.Substring(2)+6*++i);return~-i;}

```

Try it online!

Another port of the Java and Python answers.

My original answer below:

# C# (Visual C# Interactive Compiler), 102 bytes

```
n=>{dynamic s="",t=$"{n:d2}",i=0;for(;i++<400;s+=i*6);for(i=0;s[i++]!=t[0]|s[i++]!=t[1];);return i/2;}

```

Try it online!

Both solutions use 1-based indexing.
> 1 votes

# Answer
# Ruby, 46 bytes

```
->n{[*6.step(5**5,6)].join.scan(/../).index n}

```

Try it online!
> 1 votes

# Answer
## Clojure, 102 bytes

```
#(count(for[i(partition 2(for[i(range 1 326)c(str(* i 6))]c)):while(not=(seq(str(if(< % 10)0)%))i)]i))

```

So long! :(
> 1 votes

# Answer
# Husk, 11 bytes

```
€mdC2ṁod*6N

```

Try it online! Uses 1-based indexing.
> 1 votes

# Answer
# Thunno 2, 9 bytes

```
k1R6×J²NȮ

```

Try it online!

0-indexed.

#### Explanation

```
k1R6×J²NȮ  # Implicit input
k1R        # Push the range [1..1000]
   6×      # Multiply each by 6
     J     # Join into a string
      ²    # Split it into pairs
       N   # Convert each to integer
        Ȯ  # First index of the input
           # Implicit output

```
> 1 votes

# Answer
# Vyxal, 70 bits<sup>v2</sup>, 8.75 bytes

```
₁²6v*ṅ2ẇĖḟ

```

Try it Online!

## Explained

```
₁²6v*ṅ2ẇĖḟ
₁²6v*       # 6 × n for n in range [1, 1000]
     ṅ2ẇ    # Join the list into a single string and then wrap into pairs.
        Ėḟ  # Evaluate each and find the index of the input

```

Created with the help of Luminespire.
> 1 votes

---
Tags: code-golf, sequence
---


title: Is this set laminar?

text:
# Question
Title: Is this set laminar?
A family of sets is called laminar if for any two sets \\$A\\$ and \\$B\\$ in the family one of the following is true:

* \\$ A \subseteq B \\$
* \\$ A \supseteq B \\$
* \\$ A \cap B = \emptyset \\$

Or less mathematical:

A laminar set is a list of lists that satisfies the following condition: If two elements of the top level list have at least one element in common, one of them has to be completely contained in the other one.

Examples:

```
laminar:
{}
{{1,2,3},{1,2},{1},{}}
{{1,2,3,4},{1,2,3},{1,2},{3},{4}}
{{1,2,3,4},{1,2},{3,4},{1},{3}}
{{1,2,3,4},{1,3},{2,4},{1},{2},{3},{4},{}}
{{1,2,3},{4,5},{7,8},{3},{5},{7}}

not laminar:

{{1,2},{2,3}}
{{1,2,3,4},{1,2,3},{1,2},{3,4}}
{{1,2,3,4},{1,2},{3,4},{2,3},{1},{2},{3},{4}}
{{1,2,3,4,5},{1,2,3},{4,5,6}}

```

Your goal is to write a program of function that takes a set of set as input and returns truthy if the set is laminar and falsey if is it not laminar.

Rules:

* You can take lists instead of sets as Input
* If you use lists as input you can assume that the lists (top-level and/or sub-lists) are sorted (in any convenient order) and each element appear only once
* Your solution should be able to handle Inputs lists with at least 250 distinct element values
* You are allowed to use any type to represent the elements of the list (as long as it has enough distinct values)
* This is the shortest solution (per language) wins.

# Answer
> 12 votes
# Python, 50 bytes

```
lambda c:all(a&b in(a,b,a-a)for a in c for b in c)

```

Attempt This Online!

# Answer
> 10 votes
# Rust, 63 bytes

Port of mousetail's python answer.

```
|s|s.iter().all(|a|s.iter().all(|b|a&b==*a||a&b==*b||a&b==a-a))

```

Rust explorer

# Answer
> 8 votes
# Nekomata \+ `-e`, 8 bytes

```
ᵒ{ᵋ∩?Ø?=

```

Attempt This Online!

```
ᵒ{ᵋ∩?Ø?=
ᵒ{          For each pair of elements A, B in the input, check that:
  ᵋ∩        Intersection of A and B
    ?Ø?     Any of A, B, or the empty set
       =    Are they equal?

```

# Answer
> 5 votes
# JavaScript (ES6), 69 bytes

Expects a list of lists. Returns *false* for laminar, or *true* for not laminar.

Not the right tool for the job.

```
a=>a.some(x=>a.some(y=>(b=x.filter(v=>y.includes(v))+'')&&b!=x&b!=y))

```

Try it online!

### 41 bytes (ES11)

As one would expect, converting each sub-list to a BigInt bit-mask and applying bitwise logic is longer.

```
a=>(a=a.map(b=>b.map(v=>m|=1n<<v,m=0n)&&m)).some(x=>a.some(y=>y^(y&=x)&&x^y&&y))

```

Try it online! (80 bytes)

But if we can take the list of sets directly as a list of bit-masks (as suggested by @Cubic), then we can just do:

```
a=>a.some(x=>a.some(y=>y^(y&=x)&&x^y&&y))

```

Try it online!

# Answer
> 4 votes
# 05AB1E, 11 bytes

```
ãε¯ªy`Ã.å}P

```

Try it online or verify all test cases.

**Explanation:**

```
ã        # Cartesian product to get all pairs of the (implicit) input-list
 ε       # Map over each pair of lists:
  ¯ª     #  Append an empty list to the pair
  y`     #  Push the lists of the pair separately to the stack
    Ã    #  Pop both, and push a list with values that occurred in both lists
     .å  #  Non-vectorized check if this list is in the earlier triplet of lists
 }P      # After the map: check if all are truthy
         # (after which the result is output implicitly)

```

# Answer
> 4 votes
# Raku, 47 bytes

```
{all cross @^a,@a,:with{$^x∩$^y≡∅|$x|$y}}

```

Try it online!

(The ageing version of Perl 6 on TIO does not understand the  operator, added in 2020. I replaced it there with  `eqv` for one additional byte.)

This anonymous function takes as input a list of sets in the variable `@^a`/`@a`. It computes the cross product of all of those sets with each other using the anonymous function in braces following `:with`. For each pair, that function returns a truthy value if the intersection () of the two sets is identical to () one of those sets or to the empty set (). The final result is a truthy value indicating whether `all` of those pairwise values are truthy.

# Answer
> 4 votes
# JavaScript (Node.js), 88 bytes

```
x=>x.some(a=>x.some(b=>g(a,b)&g(b,a)))
g=(a,b)=>/0,1|1,0/.test(a.map(i=>+b.includes(i)))

```

Try it online!

Return inversed

# Answer
> 3 votes
# Jelly, 8 bytes

```
iƇⱮFf\€Ƒ

```

Try it online!

Relies on the whole family being sorted *descending by length*, incidentally coinciding with how the testcases are displayed.

```
  ⱮF        For each element of any of the sets,
iƇ          filter the family to only sets containing it.
      €Ƒ    Is every one of those sub-families unchanged by
    f\      cumulative intersection?

```

# Jelly, ~~10~~ 9 bytes

```
fpḟpḟ@ðþF

```

Try it online!

*-1 remembering that I already made the link dyadic*

Outputs an empty list iff laminar. If output can't have reversed truthiness, slap a  on the end.

```
      ðþ     For every pair (dyadically) of sets:
 p           Take the Cartesian product of
f            the intersection and
  ḟ          the difference one way
   p         and
    ḟ@       the difference the other way.
        F    Flatten.

```

# Jelly, 10 bytes

```
Œcµḟṭif/)P

```

Try it online!

Direct approach everyone else is using.

```
Œcµ     )P    For every pair (as a list) of sets:
    ṭ         Append
   ḟ          the empty list;
     i        does that contain
      f/      the intersection?

```

# Answer
> 3 votes
# Factor \+ `math.unicode sets.extras`, 52 bytes

```
[ dup '[ _ [ diffs f like and and ] with ∃ ] ∃ ]

```

Attempt This Online!

Output is inverted: outputs `f` for laminar and `t` for not laminar.

* alias for `any?` that is 1 byte shorter
* `dup '[ _ [ ... ] with ∃ ] ∃` Is there any pair of sets in the input that is true when `[ ... ]` is applied to them?
* `diffs` A lovely word that takes two sets as inputs and returns three outputs: the set difference between input 1 and input 2, the set difference between input 2 and input 1, and the intersection between input 1 and input 2. This word converts empty sets to `f` except for the intersection.
* `f like` Convert the intersection to `f` if it is empty; leave alone otherwise.
* `and and` Take the logical and of the three results.

# Answer
> 3 votes
# Haskell, ~~68~~ 63 bytes

Unfortunately `\\` is not in `Prelude`, and I couldn't figure out how to write it shorter without the `Data.List` functions (without the import it's ~~51~~ bytes).

(Shaved off 5 bytes by switching to list comprehension from nested `all`)

```
import Data.List
l s=and[a\\b==[]||b\\a==[]||a\\b==a|a<-s,b<-s]

```

Try it online!

# Answer
> 3 votes
# Scala, 79 bytes

Port of @corvus\_192's Rust answer in Scala.

---

Golfed version. Try it online!

```
s=>{s.forall(a=>{s.forall(b=>{var z=a intersect b;z==a||z==b||z==a.diff(a)})})}

```

Ungollfed version. Try it online!

```
import scala.collection.immutable.HashSet

object Main extends App {

  def f(s: Seq[HashSet[Int]]): Boolean = {
    s.forall(a => {
      s.forall(b => {
        a.intersect(b) == a || a.intersect(b) == b || a.intersect(b) == a.diff(a)
      })
    })
  }

  assert(f(Seq.empty[HashSet[Int]]))
  assert(f(Seq(
    HashSet(1, 2, 3),
    HashSet(1, 2),
    HashSet(1),
    HashSet.empty[Int]
  )))
  assert(f(Seq(
    HashSet(1, 2, 3, 4),
    HashSet(1, 3),
    HashSet(2, 4),
    HashSet(1),
    HashSet(2),
    HashSet(3),
    HashSet(4),
    HashSet.empty[Int]
  )))

  assert(!f(Seq(HashSet(1, 2), HashSet(2, 3))))
}

```

# Answer
> 3 votes
# , 64 bytes

```
\(x,`?`=all)?Map(\(A)?Map(\(B)any(?(p=A%in%B),?B%in%A,?!p),x),x)

```

Attempt This Online!

# Answer
> 2 votes
# Charcoal, 15 bytes

```
⬤θ⬤θ№⟦ιλυ⟧⁻ι⁻ιλ

```

Try it online! Link is to verbose version of code. Outputs a Charcoal boolean, i.e. `-` for laminar, nothing if not. Explanation: Charcoal has no set intersection function, otherwise this would be a direct port of @mousetail's latest Python answer, but emulating list intersection using list difference does mean I get to use the predefined variable for an empty list.

```
 θ              Input list
⬤               All elements satisfy
   θ            Input list
  ⬤             All elements satisfy
      ι         Outer element
       λ        Inner element
        υ       Empty list
    №⟦   ⟧      Includes
           ι    Outer element
          ⁻     List difference
             ι  Outer element
            ⁻   List difference
              λ Inner element

```

# Answer
> 2 votes
# Pyth, 13 bytes

```
.Am}@Fd+d.{Y*

```

Attempt This Online!

### Explanation

```
.Am}@Fd+d.{Y*QQ    # implicitly add QQ
                   # implicitly assign Q = eval(input())
            *QQ    # cartesian product of Q and Q
  m                # map over lambda d
    @Fd            #   intersection of the elements of d
   }               #   is in
       +d.{Y       #   d plus the empty set
.A                 # return whether all elements are true

```

# Answer
> 2 votes
# Arturo, 56 bytes

```
$->x[some? x'a->some? x'b->¬∨∨a=a--b[]=a--b[]=b--a]

```

Try it!

Inverts the output; `false` for laminar and `true` for not laminar.

```
$->x[               ; a function taking a set of sets x
    some? x'a->     ; is there some set a in x that
        some? x'b-> ; is there some set b in x that
            []=b--a ; the empty set equals b diff a
            ∨       ; or
            []=a--b ; the empty set equals a diff b
            ∨       ; or
            a=a--b  ; a diff b is unchanged
            ¬       ; logical not (we have to do it this way to accommodate empty input)
]                   ; end function

```

# Answer
> 2 votes
# C (GCC), ~~199~~ 197 bytes

```
#define T int
#define A(p,z)*v){T b=0,i=0;for(;y;++i)b|=p;return b?z:!z;}
#define y v[i]
C(T x,T A(x==y,1)P(T z,T*s,T A(z-C(y,s),1)X(T*a,T*A(P(1,a,y)&P(1,y,a)&(P(0,a,y)|P(0,y,a)),0)f(T*A(!X(y,v),1)

```

Attempt This Online!

Takes input as a double pointer to int (`int **`) which is zero terminated on both levels (hence `0` cannot be used as an element).

Note that the solution is in C, while the full snippet is in C++ because I used vectors to store the data after parsing.

---

ungolfed solution (in C++)

# Answer
> 2 votes
# Julia 1.0, 43 bytes

```
~x=all(A⊆B||B⊆A||A∩B==[] for A=x,B=x)

```

Try it online!

-2 bytes thanks to MarcMush: square brackets aren't needed for an array comprehension that is passed to a function

# Answer
> 2 votes
# Ruby, ~~45~~ 43 bytes

```
->a{a.all?{|x|a.all?{|y|[[],x,y].any?x&y}}}

```

Try it online!

---
Tags: code-golf, math, decision-problem
---