Spelling Bee Acceptable











up vote
1
down vote

favorite












This is similar to this question.
However, I have a different goal in mind:
Reduce the wordlist to words that could appear.
The easy part is to delete hyphens and similar.



The hard part, however: Remove words containing more than seven letters.



So, the problem:

Given a set of words containing only lowercase (or uppercase) ASCII letters, remove the words containing eight or more different letters.



Any input and output format is acceptable.



Standard loophole rules apply.



Shortest byte count wins.



Clever solutions are better, and faster is better as well.



My solution (implementing a quite clever O(n) algorithm, noncompetitive ref implementation):



#include <stdio.h>                                                              
#include <stdint.h>

int main(void) {
char str[1024];
while(scanf("%sn", str) == 1) {
uint32_t st = 0;
int s = 0;
for(char *p = str; *p && s <= 7; p++) {
s += ~st >> (*p - 'a') & 1;
st |= 1 << (*p - 'a');
}
if(s <= 7)
printf("%sn", str);
}
}









share|improve this question




















  • 5




    Could you include a test case?
    – Dennis
    Nov 9 at 2:05






  • 12




    It's generally bad practice to have an upper limit on the score. The reason is that some languages are especially verbose or difficult to program in, and the 307 byte requirement would arbitrarily disallow them from competing.
    – Nathan Merrill
    Nov 9 at 2:05










  • Honestly, this is the easy part. Finding words that fit a partially revealed word is harder
    – Jo King
    Nov 9 at 11:19










  • I meant, this is the hard part of finding words that could ever be solutions.
    – NoLongerBreathedIn
    Nov 9 at 19:56










  • "quite clever O(n) algorithm": you'd have to be really clever to come up with an algorithm which does worse than a linear program. There's no need to compare different words, and you'd spend a constant time per word.
    – Abigail
    Nov 10 at 17:25















up vote
1
down vote

favorite












This is similar to this question.
However, I have a different goal in mind:
Reduce the wordlist to words that could appear.
The easy part is to delete hyphens and similar.



The hard part, however: Remove words containing more than seven letters.



So, the problem:

Given a set of words containing only lowercase (or uppercase) ASCII letters, remove the words containing eight or more different letters.



Any input and output format is acceptable.



Standard loophole rules apply.



Shortest byte count wins.



Clever solutions are better, and faster is better as well.



My solution (implementing a quite clever O(n) algorithm, noncompetitive ref implementation):



#include <stdio.h>                                                              
#include <stdint.h>

int main(void) {
char str[1024];
while(scanf("%sn", str) == 1) {
uint32_t st = 0;
int s = 0;
for(char *p = str; *p && s <= 7; p++) {
s += ~st >> (*p - 'a') & 1;
st |= 1 << (*p - 'a');
}
if(s <= 7)
printf("%sn", str);
}
}









share|improve this question




















  • 5




    Could you include a test case?
    – Dennis
    Nov 9 at 2:05






  • 12




    It's generally bad practice to have an upper limit on the score. The reason is that some languages are especially verbose or difficult to program in, and the 307 byte requirement would arbitrarily disallow them from competing.
    – Nathan Merrill
    Nov 9 at 2:05










  • Honestly, this is the easy part. Finding words that fit a partially revealed word is harder
    – Jo King
    Nov 9 at 11:19










  • I meant, this is the hard part of finding words that could ever be solutions.
    – NoLongerBreathedIn
    Nov 9 at 19:56










  • "quite clever O(n) algorithm": you'd have to be really clever to come up with an algorithm which does worse than a linear program. There's no need to compare different words, and you'd spend a constant time per word.
    – Abigail
    Nov 10 at 17:25













up vote
1
down vote

favorite









up vote
1
down vote

favorite











This is similar to this question.
However, I have a different goal in mind:
Reduce the wordlist to words that could appear.
The easy part is to delete hyphens and similar.



The hard part, however: Remove words containing more than seven letters.



So, the problem:

Given a set of words containing only lowercase (or uppercase) ASCII letters, remove the words containing eight or more different letters.



Any input and output format is acceptable.



Standard loophole rules apply.



Shortest byte count wins.



Clever solutions are better, and faster is better as well.



My solution (implementing a quite clever O(n) algorithm, noncompetitive ref implementation):



#include <stdio.h>                                                              
#include <stdint.h>

int main(void) {
char str[1024];
while(scanf("%sn", str) == 1) {
uint32_t st = 0;
int s = 0;
for(char *p = str; *p && s <= 7; p++) {
s += ~st >> (*p - 'a') & 1;
st |= 1 << (*p - 'a');
}
if(s <= 7)
printf("%sn", str);
}
}









share|improve this question















This is similar to this question.
However, I have a different goal in mind:
Reduce the wordlist to words that could appear.
The easy part is to delete hyphens and similar.



The hard part, however: Remove words containing more than seven letters.



So, the problem:

Given a set of words containing only lowercase (or uppercase) ASCII letters, remove the words containing eight or more different letters.



Any input and output format is acceptable.



Standard loophole rules apply.



Shortest byte count wins.



Clever solutions are better, and faster is better as well.



My solution (implementing a quite clever O(n) algorithm, noncompetitive ref implementation):



#include <stdio.h>                                                              
#include <stdint.h>

int main(void) {
char str[1024];
while(scanf("%sn", str) == 1) {
uint32_t st = 0;
int s = 0;
for(char *p = str; *p && s <= 7; p++) {
s += ~st >> (*p - 'a') & 1;
st |= 1 << (*p - 'a');
}
if(s <= 7)
printf("%sn", str);
}
}






code-golf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 19:52

























asked Nov 9 at 1:57









NoLongerBreathedIn

643




643








  • 5




    Could you include a test case?
    – Dennis
    Nov 9 at 2:05






  • 12




    It's generally bad practice to have an upper limit on the score. The reason is that some languages are especially verbose or difficult to program in, and the 307 byte requirement would arbitrarily disallow them from competing.
    – Nathan Merrill
    Nov 9 at 2:05










  • Honestly, this is the easy part. Finding words that fit a partially revealed word is harder
    – Jo King
    Nov 9 at 11:19










  • I meant, this is the hard part of finding words that could ever be solutions.
    – NoLongerBreathedIn
    Nov 9 at 19:56










  • "quite clever O(n) algorithm": you'd have to be really clever to come up with an algorithm which does worse than a linear program. There's no need to compare different words, and you'd spend a constant time per word.
    – Abigail
    Nov 10 at 17:25














  • 5




    Could you include a test case?
    – Dennis
    Nov 9 at 2:05






  • 12




    It's generally bad practice to have an upper limit on the score. The reason is that some languages are especially verbose or difficult to program in, and the 307 byte requirement would arbitrarily disallow them from competing.
    – Nathan Merrill
    Nov 9 at 2:05










  • Honestly, this is the easy part. Finding words that fit a partially revealed word is harder
    – Jo King
    Nov 9 at 11:19










  • I meant, this is the hard part of finding words that could ever be solutions.
    – NoLongerBreathedIn
    Nov 9 at 19:56










  • "quite clever O(n) algorithm": you'd have to be really clever to come up with an algorithm which does worse than a linear program. There's no need to compare different words, and you'd spend a constant time per word.
    – Abigail
    Nov 10 at 17:25








5




5




Could you include a test case?
– Dennis
Nov 9 at 2:05




Could you include a test case?
– Dennis
Nov 9 at 2:05




12




12




It's generally bad practice to have an upper limit on the score. The reason is that some languages are especially verbose or difficult to program in, and the 307 byte requirement would arbitrarily disallow them from competing.
– Nathan Merrill
Nov 9 at 2:05




It's generally bad practice to have an upper limit on the score. The reason is that some languages are especially verbose or difficult to program in, and the 307 byte requirement would arbitrarily disallow them from competing.
– Nathan Merrill
Nov 9 at 2:05












Honestly, this is the easy part. Finding words that fit a partially revealed word is harder
– Jo King
Nov 9 at 11:19




Honestly, this is the easy part. Finding words that fit a partially revealed word is harder
– Jo King
Nov 9 at 11:19












I meant, this is the hard part of finding words that could ever be solutions.
– NoLongerBreathedIn
Nov 9 at 19:56




I meant, this is the hard part of finding words that could ever be solutions.
– NoLongerBreathedIn
Nov 9 at 19:56












"quite clever O(n) algorithm": you'd have to be really clever to come up with an algorithm which does worse than a linear program. There's no need to compare different words, and you'd spend a constant time per word.
– Abigail
Nov 10 at 17:25




"quite clever O(n) algorithm": you'd have to be really clever to come up with an algorithm which does worse than a linear program. There's no need to compare different words, and you'd spend a constant time per word.
– Abigail
Nov 10 at 17:25










19 Answers
19






active

oldest

votes

















up vote
4
down vote














APL (Dyalog Unicode), 11 bytes





{⍵/⍨8>≢∪⍵}¨


Takes input as a list of strings.



Explanation:



{⍵/⍨8>≢∪⍵}¨
{ ⍵}¨ for each word
∪ take unique letters
8>≢ length less than 8 as a boolean (0 or 1)
⍵/⍨ repeat word that many times


Try it online!






share|improve this answer























  • the result contains empty strings. you can fix that preserving the byte count: ⊢(/⍨)8>≢∘∪¨
    – ngn
    Nov 11 at 7:44


















up vote
3
down vote














Perl 6, 20 bytes





*.grep(8>*.comb.Set)


Try it online!



Filters by words that have a set of letters with size less than 8.






share|improve this answer




























    up vote
    3
    down vote














    05AB1E, 5 bytes



    ʒÙg8‹


    Try it online.



    Explanation:





    ʒ        # Filter the (implicit) input-list by:
    Ù # Only leave distinct letters of the word
    g # Take its length
    8‹ # And only leave those with a length smaller than 8
    # (And output implicitly after we're done filtering)





    share|improve this answer




























      up vote
      2
      down vote














      Jelly, 6 bytes



      Qṫ¥Ðḟ8


      Try it online!



      How it works



      Qṫ¥Ðḟ8  Main link. Argument: A (array or words)

      Ðḟ Filterfalse; only keep the words W of A for which the chain to the left
      returns a falsy value.
      ¥ Combine the two links to the left into a dyadic chain.
      Q Unique; remove duplicate letters from W.
      ṫ 8 Tail 8; remove the first 7 letters of the result.





      share|improve this answer




























        up vote
        2
        down vote














        MathGolf, 6 bytes



        Ç{▀£7>


        Try it online!



        Explanation



        Really similar to the 05AB1E solution, but I lose one byte thanks to explicitly having to define the code block for filtering.



        Ç       Implicit faulty filter by block
        { Start block
        ▀ Get unique characters of string
        £ Get length
        7> Is greater than 7





        share|improve this answer




























          up vote
          2
          down vote













          JavaScript, 33 bytes



          a=>a.filter(s=>new Set(s).size<8)


          Try it online, using Dennis' test cases






          share|improve this answer




























            up vote
            2
            down vote













            J, 10 bytes



            #~8>#@~.@>


            explanation



            #~ 8 > #@~.@>
            #~ NB. filter the input based on...
            8 > NB. is 8 greater than...
            #@ NB. the length of...
            ~.@ NB. the unique characters of...
            > NB. the unboxed input.


            Try it online!






            share|improve this answer



















            • 1




              Shouldn't 9 be 8?
              – Galen Ivanov
              Nov 9 at 8:03






            • 1




              Fixed. Weird, I could have sworn the OP said 8 was the max length allowed before. Anyway, ty...
              – Jonah
              Nov 9 at 14:19


















            up vote
            2
            down vote













            Java 8, 46 bytes





            s->s.filter(w->w.chars().distinct().count()<8)


            Try it online.



            Explanation:



            s->               // Method with String-Stream as both parameter and return-type
            s.filter(w-> // Filter the words in the input-Stream by:
            w.chars() // Convert the String to characters
            .distinct() // Only leave distinct characters
            .count()<8) // Only leave words with less than 8 distinct characters





            share|improve this answer























            • Wow, w.chars.distinct.count. Turn each of those words into a symbol and you have a golfing language! xD
              – Quintec
              Nov 9 at 12:56










            • @Quintec Hehe, it's what I do in my 05AB1E answer. :) s->s is implicit input in 05AB1E; filter(w-> is ʒ; .chars() is implicitly again; .distinct() is Ù; .count() (or length) is g; <8 is 8‹; and the closing ) is implicitly since it's at the end of the 05AB1E program (if I wanted to do something after the filter I'd have to close it with }); and finally outputting is implicitly again. So my Java and 05AB1E are similar, one is a 46 bytes function and the other a 5 bytes full program, though. xD
              – Kevin Cruijssen
              Nov 9 at 13:06












            • Hehe, also basically same for my APL answer. It meets in the middle: 11 bytes :P
              – Quintec
              Nov 9 at 15:24


















            up vote
            1
            down vote














            Python 2, 40 bytes





            lambda i:[x for x in i if len(set(x))<8]


            Try it online!



            Test cases borrowed from @Dennis. Input and output are both lists.






            share|improve this answer




























              up vote
              1
              down vote














              Red, 54 bytes



              func[b][foreach a b[if 8 > length? unique a[print a]]]


              Try it online!



              The first test set was taken from Dennis'






              share|improve this answer




























                up vote
                1
                down vote














                C# (.NET Core), 58 bytes



                 a=>a.Where(x=>x.GroupBy(y=>y).Count()<8)


                Try It Online!






                share|improve this answer




























                  up vote
                  1
                  down vote














                  C (gcc), 104 95 bytes



                  Dennis's word set was also used here.



                  Thanks to nwellnhof for the suggestions.





                  char*s,*t;f(i,j,k){for(;~scanf("%ms",&s);i<8&&puts(s))for(i=j=0,t=s;*t;j=k)k=j|1<<*t++,i+=j<k;}


                  Try it online!






                  share|improve this answer























                  • 96 bytes, if you're OK with implementation- and undefined behavior.
                    – nwellnhof
                    Nov 9 at 10:15










                  • @nwellnhof What's a little UD between friends for code golf? :-)
                    – ErikF
                    Nov 9 at 17:16


















                  up vote
                  1
                  down vote













                  perl -nlE, 32 bytes



                  my%h;@h{/./g}=();say if keys%h<8


                  This reads words from STDIN, printing out those with less than 7 different characters.






                  share|improve this answer

















                  • 1




                    25 bytes: my%h;@h{/./g}=1;%h<8&&say (%h<8 requires Perl 5.26)
                    – nwellnhof
                    Nov 12 at 12:25


















                  up vote
                  0
                  down vote














                  Racket, 95 bytes



                  (require racket/set)(define(f l)(filter(lambda(x)(<(set-count(list->set(string->list x)))8))l))


                  Try it online!



                  The test set was taken from Dennis'






                  share|improve this answer




























                    up vote
                    0
                    down vote














                    Charcoal, 12 bytes



                    ΦA›⁸LΦι⁼μ⌕ιλ


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



                     A              Input array
                    Φ Filter strings where
                    ⁸ Literal 8
                    › Is greater than
                    L Length of
                    ι Current string
                    Φ Filtered on characters where
                    μ Inner index
                    ⁼ Equals
                    λ Current character's
                    ⌕ First index in
                    ι Current string
                    Implicitly print matching strings





                    share|improve this answer





















                    • 10?
                      – ASCII-only
                      Nov 18 at 5:12


















                    up vote
                    0
                    down vote













                    Japt -f, 6 bytes



                    ¬â Ê<8


                    Try it, using Dennis' test cases






                    share|improve this answer




























                      up vote
                      0
                      down vote













                      JavaScript (ES6), 53 bytes



                      Without using a set:





                      a=>a.filter(w=>[...w].every(o=c=>o[c]=o[c]||--k,k=8))


                      Try it online! (using Dennis' test set)






                      share|improve this answer






























                        up vote
                        0
                        down vote













                        Snap! 4, scratchblocks2 syntax



                        (pretending that Snap! exclusive blocks are valid in scratchblocks2 but functions use the Scratch define)



                        69 bytes



                        b takes a list of strings.



                        define((b)
                        report((#)keep items such that(<(length of )<[7]>)from(b





                        share|improve this answer




























                          up vote
                          0
                          down vote














                          C++ (gcc), 105 104 bytes





                          #import<bits/stdc++.h>
                          f(){for(char*n;~scanf("%ms",&n);)std::set<int>(n,n+strlen(n)).size()<8&&puts(n);}


                          Try it online!



                          -1 byte thanks to @ceilingcat






                          share|improve this answer























                            Your Answer





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

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

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

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

                            function createEditor() {
                            StackExchange.prepareEditor({
                            heartbeatType: 'answer',
                            convertImagesToLinks: false,
                            noModals: true,
                            showLowRepImageUploadWarning: true,
                            reputationToPostImages: null,
                            bindNavPrevention: true,
                            postfix: "",
                            imageUploader: {
                            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                            allowUrls: true
                            },
                            onDemand: true,
                            discardSelector: ".discard-answer"
                            ,immediatelyShowMarkdownHelp:true
                            });


                            }
                            });














                             

                            draft saved


                            draft discarded


















                            StackExchange.ready(
                            function () {
                            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f175559%2fspelling-bee-acceptable%23new-answer', 'question_page');
                            }
                            );

                            Post as a guest















                            Required, but never shown

























                            19 Answers
                            19






                            active

                            oldest

                            votes








                            19 Answers
                            19






                            active

                            oldest

                            votes









                            active

                            oldest

                            votes






                            active

                            oldest

                            votes








                            up vote
                            4
                            down vote














                            APL (Dyalog Unicode), 11 bytes





                            {⍵/⍨8>≢∪⍵}¨


                            Takes input as a list of strings.



                            Explanation:



                            {⍵/⍨8>≢∪⍵}¨
                            { ⍵}¨ for each word
                            ∪ take unique letters
                            8>≢ length less than 8 as a boolean (0 or 1)
                            ⍵/⍨ repeat word that many times


                            Try it online!






                            share|improve this answer























                            • the result contains empty strings. you can fix that preserving the byte count: ⊢(/⍨)8>≢∘∪¨
                              – ngn
                              Nov 11 at 7:44















                            up vote
                            4
                            down vote














                            APL (Dyalog Unicode), 11 bytes





                            {⍵/⍨8>≢∪⍵}¨


                            Takes input as a list of strings.



                            Explanation:



                            {⍵/⍨8>≢∪⍵}¨
                            { ⍵}¨ for each word
                            ∪ take unique letters
                            8>≢ length less than 8 as a boolean (0 or 1)
                            ⍵/⍨ repeat word that many times


                            Try it online!






                            share|improve this answer























                            • the result contains empty strings. you can fix that preserving the byte count: ⊢(/⍨)8>≢∘∪¨
                              – ngn
                              Nov 11 at 7:44













                            up vote
                            4
                            down vote










                            up vote
                            4
                            down vote










                            APL (Dyalog Unicode), 11 bytes





                            {⍵/⍨8>≢∪⍵}¨


                            Takes input as a list of strings.



                            Explanation:



                            {⍵/⍨8>≢∪⍵}¨
                            { ⍵}¨ for each word
                            ∪ take unique letters
                            8>≢ length less than 8 as a boolean (0 or 1)
                            ⍵/⍨ repeat word that many times


                            Try it online!






                            share|improve this answer















                            APL (Dyalog Unicode), 11 bytes





                            {⍵/⍨8>≢∪⍵}¨


                            Takes input as a list of strings.



                            Explanation:



                            {⍵/⍨8>≢∪⍵}¨
                            { ⍵}¨ for each word
                            ∪ take unique letters
                            8>≢ length less than 8 as a boolean (0 or 1)
                            ⍵/⍨ repeat word that many times


                            Try it online!







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Nov 9 at 23:28

























                            answered Nov 9 at 2:27









                            Quintec

                            1,195518




                            1,195518












                            • the result contains empty strings. you can fix that preserving the byte count: ⊢(/⍨)8>≢∘∪¨
                              – ngn
                              Nov 11 at 7:44


















                            • the result contains empty strings. you can fix that preserving the byte count: ⊢(/⍨)8>≢∘∪¨
                              – ngn
                              Nov 11 at 7:44
















                            the result contains empty strings. you can fix that preserving the byte count: ⊢(/⍨)8>≢∘∪¨
                            – ngn
                            Nov 11 at 7:44




                            the result contains empty strings. you can fix that preserving the byte count: ⊢(/⍨)8>≢∘∪¨
                            – ngn
                            Nov 11 at 7:44










                            up vote
                            3
                            down vote














                            Perl 6, 20 bytes





                            *.grep(8>*.comb.Set)


                            Try it online!



                            Filters by words that have a set of letters with size less than 8.






                            share|improve this answer

























                              up vote
                              3
                              down vote














                              Perl 6, 20 bytes





                              *.grep(8>*.comb.Set)


                              Try it online!



                              Filters by words that have a set of letters with size less than 8.






                              share|improve this answer























                                up vote
                                3
                                down vote










                                up vote
                                3
                                down vote










                                Perl 6, 20 bytes





                                *.grep(8>*.comb.Set)


                                Try it online!



                                Filters by words that have a set of letters with size less than 8.






                                share|improve this answer













                                Perl 6, 20 bytes





                                *.grep(8>*.comb.Set)


                                Try it online!



                                Filters by words that have a set of letters with size less than 8.







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Nov 9 at 2:06









                                Jo King

                                19.3k245102




                                19.3k245102






















                                    up vote
                                    3
                                    down vote














                                    05AB1E, 5 bytes



                                    ʒÙg8‹


                                    Try it online.



                                    Explanation:





                                    ʒ        # Filter the (implicit) input-list by:
                                    Ù # Only leave distinct letters of the word
                                    g # Take its length
                                    8‹ # And only leave those with a length smaller than 8
                                    # (And output implicitly after we're done filtering)





                                    share|improve this answer

























                                      up vote
                                      3
                                      down vote














                                      05AB1E, 5 bytes



                                      ʒÙg8‹


                                      Try it online.



                                      Explanation:





                                      ʒ        # Filter the (implicit) input-list by:
                                      Ù # Only leave distinct letters of the word
                                      g # Take its length
                                      8‹ # And only leave those with a length smaller than 8
                                      # (And output implicitly after we're done filtering)





                                      share|improve this answer























                                        up vote
                                        3
                                        down vote










                                        up vote
                                        3
                                        down vote










                                        05AB1E, 5 bytes



                                        ʒÙg8‹


                                        Try it online.



                                        Explanation:





                                        ʒ        # Filter the (implicit) input-list by:
                                        Ù # Only leave distinct letters of the word
                                        g # Take its length
                                        8‹ # And only leave those with a length smaller than 8
                                        # (And output implicitly after we're done filtering)





                                        share|improve this answer













                                        05AB1E, 5 bytes



                                        ʒÙg8‹


                                        Try it online.



                                        Explanation:





                                        ʒ        # Filter the (implicit) input-list by:
                                        Ù # Only leave distinct letters of the word
                                        g # Take its length
                                        8‹ # And only leave those with a length smaller than 8
                                        # (And output implicitly after we're done filtering)






                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Nov 9 at 7:59









                                        Kevin Cruijssen

                                        34.4k554182




                                        34.4k554182






















                                            up vote
                                            2
                                            down vote














                                            Jelly, 6 bytes



                                            Qṫ¥Ðḟ8


                                            Try it online!



                                            How it works



                                            Qṫ¥Ðḟ8  Main link. Argument: A (array or words)

                                            Ðḟ Filterfalse; only keep the words W of A for which the chain to the left
                                            returns a falsy value.
                                            ¥ Combine the two links to the left into a dyadic chain.
                                            Q Unique; remove duplicate letters from W.
                                            ṫ 8 Tail 8; remove the first 7 letters of the result.





                                            share|improve this answer

























                                              up vote
                                              2
                                              down vote














                                              Jelly, 6 bytes



                                              Qṫ¥Ðḟ8


                                              Try it online!



                                              How it works



                                              Qṫ¥Ðḟ8  Main link. Argument: A (array or words)

                                              Ðḟ Filterfalse; only keep the words W of A for which the chain to the left
                                              returns a falsy value.
                                              ¥ Combine the two links to the left into a dyadic chain.
                                              Q Unique; remove duplicate letters from W.
                                              ṫ 8 Tail 8; remove the first 7 letters of the result.





                                              share|improve this answer























                                                up vote
                                                2
                                                down vote










                                                up vote
                                                2
                                                down vote










                                                Jelly, 6 bytes



                                                Qṫ¥Ðḟ8


                                                Try it online!



                                                How it works



                                                Qṫ¥Ðḟ8  Main link. Argument: A (array or words)

                                                Ðḟ Filterfalse; only keep the words W of A for which the chain to the left
                                                returns a falsy value.
                                                ¥ Combine the two links to the left into a dyadic chain.
                                                Q Unique; remove duplicate letters from W.
                                                ṫ 8 Tail 8; remove the first 7 letters of the result.





                                                share|improve this answer













                                                Jelly, 6 bytes



                                                Qṫ¥Ðḟ8


                                                Try it online!



                                                How it works



                                                Qṫ¥Ðḟ8  Main link. Argument: A (array or words)

                                                Ðḟ Filterfalse; only keep the words W of A for which the chain to the left
                                                returns a falsy value.
                                                ¥ Combine the two links to the left into a dyadic chain.
                                                Q Unique; remove duplicate letters from W.
                                                ṫ 8 Tail 8; remove the first 7 letters of the result.






                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered Nov 9 at 2:13









                                                Dennis

                                                184k32295731




                                                184k32295731






















                                                    up vote
                                                    2
                                                    down vote














                                                    MathGolf, 6 bytes



                                                    Ç{▀£7>


                                                    Try it online!



                                                    Explanation



                                                    Really similar to the 05AB1E solution, but I lose one byte thanks to explicitly having to define the code block for filtering.



                                                    Ç       Implicit faulty filter by block
                                                    { Start block
                                                    ▀ Get unique characters of string
                                                    £ Get length
                                                    7> Is greater than 7





                                                    share|improve this answer

























                                                      up vote
                                                      2
                                                      down vote














                                                      MathGolf, 6 bytes



                                                      Ç{▀£7>


                                                      Try it online!



                                                      Explanation



                                                      Really similar to the 05AB1E solution, but I lose one byte thanks to explicitly having to define the code block for filtering.



                                                      Ç       Implicit faulty filter by block
                                                      { Start block
                                                      ▀ Get unique characters of string
                                                      £ Get length
                                                      7> Is greater than 7





                                                      share|improve this answer























                                                        up vote
                                                        2
                                                        down vote










                                                        up vote
                                                        2
                                                        down vote










                                                        MathGolf, 6 bytes



                                                        Ç{▀£7>


                                                        Try it online!



                                                        Explanation



                                                        Really similar to the 05AB1E solution, but I lose one byte thanks to explicitly having to define the code block for filtering.



                                                        Ç       Implicit faulty filter by block
                                                        { Start block
                                                        ▀ Get unique characters of string
                                                        £ Get length
                                                        7> Is greater than 7





                                                        share|improve this answer













                                                        MathGolf, 6 bytes



                                                        Ç{▀£7>


                                                        Try it online!



                                                        Explanation



                                                        Really similar to the 05AB1E solution, but I lose one byte thanks to explicitly having to define the code block for filtering.



                                                        Ç       Implicit faulty filter by block
                                                        { Start block
                                                        ▀ Get unique characters of string
                                                        £ Get length
                                                        7> Is greater than 7






                                                        share|improve this answer












                                                        share|improve this answer



                                                        share|improve this answer










                                                        answered Nov 9 at 10:51









                                                        maxb

                                                        2,1081923




                                                        2,1081923






















                                                            up vote
                                                            2
                                                            down vote













                                                            JavaScript, 33 bytes



                                                            a=>a.filter(s=>new Set(s).size<8)


                                                            Try it online, using Dennis' test cases






                                                            share|improve this answer

























                                                              up vote
                                                              2
                                                              down vote













                                                              JavaScript, 33 bytes



                                                              a=>a.filter(s=>new Set(s).size<8)


                                                              Try it online, using Dennis' test cases






                                                              share|improve this answer























                                                                up vote
                                                                2
                                                                down vote










                                                                up vote
                                                                2
                                                                down vote









                                                                JavaScript, 33 bytes



                                                                a=>a.filter(s=>new Set(s).size<8)


                                                                Try it online, using Dennis' test cases






                                                                share|improve this answer












                                                                JavaScript, 33 bytes



                                                                a=>a.filter(s=>new Set(s).size<8)


                                                                Try it online, using Dennis' test cases







                                                                share|improve this answer












                                                                share|improve this answer



                                                                share|improve this answer










                                                                answered Nov 9 at 10:54









                                                                Shaggy

                                                                18.2k21663




                                                                18.2k21663






















                                                                    up vote
                                                                    2
                                                                    down vote













                                                                    J, 10 bytes



                                                                    #~8>#@~.@>


                                                                    explanation



                                                                    #~ 8 > #@~.@>
                                                                    #~ NB. filter the input based on...
                                                                    8 > NB. is 8 greater than...
                                                                    #@ NB. the length of...
                                                                    ~.@ NB. the unique characters of...
                                                                    > NB. the unboxed input.


                                                                    Try it online!






                                                                    share|improve this answer



















                                                                    • 1




                                                                      Shouldn't 9 be 8?
                                                                      – Galen Ivanov
                                                                      Nov 9 at 8:03






                                                                    • 1




                                                                      Fixed. Weird, I could have sworn the OP said 8 was the max length allowed before. Anyway, ty...
                                                                      – Jonah
                                                                      Nov 9 at 14:19















                                                                    up vote
                                                                    2
                                                                    down vote













                                                                    J, 10 bytes



                                                                    #~8>#@~.@>


                                                                    explanation



                                                                    #~ 8 > #@~.@>
                                                                    #~ NB. filter the input based on...
                                                                    8 > NB. is 8 greater than...
                                                                    #@ NB. the length of...
                                                                    ~.@ NB. the unique characters of...
                                                                    > NB. the unboxed input.


                                                                    Try it online!






                                                                    share|improve this answer



















                                                                    • 1




                                                                      Shouldn't 9 be 8?
                                                                      – Galen Ivanov
                                                                      Nov 9 at 8:03






                                                                    • 1




                                                                      Fixed. Weird, I could have sworn the OP said 8 was the max length allowed before. Anyway, ty...
                                                                      – Jonah
                                                                      Nov 9 at 14:19













                                                                    up vote
                                                                    2
                                                                    down vote










                                                                    up vote
                                                                    2
                                                                    down vote









                                                                    J, 10 bytes



                                                                    #~8>#@~.@>


                                                                    explanation



                                                                    #~ 8 > #@~.@>
                                                                    #~ NB. filter the input based on...
                                                                    8 > NB. is 8 greater than...
                                                                    #@ NB. the length of...
                                                                    ~.@ NB. the unique characters of...
                                                                    > NB. the unboxed input.


                                                                    Try it online!






                                                                    share|improve this answer














                                                                    J, 10 bytes



                                                                    #~8>#@~.@>


                                                                    explanation



                                                                    #~ 8 > #@~.@>
                                                                    #~ NB. filter the input based on...
                                                                    8 > NB. is 8 greater than...
                                                                    #@ NB. the length of...
                                                                    ~.@ NB. the unique characters of...
                                                                    > NB. the unboxed input.


                                                                    Try it online!







                                                                    share|improve this answer














                                                                    share|improve this answer



                                                                    share|improve this answer








                                                                    edited Nov 9 at 14:18

























                                                                    answered Nov 9 at 3:48









                                                                    Jonah

                                                                    1,981816




                                                                    1,981816








                                                                    • 1




                                                                      Shouldn't 9 be 8?
                                                                      – Galen Ivanov
                                                                      Nov 9 at 8:03






                                                                    • 1




                                                                      Fixed. Weird, I could have sworn the OP said 8 was the max length allowed before. Anyway, ty...
                                                                      – Jonah
                                                                      Nov 9 at 14:19














                                                                    • 1




                                                                      Shouldn't 9 be 8?
                                                                      – Galen Ivanov
                                                                      Nov 9 at 8:03






                                                                    • 1




                                                                      Fixed. Weird, I could have sworn the OP said 8 was the max length allowed before. Anyway, ty...
                                                                      – Jonah
                                                                      Nov 9 at 14:19








                                                                    1




                                                                    1




                                                                    Shouldn't 9 be 8?
                                                                    – Galen Ivanov
                                                                    Nov 9 at 8:03




                                                                    Shouldn't 9 be 8?
                                                                    – Galen Ivanov
                                                                    Nov 9 at 8:03




                                                                    1




                                                                    1




                                                                    Fixed. Weird, I could have sworn the OP said 8 was the max length allowed before. Anyway, ty...
                                                                    – Jonah
                                                                    Nov 9 at 14:19




                                                                    Fixed. Weird, I could have sworn the OP said 8 was the max length allowed before. Anyway, ty...
                                                                    – Jonah
                                                                    Nov 9 at 14:19










                                                                    up vote
                                                                    2
                                                                    down vote













                                                                    Java 8, 46 bytes





                                                                    s->s.filter(w->w.chars().distinct().count()<8)


                                                                    Try it online.



                                                                    Explanation:



                                                                    s->               // Method with String-Stream as both parameter and return-type
                                                                    s.filter(w-> // Filter the words in the input-Stream by:
                                                                    w.chars() // Convert the String to characters
                                                                    .distinct() // Only leave distinct characters
                                                                    .count()<8) // Only leave words with less than 8 distinct characters





                                                                    share|improve this answer























                                                                    • Wow, w.chars.distinct.count. Turn each of those words into a symbol and you have a golfing language! xD
                                                                      – Quintec
                                                                      Nov 9 at 12:56










                                                                    • @Quintec Hehe, it's what I do in my 05AB1E answer. :) s->s is implicit input in 05AB1E; filter(w-> is ʒ; .chars() is implicitly again; .distinct() is Ù; .count() (or length) is g; <8 is 8‹; and the closing ) is implicitly since it's at the end of the 05AB1E program (if I wanted to do something after the filter I'd have to close it with }); and finally outputting is implicitly again. So my Java and 05AB1E are similar, one is a 46 bytes function and the other a 5 bytes full program, though. xD
                                                                      – Kevin Cruijssen
                                                                      Nov 9 at 13:06












                                                                    • Hehe, also basically same for my APL answer. It meets in the middle: 11 bytes :P
                                                                      – Quintec
                                                                      Nov 9 at 15:24















                                                                    up vote
                                                                    2
                                                                    down vote













                                                                    Java 8, 46 bytes





                                                                    s->s.filter(w->w.chars().distinct().count()<8)


                                                                    Try it online.



                                                                    Explanation:



                                                                    s->               // Method with String-Stream as both parameter and return-type
                                                                    s.filter(w-> // Filter the words in the input-Stream by:
                                                                    w.chars() // Convert the String to characters
                                                                    .distinct() // Only leave distinct characters
                                                                    .count()<8) // Only leave words with less than 8 distinct characters





                                                                    share|improve this answer























                                                                    • Wow, w.chars.distinct.count. Turn each of those words into a symbol and you have a golfing language! xD
                                                                      – Quintec
                                                                      Nov 9 at 12:56










                                                                    • @Quintec Hehe, it's what I do in my 05AB1E answer. :) s->s is implicit input in 05AB1E; filter(w-> is ʒ; .chars() is implicitly again; .distinct() is Ù; .count() (or length) is g; <8 is 8‹; and the closing ) is implicitly since it's at the end of the 05AB1E program (if I wanted to do something after the filter I'd have to close it with }); and finally outputting is implicitly again. So my Java and 05AB1E are similar, one is a 46 bytes function and the other a 5 bytes full program, though. xD
                                                                      – Kevin Cruijssen
                                                                      Nov 9 at 13:06












                                                                    • Hehe, also basically same for my APL answer. It meets in the middle: 11 bytes :P
                                                                      – Quintec
                                                                      Nov 9 at 15:24













                                                                    up vote
                                                                    2
                                                                    down vote










                                                                    up vote
                                                                    2
                                                                    down vote









                                                                    Java 8, 46 bytes





                                                                    s->s.filter(w->w.chars().distinct().count()<8)


                                                                    Try it online.



                                                                    Explanation:



                                                                    s->               // Method with String-Stream as both parameter and return-type
                                                                    s.filter(w-> // Filter the words in the input-Stream by:
                                                                    w.chars() // Convert the String to characters
                                                                    .distinct() // Only leave distinct characters
                                                                    .count()<8) // Only leave words with less than 8 distinct characters





                                                                    share|improve this answer














                                                                    Java 8, 46 bytes





                                                                    s->s.filter(w->w.chars().distinct().count()<8)


                                                                    Try it online.



                                                                    Explanation:



                                                                    s->               // Method with String-Stream as both parameter and return-type
                                                                    s.filter(w-> // Filter the words in the input-Stream by:
                                                                    w.chars() // Convert the String to characters
                                                                    .distinct() // Only leave distinct characters
                                                                    .count()<8) // Only leave words with less than 8 distinct characters






                                                                    share|improve this answer














                                                                    share|improve this answer



                                                                    share|improve this answer








                                                                    edited Nov 10 at 10:16

























                                                                    answered Nov 9 at 9:42









                                                                    Kevin Cruijssen

                                                                    34.4k554182




                                                                    34.4k554182












                                                                    • Wow, w.chars.distinct.count. Turn each of those words into a symbol and you have a golfing language! xD
                                                                      – Quintec
                                                                      Nov 9 at 12:56










                                                                    • @Quintec Hehe, it's what I do in my 05AB1E answer. :) s->s is implicit input in 05AB1E; filter(w-> is ʒ; .chars() is implicitly again; .distinct() is Ù; .count() (or length) is g; <8 is 8‹; and the closing ) is implicitly since it's at the end of the 05AB1E program (if I wanted to do something after the filter I'd have to close it with }); and finally outputting is implicitly again. So my Java and 05AB1E are similar, one is a 46 bytes function and the other a 5 bytes full program, though. xD
                                                                      – Kevin Cruijssen
                                                                      Nov 9 at 13:06












                                                                    • Hehe, also basically same for my APL answer. It meets in the middle: 11 bytes :P
                                                                      – Quintec
                                                                      Nov 9 at 15:24


















                                                                    • Wow, w.chars.distinct.count. Turn each of those words into a symbol and you have a golfing language! xD
                                                                      – Quintec
                                                                      Nov 9 at 12:56










                                                                    • @Quintec Hehe, it's what I do in my 05AB1E answer. :) s->s is implicit input in 05AB1E; filter(w-> is ʒ; .chars() is implicitly again; .distinct() is Ù; .count() (or length) is g; <8 is 8‹; and the closing ) is implicitly since it's at the end of the 05AB1E program (if I wanted to do something after the filter I'd have to close it with }); and finally outputting is implicitly again. So my Java and 05AB1E are similar, one is a 46 bytes function and the other a 5 bytes full program, though. xD
                                                                      – Kevin Cruijssen
                                                                      Nov 9 at 13:06












                                                                    • Hehe, also basically same for my APL answer. It meets in the middle: 11 bytes :P
                                                                      – Quintec
                                                                      Nov 9 at 15:24
















                                                                    Wow, w.chars.distinct.count. Turn each of those words into a symbol and you have a golfing language! xD
                                                                    – Quintec
                                                                    Nov 9 at 12:56




                                                                    Wow, w.chars.distinct.count. Turn each of those words into a symbol and you have a golfing language! xD
                                                                    – Quintec
                                                                    Nov 9 at 12:56












                                                                    @Quintec Hehe, it's what I do in my 05AB1E answer. :) s->s is implicit input in 05AB1E; filter(w-> is ʒ; .chars() is implicitly again; .distinct() is Ù; .count() (or length) is g; <8 is 8‹; and the closing ) is implicitly since it's at the end of the 05AB1E program (if I wanted to do something after the filter I'd have to close it with }); and finally outputting is implicitly again. So my Java and 05AB1E are similar, one is a 46 bytes function and the other a 5 bytes full program, though. xD
                                                                    – Kevin Cruijssen
                                                                    Nov 9 at 13:06






                                                                    @Quintec Hehe, it's what I do in my 05AB1E answer. :) s->s is implicit input in 05AB1E; filter(w-> is ʒ; .chars() is implicitly again; .distinct() is Ù; .count() (or length) is g; <8 is 8‹; and the closing ) is implicitly since it's at the end of the 05AB1E program (if I wanted to do something after the filter I'd have to close it with }); and finally outputting is implicitly again. So my Java and 05AB1E are similar, one is a 46 bytes function and the other a 5 bytes full program, though. xD
                                                                    – Kevin Cruijssen
                                                                    Nov 9 at 13:06














                                                                    Hehe, also basically same for my APL answer. It meets in the middle: 11 bytes :P
                                                                    – Quintec
                                                                    Nov 9 at 15:24




                                                                    Hehe, also basically same for my APL answer. It meets in the middle: 11 bytes :P
                                                                    – Quintec
                                                                    Nov 9 at 15:24










                                                                    up vote
                                                                    1
                                                                    down vote














                                                                    Python 2, 40 bytes





                                                                    lambda i:[x for x in i if len(set(x))<8]


                                                                    Try it online!



                                                                    Test cases borrowed from @Dennis. Input and output are both lists.






                                                                    share|improve this answer

























                                                                      up vote
                                                                      1
                                                                      down vote














                                                                      Python 2, 40 bytes





                                                                      lambda i:[x for x in i if len(set(x))<8]


                                                                      Try it online!



                                                                      Test cases borrowed from @Dennis. Input and output are both lists.






                                                                      share|improve this answer























                                                                        up vote
                                                                        1
                                                                        down vote










                                                                        up vote
                                                                        1
                                                                        down vote










                                                                        Python 2, 40 bytes





                                                                        lambda i:[x for x in i if len(set(x))<8]


                                                                        Try it online!



                                                                        Test cases borrowed from @Dennis. Input and output are both lists.






                                                                        share|improve this answer













                                                                        Python 2, 40 bytes





                                                                        lambda i:[x for x in i if len(set(x))<8]


                                                                        Try it online!



                                                                        Test cases borrowed from @Dennis. Input and output are both lists.







                                                                        share|improve this answer












                                                                        share|improve this answer



                                                                        share|improve this answer










                                                                        answered Nov 9 at 7:05









                                                                        ElPedro

                                                                        3,4131023




                                                                        3,4131023






















                                                                            up vote
                                                                            1
                                                                            down vote














                                                                            Red, 54 bytes



                                                                            func[b][foreach a b[if 8 > length? unique a[print a]]]


                                                                            Try it online!



                                                                            The first test set was taken from Dennis'






                                                                            share|improve this answer

























                                                                              up vote
                                                                              1
                                                                              down vote














                                                                              Red, 54 bytes



                                                                              func[b][foreach a b[if 8 > length? unique a[print a]]]


                                                                              Try it online!



                                                                              The first test set was taken from Dennis'






                                                                              share|improve this answer























                                                                                up vote
                                                                                1
                                                                                down vote










                                                                                up vote
                                                                                1
                                                                                down vote










                                                                                Red, 54 bytes



                                                                                func[b][foreach a b[if 8 > length? unique a[print a]]]


                                                                                Try it online!



                                                                                The first test set was taken from Dennis'






                                                                                share|improve this answer













                                                                                Red, 54 bytes



                                                                                func[b][foreach a b[if 8 > length? unique a[print a]]]


                                                                                Try it online!



                                                                                The first test set was taken from Dennis'







                                                                                share|improve this answer












                                                                                share|improve this answer



                                                                                share|improve this answer










                                                                                answered Nov 9 at 8:04









                                                                                Galen Ivanov

                                                                                5,94711032




                                                                                5,94711032






















                                                                                    up vote
                                                                                    1
                                                                                    down vote














                                                                                    C# (.NET Core), 58 bytes



                                                                                     a=>a.Where(x=>x.GroupBy(y=>y).Count()<8)


                                                                                    Try It Online!






                                                                                    share|improve this answer

























                                                                                      up vote
                                                                                      1
                                                                                      down vote














                                                                                      C# (.NET Core), 58 bytes



                                                                                       a=>a.Where(x=>x.GroupBy(y=>y).Count()<8)


                                                                                      Try It Online!






                                                                                      share|improve this answer























                                                                                        up vote
                                                                                        1
                                                                                        down vote










                                                                                        up vote
                                                                                        1
                                                                                        down vote










                                                                                        C# (.NET Core), 58 bytes



                                                                                         a=>a.Where(x=>x.GroupBy(y=>y).Count()<8)


                                                                                        Try It Online!






                                                                                        share|improve this answer













                                                                                        C# (.NET Core), 58 bytes



                                                                                         a=>a.Where(x=>x.GroupBy(y=>y).Count()<8)


                                                                                        Try It Online!







                                                                                        share|improve this answer












                                                                                        share|improve this answer



                                                                                        share|improve this answer










                                                                                        answered Nov 9 at 13:34









                                                                                        LiefdeWen

                                                                                        2,502936




                                                                                        2,502936






















                                                                                            up vote
                                                                                            1
                                                                                            down vote














                                                                                            C (gcc), 104 95 bytes



                                                                                            Dennis's word set was also used here.



                                                                                            Thanks to nwellnhof for the suggestions.





                                                                                            char*s,*t;f(i,j,k){for(;~scanf("%ms",&s);i<8&&puts(s))for(i=j=0,t=s;*t;j=k)k=j|1<<*t++,i+=j<k;}


                                                                                            Try it online!






                                                                                            share|improve this answer























                                                                                            • 96 bytes, if you're OK with implementation- and undefined behavior.
                                                                                              – nwellnhof
                                                                                              Nov 9 at 10:15










                                                                                            • @nwellnhof What's a little UD between friends for code golf? :-)
                                                                                              – ErikF
                                                                                              Nov 9 at 17:16















                                                                                            up vote
                                                                                            1
                                                                                            down vote














                                                                                            C (gcc), 104 95 bytes



                                                                                            Dennis's word set was also used here.



                                                                                            Thanks to nwellnhof for the suggestions.





                                                                                            char*s,*t;f(i,j,k){for(;~scanf("%ms",&s);i<8&&puts(s))for(i=j=0,t=s;*t;j=k)k=j|1<<*t++,i+=j<k;}


                                                                                            Try it online!






                                                                                            share|improve this answer























                                                                                            • 96 bytes, if you're OK with implementation- and undefined behavior.
                                                                                              – nwellnhof
                                                                                              Nov 9 at 10:15










                                                                                            • @nwellnhof What's a little UD between friends for code golf? :-)
                                                                                              – ErikF
                                                                                              Nov 9 at 17:16













                                                                                            up vote
                                                                                            1
                                                                                            down vote










                                                                                            up vote
                                                                                            1
                                                                                            down vote










                                                                                            C (gcc), 104 95 bytes



                                                                                            Dennis's word set was also used here.



                                                                                            Thanks to nwellnhof for the suggestions.





                                                                                            char*s,*t;f(i,j,k){for(;~scanf("%ms",&s);i<8&&puts(s))for(i=j=0,t=s;*t;j=k)k=j|1<<*t++,i+=j<k;}


                                                                                            Try it online!






                                                                                            share|improve this answer















                                                                                            C (gcc), 104 95 bytes



                                                                                            Dennis's word set was also used here.



                                                                                            Thanks to nwellnhof for the suggestions.





                                                                                            char*s,*t;f(i,j,k){for(;~scanf("%ms",&s);i<8&&puts(s))for(i=j=0,t=s;*t;j=k)k=j|1<<*t++,i+=j<k;}


                                                                                            Try it online!







                                                                                            share|improve this answer














                                                                                            share|improve this answer



                                                                                            share|improve this answer








                                                                                            edited Nov 9 at 17:15

























                                                                                            answered Nov 9 at 9:36









                                                                                            ErikF

                                                                                            1,25917




                                                                                            1,25917












                                                                                            • 96 bytes, if you're OK with implementation- and undefined behavior.
                                                                                              – nwellnhof
                                                                                              Nov 9 at 10:15










                                                                                            • @nwellnhof What's a little UD between friends for code golf? :-)
                                                                                              – ErikF
                                                                                              Nov 9 at 17:16


















                                                                                            • 96 bytes, if you're OK with implementation- and undefined behavior.
                                                                                              – nwellnhof
                                                                                              Nov 9 at 10:15










                                                                                            • @nwellnhof What's a little UD between friends for code golf? :-)
                                                                                              – ErikF
                                                                                              Nov 9 at 17:16
















                                                                                            96 bytes, if you're OK with implementation- and undefined behavior.
                                                                                            – nwellnhof
                                                                                            Nov 9 at 10:15




                                                                                            96 bytes, if you're OK with implementation- and undefined behavior.
                                                                                            – nwellnhof
                                                                                            Nov 9 at 10:15












                                                                                            @nwellnhof What's a little UD between friends for code golf? :-)
                                                                                            – ErikF
                                                                                            Nov 9 at 17:16




                                                                                            @nwellnhof What's a little UD between friends for code golf? :-)
                                                                                            – ErikF
                                                                                            Nov 9 at 17:16










                                                                                            up vote
                                                                                            1
                                                                                            down vote













                                                                                            perl -nlE, 32 bytes



                                                                                            my%h;@h{/./g}=();say if keys%h<8


                                                                                            This reads words from STDIN, printing out those with less than 7 different characters.






                                                                                            share|improve this answer

















                                                                                            • 1




                                                                                              25 bytes: my%h;@h{/./g}=1;%h<8&&say (%h<8 requires Perl 5.26)
                                                                                              – nwellnhof
                                                                                              Nov 12 at 12:25















                                                                                            up vote
                                                                                            1
                                                                                            down vote













                                                                                            perl -nlE, 32 bytes



                                                                                            my%h;@h{/./g}=();say if keys%h<8


                                                                                            This reads words from STDIN, printing out those with less than 7 different characters.






                                                                                            share|improve this answer

















                                                                                            • 1




                                                                                              25 bytes: my%h;@h{/./g}=1;%h<8&&say (%h<8 requires Perl 5.26)
                                                                                              – nwellnhof
                                                                                              Nov 12 at 12:25













                                                                                            up vote
                                                                                            1
                                                                                            down vote










                                                                                            up vote
                                                                                            1
                                                                                            down vote









                                                                                            perl -nlE, 32 bytes



                                                                                            my%h;@h{/./g}=();say if keys%h<8


                                                                                            This reads words from STDIN, printing out those with less than 7 different characters.






                                                                                            share|improve this answer












                                                                                            perl -nlE, 32 bytes



                                                                                            my%h;@h{/./g}=();say if keys%h<8


                                                                                            This reads words from STDIN, printing out those with less than 7 different characters.







                                                                                            share|improve this answer












                                                                                            share|improve this answer



                                                                                            share|improve this answer










                                                                                            answered Nov 10 at 17:13









                                                                                            Abigail

                                                                                            41717




                                                                                            41717








                                                                                            • 1




                                                                                              25 bytes: my%h;@h{/./g}=1;%h<8&&say (%h<8 requires Perl 5.26)
                                                                                              – nwellnhof
                                                                                              Nov 12 at 12:25














                                                                                            • 1




                                                                                              25 bytes: my%h;@h{/./g}=1;%h<8&&say (%h<8 requires Perl 5.26)
                                                                                              – nwellnhof
                                                                                              Nov 12 at 12:25








                                                                                            1




                                                                                            1




                                                                                            25 bytes: my%h;@h{/./g}=1;%h<8&&say (%h<8 requires Perl 5.26)
                                                                                            – nwellnhof
                                                                                            Nov 12 at 12:25




                                                                                            25 bytes: my%h;@h{/./g}=1;%h<8&&say (%h<8 requires Perl 5.26)
                                                                                            – nwellnhof
                                                                                            Nov 12 at 12:25










                                                                                            up vote
                                                                                            0
                                                                                            down vote














                                                                                            Racket, 95 bytes



                                                                                            (require racket/set)(define(f l)(filter(lambda(x)(<(set-count(list->set(string->list x)))8))l))


                                                                                            Try it online!



                                                                                            The test set was taken from Dennis'






                                                                                            share|improve this answer

























                                                                                              up vote
                                                                                              0
                                                                                              down vote














                                                                                              Racket, 95 bytes



                                                                                              (require racket/set)(define(f l)(filter(lambda(x)(<(set-count(list->set(string->list x)))8))l))


                                                                                              Try it online!



                                                                                              The test set was taken from Dennis'






                                                                                              share|improve this answer























                                                                                                up vote
                                                                                                0
                                                                                                down vote










                                                                                                up vote
                                                                                                0
                                                                                                down vote










                                                                                                Racket, 95 bytes



                                                                                                (require racket/set)(define(f l)(filter(lambda(x)(<(set-count(list->set(string->list x)))8))l))


                                                                                                Try it online!



                                                                                                The test set was taken from Dennis'






                                                                                                share|improve this answer













                                                                                                Racket, 95 bytes



                                                                                                (require racket/set)(define(f l)(filter(lambda(x)(<(set-count(list->set(string->list x)))8))l))


                                                                                                Try it online!



                                                                                                The test set was taken from Dennis'







                                                                                                share|improve this answer












                                                                                                share|improve this answer



                                                                                                share|improve this answer










                                                                                                answered Nov 9 at 8:45









                                                                                                Galen Ivanov

                                                                                                5,94711032




                                                                                                5,94711032






















                                                                                                    up vote
                                                                                                    0
                                                                                                    down vote














                                                                                                    Charcoal, 12 bytes



                                                                                                    ΦA›⁸LΦι⁼μ⌕ιλ


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



                                                                                                     A              Input array
                                                                                                    Φ Filter strings where
                                                                                                    ⁸ Literal 8
                                                                                                    › Is greater than
                                                                                                    L Length of
                                                                                                    ι Current string
                                                                                                    Φ Filtered on characters where
                                                                                                    μ Inner index
                                                                                                    ⁼ Equals
                                                                                                    λ Current character's
                                                                                                    ⌕ First index in
                                                                                                    ι Current string
                                                                                                    Implicitly print matching strings





                                                                                                    share|improve this answer





















                                                                                                    • 10?
                                                                                                      – ASCII-only
                                                                                                      Nov 18 at 5:12















                                                                                                    up vote
                                                                                                    0
                                                                                                    down vote














                                                                                                    Charcoal, 12 bytes



                                                                                                    ΦA›⁸LΦι⁼μ⌕ιλ


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



                                                                                                     A              Input array
                                                                                                    Φ Filter strings where
                                                                                                    ⁸ Literal 8
                                                                                                    › Is greater than
                                                                                                    L Length of
                                                                                                    ι Current string
                                                                                                    Φ Filtered on characters where
                                                                                                    μ Inner index
                                                                                                    ⁼ Equals
                                                                                                    λ Current character's
                                                                                                    ⌕ First index in
                                                                                                    ι Current string
                                                                                                    Implicitly print matching strings





                                                                                                    share|improve this answer





















                                                                                                    • 10?
                                                                                                      – ASCII-only
                                                                                                      Nov 18 at 5:12













                                                                                                    up vote
                                                                                                    0
                                                                                                    down vote










                                                                                                    up vote
                                                                                                    0
                                                                                                    down vote










                                                                                                    Charcoal, 12 bytes



                                                                                                    ΦA›⁸LΦι⁼μ⌕ιλ


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



                                                                                                     A              Input array
                                                                                                    Φ Filter strings where
                                                                                                    ⁸ Literal 8
                                                                                                    › Is greater than
                                                                                                    L Length of
                                                                                                    ι Current string
                                                                                                    Φ Filtered on characters where
                                                                                                    μ Inner index
                                                                                                    ⁼ Equals
                                                                                                    λ Current character's
                                                                                                    ⌕ First index in
                                                                                                    ι Current string
                                                                                                    Implicitly print matching strings





                                                                                                    share|improve this answer













                                                                                                    Charcoal, 12 bytes



                                                                                                    ΦA›⁸LΦι⁼μ⌕ιλ


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



                                                                                                     A              Input array
                                                                                                    Φ Filter strings where
                                                                                                    ⁸ Literal 8
                                                                                                    › Is greater than
                                                                                                    L Length of
                                                                                                    ι Current string
                                                                                                    Φ Filtered on characters where
                                                                                                    μ Inner index
                                                                                                    ⁼ Equals
                                                                                                    λ Current character's
                                                                                                    ⌕ First index in
                                                                                                    ι Current string
                                                                                                    Implicitly print matching strings






                                                                                                    share|improve this answer












                                                                                                    share|improve this answer



                                                                                                    share|improve this answer










                                                                                                    answered Nov 9 at 9:33









                                                                                                    Neil

                                                                                                    78.1k744175




                                                                                                    78.1k744175












                                                                                                    • 10?
                                                                                                      – ASCII-only
                                                                                                      Nov 18 at 5:12


















                                                                                                    • 10?
                                                                                                      – ASCII-only
                                                                                                      Nov 18 at 5:12
















                                                                                                    10?
                                                                                                    – ASCII-only
                                                                                                    Nov 18 at 5:12




                                                                                                    10?
                                                                                                    – ASCII-only
                                                                                                    Nov 18 at 5:12










                                                                                                    up vote
                                                                                                    0
                                                                                                    down vote













                                                                                                    Japt -f, 6 bytes



                                                                                                    ¬â Ê<8


                                                                                                    Try it, using Dennis' test cases






                                                                                                    share|improve this answer

























                                                                                                      up vote
                                                                                                      0
                                                                                                      down vote













                                                                                                      Japt -f, 6 bytes



                                                                                                      ¬â Ê<8


                                                                                                      Try it, using Dennis' test cases






                                                                                                      share|improve this answer























                                                                                                        up vote
                                                                                                        0
                                                                                                        down vote










                                                                                                        up vote
                                                                                                        0
                                                                                                        down vote









                                                                                                        Japt -f, 6 bytes



                                                                                                        ¬â Ê<8


                                                                                                        Try it, using Dennis' test cases






                                                                                                        share|improve this answer












                                                                                                        Japt -f, 6 bytes



                                                                                                        ¬â Ê<8


                                                                                                        Try it, using Dennis' test cases







                                                                                                        share|improve this answer












                                                                                                        share|improve this answer



                                                                                                        share|improve this answer










                                                                                                        answered Nov 9 at 10:57









                                                                                                        Shaggy

                                                                                                        18.2k21663




                                                                                                        18.2k21663






















                                                                                                            up vote
                                                                                                            0
                                                                                                            down vote













                                                                                                            JavaScript (ES6), 53 bytes



                                                                                                            Without using a set:





                                                                                                            a=>a.filter(w=>[...w].every(o=c=>o[c]=o[c]||--k,k=8))


                                                                                                            Try it online! (using Dennis' test set)






                                                                                                            share|improve this answer



























                                                                                                              up vote
                                                                                                              0
                                                                                                              down vote













                                                                                                              JavaScript (ES6), 53 bytes



                                                                                                              Without using a set:





                                                                                                              a=>a.filter(w=>[...w].every(o=c=>o[c]=o[c]||--k,k=8))


                                                                                                              Try it online! (using Dennis' test set)






                                                                                                              share|improve this answer

























                                                                                                                up vote
                                                                                                                0
                                                                                                                down vote










                                                                                                                up vote
                                                                                                                0
                                                                                                                down vote









                                                                                                                JavaScript (ES6), 53 bytes



                                                                                                                Without using a set:





                                                                                                                a=>a.filter(w=>[...w].every(o=c=>o[c]=o[c]||--k,k=8))


                                                                                                                Try it online! (using Dennis' test set)






                                                                                                                share|improve this answer














                                                                                                                JavaScript (ES6), 53 bytes



                                                                                                                Without using a set:





                                                                                                                a=>a.filter(w=>[...w].every(o=c=>o[c]=o[c]||--k,k=8))


                                                                                                                Try it online! (using Dennis' test set)







                                                                                                                share|improve this answer














                                                                                                                share|improve this answer



                                                                                                                share|improve this answer








                                                                                                                edited Nov 9 at 11:23

























                                                                                                                answered Nov 9 at 10:32









                                                                                                                Arnauld

                                                                                                                69.5k586294




                                                                                                                69.5k586294






















                                                                                                                    up vote
                                                                                                                    0
                                                                                                                    down vote













                                                                                                                    Snap! 4, scratchblocks2 syntax



                                                                                                                    (pretending that Snap! exclusive blocks are valid in scratchblocks2 but functions use the Scratch define)



                                                                                                                    69 bytes



                                                                                                                    b takes a list of strings.



                                                                                                                    define((b)
                                                                                                                    report((#)keep items such that(<(length of )<[7]>)from(b





                                                                                                                    share|improve this answer

























                                                                                                                      up vote
                                                                                                                      0
                                                                                                                      down vote













                                                                                                                      Snap! 4, scratchblocks2 syntax



                                                                                                                      (pretending that Snap! exclusive blocks are valid in scratchblocks2 but functions use the Scratch define)



                                                                                                                      69 bytes



                                                                                                                      b takes a list of strings.



                                                                                                                      define((b)
                                                                                                                      report((#)keep items such that(<(length of )<[7]>)from(b





                                                                                                                      share|improve this answer























                                                                                                                        up vote
                                                                                                                        0
                                                                                                                        down vote










                                                                                                                        up vote
                                                                                                                        0
                                                                                                                        down vote









                                                                                                                        Snap! 4, scratchblocks2 syntax



                                                                                                                        (pretending that Snap! exclusive blocks are valid in scratchblocks2 but functions use the Scratch define)



                                                                                                                        69 bytes



                                                                                                                        b takes a list of strings.



                                                                                                                        define((b)
                                                                                                                        report((#)keep items such that(<(length of )<[7]>)from(b





                                                                                                                        share|improve this answer












                                                                                                                        Snap! 4, scratchblocks2 syntax



                                                                                                                        (pretending that Snap! exclusive blocks are valid in scratchblocks2 but functions use the Scratch define)



                                                                                                                        69 bytes



                                                                                                                        b takes a list of strings.



                                                                                                                        define((b)
                                                                                                                        report((#)keep items such that(<(length of )<[7]>)from(b






                                                                                                                        share|improve this answer












                                                                                                                        share|improve this answer



                                                                                                                        share|improve this answer










                                                                                                                        answered Nov 9 at 23:49









                                                                                                                        Silas Reel

                                                                                                                        316




                                                                                                                        316






















                                                                                                                            up vote
                                                                                                                            0
                                                                                                                            down vote














                                                                                                                            C++ (gcc), 105 104 bytes





                                                                                                                            #import<bits/stdc++.h>
                                                                                                                            f(){for(char*n;~scanf("%ms",&n);)std::set<int>(n,n+strlen(n)).size()<8&&puts(n);}


                                                                                                                            Try it online!



                                                                                                                            -1 byte thanks to @ceilingcat






                                                                                                                            share|improve this answer



























                                                                                                                              up vote
                                                                                                                              0
                                                                                                                              down vote














                                                                                                                              C++ (gcc), 105 104 bytes





                                                                                                                              #import<bits/stdc++.h>
                                                                                                                              f(){for(char*n;~scanf("%ms",&n);)std::set<int>(n,n+strlen(n)).size()<8&&puts(n);}


                                                                                                                              Try it online!



                                                                                                                              -1 byte thanks to @ceilingcat






                                                                                                                              share|improve this answer

























                                                                                                                                up vote
                                                                                                                                0
                                                                                                                                down vote










                                                                                                                                up vote
                                                                                                                                0
                                                                                                                                down vote










                                                                                                                                C++ (gcc), 105 104 bytes





                                                                                                                                #import<bits/stdc++.h>
                                                                                                                                f(){for(char*n;~scanf("%ms",&n);)std::set<int>(n,n+strlen(n)).size()<8&&puts(n);}


                                                                                                                                Try it online!



                                                                                                                                -1 byte thanks to @ceilingcat






                                                                                                                                share|improve this answer















                                                                                                                                C++ (gcc), 105 104 bytes





                                                                                                                                #import<bits/stdc++.h>
                                                                                                                                f(){for(char*n;~scanf("%ms",&n);)std::set<int>(n,n+strlen(n)).size()<8&&puts(n);}


                                                                                                                                Try it online!



                                                                                                                                -1 byte thanks to @ceilingcat







                                                                                                                                share|improve this answer














                                                                                                                                share|improve this answer



                                                                                                                                share|improve this answer








                                                                                                                                edited yesterday

























                                                                                                                                answered Nov 9 at 19:19









                                                                                                                                Logern

                                                                                                                                70546




                                                                                                                                70546






























                                                                                                                                     

                                                                                                                                    draft saved


                                                                                                                                    draft discarded



















































                                                                                                                                     


                                                                                                                                    draft saved


                                                                                                                                    draft discarded














                                                                                                                                    StackExchange.ready(
                                                                                                                                    function () {
                                                                                                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f175559%2fspelling-bee-acceptable%23new-answer', 'question_page');
                                                                                                                                    }
                                                                                                                                    );

                                                                                                                                    Post as a guest















                                                                                                                                    Required, but never shown





















































                                                                                                                                    Required, but never shown














                                                                                                                                    Required, but never shown












                                                                                                                                    Required, but never shown







                                                                                                                                    Required, but never shown

































                                                                                                                                    Required, but never shown














                                                                                                                                    Required, but never shown












                                                                                                                                    Required, but never shown







                                                                                                                                    Required, but never shown







                                                                                                                                    Popular posts from this blog

                                                                                                                                    鏡平學校

                                                                                                                                    ꓛꓣだゔៀៅຸ໢ທຮ໕໒ ,ໂ'໥໓າ໼ឨឲ៵៭ៈゎゔit''䖳𥁄卿' ☨₤₨こゎもょの;ꜹꟚꞖꞵꟅꞛေၦေɯ,ɨɡ𛃵𛁹ޝ޳ޠ޾,ޤޒޯ޾𫝒𫠁သ𛅤チョ'サノބޘދ𛁐ᶿᶇᶀᶋᶠ㨑㽹⻮ꧬ꧹؍۩وَؠ㇕㇃㇪ ㇦㇋㇋ṜẰᵡᴠ 軌ᵕ搜۳ٰޗޮ޷ސޯ𫖾𫅀ल, ꙭ꙰ꚅꙁꚊꞻꝔ꟠Ꝭㄤﺟޱސꧨꧼ꧴ꧯꧽ꧲ꧯ'⽹⽭⾁⿞⼳⽋២៩ញណើꩯꩤ꩸ꩮᶻᶺᶧᶂ𫳲𫪭𬸄𫵰𬖩𬫣𬊉ၲ𛅬㕦䬺𫝌𫝼,,𫟖𫞽ហៅ஫㆔ాఆఅꙒꚞꙍ,Ꙟ꙱エ ,ポテ,フࢰࢯ𫟠𫞶 𫝤𫟠ﺕﹱﻜﻣ𪵕𪭸𪻆𪾩𫔷ġ,ŧآꞪ꟥,ꞔꝻ♚☹⛵𛀌ꬷꭞȄƁƪƬșƦǙǗdžƝǯǧⱦⱰꓕꓢႋ神 ဴ၀க௭எ௫ឫោ ' េㇷㇴㇼ神ㇸㇲㇽㇴㇼㇻㇸ'ㇸㇿㇸㇹㇰㆣꓚꓤ₡₧ ㄨㄟ㄂ㄖㄎ໗ツڒذ₶।ऩछएोञयूटक़कयँृी,冬'𛅢𛅥ㇱㇵㇶ𥄥𦒽𠣧𠊓𧢖𥞘𩔋цѰㄠſtʯʭɿʆʗʍʩɷɛ,əʏダヵㄐㄘR{gỚṖḺờṠṫảḙḭᴮᵏᴘᵀᵷᵕᴜᴏᵾq﮲ﲿﴽﭙ軌ﰬﶚﶧ﫲Ҝжюїкӈㇴffצּ﬘﭅﬈軌'ffistfflſtffतभफɳɰʊɲʎ𛁱𛁖𛁮𛀉 𛂯𛀞నఋŀŲ 𫟲𫠖𫞺ຆຆ ໹້໕໗ๆทԊꧢꧠ꧰ꓱ⿝⼑ŎḬẃẖỐẅ ,ờỰỈỗﮊDžȩꭏꭎꬻ꭮ꬿꭖꭥꭅ㇭神 ⾈ꓵꓑ⺄㄄ㄪㄙㄅㄇstA۵䞽ॶ𫞑𫝄㇉㇇゜軌𩜛𩳠Jﻺ‚Üမ႕ႌႊၐၸဓၞၞၡ៸wyvtᶎᶪᶹစဎ꣡꣰꣢꣤ٗ؋لㇳㇾㇻㇱ㆐㆔,,㆟Ⱶヤマފ޼ޝަݿݞݠݷݐ',ݘ,ݪݙݵ𬝉𬜁𫝨𫞘くせぉて¼óû×ó£…𛅑הㄙくԗԀ5606神45,神796'𪤻𫞧ꓐ㄁ㄘɥɺꓵꓲ3''7034׉ⱦⱠˆ“𫝋ȍ,ꩲ軌꩷ꩶꩧꩫఞ۔فڱێظペサ神ナᴦᵑ47 9238їﻂ䐊䔉㠸﬎ffiﬣ,לּᴷᴦᵛᵽ,ᴨᵤ ᵸᵥᴗᵈꚏꚉꚟ⻆rtǟƴ𬎎

                                                                                                                                    Why https connections are so slow when debugging (stepping over) in Java?