text:
Print the missing characters
Simple challenge inspired by the popularity of my previous print invisible text and print real invisible text challenges, and the same length different string challenge.
Given a string consisting of only printable characters (0x20 to 0x7E), print every printable character not present in the string.
Input
A string, or array of characters, consisting of only printable ASCII characters
Output
Every printable ASCII character not present in the input string, in any order.
Testcases
Input:  "Hello, World!"
Output: ""#$%&'()*+-./0123456789:;<=>?@ABCDEFGIJKLMNOPQRSTUVXYZ[\]^_`abcfghijkmnpqstuvwxyz{|}~"
========
Input:  "Hi!"
Output: " "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghjklmnopqrstuvwxyz{|}~"
========
Input:  ""
Output: " !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
========
Input:  " !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
Output: ""

Scoring
This is code-golf so fewest bytes in each language wins

If returning an array, can we include empty elements in place of the used characters?

@Shaggy sure, that's fine

@Rod don't leak my plans D:

Can the output be a Set object of strings of the characters? set( 'a', 'b', 'c' )

@BradGilbertb2gills I'd prefer it be either a string or a plain array

@Mayube it was a joke, because it would be the same problem >.<

Related

Can input/output be array of bytes, i.e. ordinals?

@MikhailV only if your language is unable to output ASCII characters

GS2, 2 bytes
ç7

Try it online!
How it works
    (implicit) Push the sting of all characters in STDIN on the stack.
ç   Push the string of all printable ASCII characters.
 7  Perform symmetric set difference.
    (implicit) Print the result to STDOUT.

Python 3.5, 39 bytes
lambda n:{*map(chr,range(32,127))}-{*n}

Try it online!
Turns input into a set, and remove it from the set containing all ascii characters

This works after Python 3.5 only.

Perl 6, 29 bytes
{[~] keys (' '..'~')∖.comb}

Note that the result is random because Sets are unordered.
Test it
Expanded:
{
  [~]        # reduce using string concatenation
             # (shorter than ｢join '',｣)

  keys       # get the keys from the Set object resulting from the following

  (' '..'~') # Range of printable characters
  ∖          # Set minus (this is not \ )
  .comb      # split the input into individual characters
}

There is also an ASCII version of ∖ (-), but it would require a space before it so that it isn't parsed as a subroutine call.

Japt, 14 bytes
Ho#_dÃf@bX ¥J

Try it online!
Saved 4 bytes thanks to Shaggy and obarakon

No need for the flag (see answer to my comment on the question). Replace 127 with # to save a byte and remove the U to save another.

You can use ¦ and rearrange your arguments to save a few bytes. Also, 127 can be shortened TIO

Got it down to 14 bytes: http://ethproductions.github.io/japt/?v=1.4.4&code=SG8jf19kw2ZAYlggpUo=&input=ImhlbGxvIi1Q

@Shaggy Nice! Are you happy with me editing this answer with it or do you want to post your own?

No, you work away with it, Tom - as you said before, I need to learn to post quicker! :D

A 10 byte version but unfortunately non-competing: http://ethproductions.github.io/japt/?v=1.4.4&code=SG8jf19kw2tVcQ==&input=ImhlbGxvIi1Q

Haskell, 32 bytes
f x=[y|y<-[' '..'~'],all(/=y)x]

Try it online!
Boring library function for set difference:
Haskell, 31 bytes
import Data.List
([' '..'~']\\)

Bottom looks more like an esolang

MATL, 5 bytes
6Y2X~

Try it online!
Thanks to Luis Mendo for golfing 8 bytes off!
Explanation:
   X~   % The symmetric set difference
6Y2     % Between all printable ASCII
        % And the input string (implicit)
        % Implicitly display

Symmetric set difference will give every element that is present in exactly one of the two input sets. (but not both) This will always give the right answer, since the input set will always be a subset of the second set (all printable ASCII).
Original version:
32:126tGom~)c

Explanation:
32:126          % Push the range 32-126
      t         % Duplicate it on the stack
       G        % Push the input
        o       % Convert it to character points
         m      % Is member (0 for each char that isn't in input, 1 for each char that is)
          ~     % Logical NOT
           )    % Take the truthy elements of this array from the previous array (All Printable ASCII)
            c   % Display as a string

Octave, 22 20 bytes
Thanks to @Luis Mendo saved 2 bytes.
@(s)setxor(32:'~',s)

Try it online!
Other answer:
@(s)setdiff(' ':'~',s)

Try it online!

@(s)setxor(' ':'~',s) saves 1 byte

@LuisMendo Very nice! But I think that is a different thing. I suggest that you post it as a new answer :)

No, it's really just a minor improvement. I'll be happy that you post it if you want. BTW @(s)setxor(32:'~',s) seems to work too --- and same comment for that :-)

@LuisMendo Thanks, I agree because (Luis) said.

JavaScript (ES6), 74 bytes
I'm sure there's a shorter way to do this!
s=>[...Array(95)].map((_,y)=>s.includes(c=String.fromCharCode(y+32))?"":c)

Try it

let f=
s=>[...Array(95)].map((_,y)=>s.includes(c=String.fromCharCode(y+32))?"":c)
oninput=_=>o.innerText=f(i.value).join``
o.innerText=f(i.value="Hello, World!").join``
<input id=i><pre id=o>

Should be Array(95) to include the missing ~

Was that always there, @Malivil? Could've sworn the last character was } when I wrote this up. Fixed now, thanks.

Can't believe C# is shorter than JavaScript for this, especially as I have to include my usings.

@TheLethalCoder, String.fromCharCode is a git, that's why! :D

@Shaggy I dunno, I just was looking at your code to see how it worked and I typed literally every symbol on my keyboard and noticed ~ didn't change anything but that it was in the spec. Also, the "Try It" part needs to be updated.

Perl, 39 bytes
s!.*!"pack(c95,32..126)=~y/$_//dr"!ee

Run with perl -pe.

I get the error message 'Bareword found where operator expected at (eval 1) line 2, near "y/Hello World!//dr"' when I run this...

Full command-line: echo 'Hello World!' | perl -pe 's!.*!"pack(c95,32..126)=~y/$_//dr"!ee'. This works for me on both Perl v5.14 and v5.24.

It's Perl v5.10 that's not working... Must be a change made between 5.10 and 5.14.

Nice answer, good use of pack! You can save a few bytes utilising -a too: Try it online!

Bash, 47 43 40 bytes
printf %x {32..126}|xxd -r -p|tr -d "$1"

Try it online!
Generates hexa range, inverts hex dump to char an removes characters present in first parameter.

Brachylog, 5 bytes
ẹ;Ṭ↔x

Try it online!
Explanation
ẹ          Split the input string into a list of chars
 ;Ṭ↔x      Exterminate the chars from the string Ṭ of printable ASCII chars

APL, 13 bytes
⍞~⍨⎕UCS31+⍳95

Straightforward:
       31+⍳95  ⍝ A vector 32 .. 126
   ⎕UCS        ⍝ as characters
 ~⍨            ⍝ without
⍞              ⍝ those read from character input.

05AB1E, 4 bytes
žQsм

Try it online!
žQsм  # full program
   м  # remove...
  s   # implicit input...
   м  # from...
žQ    # all ASCII characters
      # implicit output

PHP, 42 Bytes
Input as array
Output as string

<?=join(array_diff(range(" ","~"),$_GET));

Try it online!
PHP, 53 Bytes
Input as string
Output as string

<?=join(array_diff(range(" ","~"),str_split($argn)));

replace <?=join with print_r for an output as array
Try it online!

Maybe you should make a golf version of PHP :P

@CalculatorFeline I am sure that exists but it is not really good

Maybe you should make a good one. Step 1: automatic starting tag.

@CalculatorFeline I have search the link for you. https://github.com/barkermn01/PGP-php-CodeGolf/ I have no interest to make one

Well, things can get shorter than that.

@CalculatorFeline Making PHP a golfing language destroys what is the fun in golfing with PHP (at least for me): you have to constantly balance between calling functions (which often have long names), using loops, different input methods and so on. Step 1: automatic starting tag well php -r ... but e.g. in this example it doesn't pay of because echo is longer than <?=.

Jelly, 8 bytes
Really, 8 bytes? Please, tell me I missed something!
32r126Ọḟ

Try it online!
How?
32r126Ọḟ - Main link: list of characters s
32r126   - inclusive range from 32 to 126 = [32,33,...,125,126]
      Ọ  - cast ordinals to characters = list of printable characters
       ḟ - filter discard if in s

Alternatively
“ ~‘r/Ọḟ - Main link
“ ~‘     - code-page indexes = [32,126]
    r/   - reduce by inclusive range = [32,33,...,125,126]
      Ọ  - cast from ordinals to characters = list of printable characters
       ḟ - filter discard if in s

Since this challenge a new atom which yields all printable ASCII characters, ØṖ, has been introduced making the following work for 3 bytes:
ØṖḟ

No you didn't miss anything.

CJam, 8 bytes
'␡,32>q^

Where ␡ is a literal delete character.
Try it online!
'␡,       e# The range of all characters up to ~.
   32>    e# Slice it to be the range of all characters from space to ~.
      q^  e# Symmetric set difference with the input.

Just as a note, - works instead of ^.

Ruby, 23 18 17 bytes
->s{[*' '..?~]-s}

Uses a lambda function as per @sethrin's comments.
Previous versions:
[*' '..?~]-s.chars

(' '..'~').to_a-s.chars

Doesn't s have to be either read from STDIN or supplied as a function argument? The challenge also specifies that the input may be given as an array of characters. Converting to a stabby lambda and dropping chars gives a 16-byte solution.

I wasn't really sure how the input was to be addressed, given that it wasn't explicitly specified. There are a few other answers that assume the existence of the input in a variable. Is there a codegolf convention? I don't do this much.

@sethrin With a stabby lambda wouldn't it be 20 chars? ->(s){[*' '..?~]-s)}

All of the parentheses in your lambda are optional. But I may have miscounted a byte. Other languages either accept input implicitly or have stdin bound to a global variable. In Ruby $< is a shortcut for stdin but lambdas tend to be shorter. The conventions on input and output are here. I also don't do this much, so if the rules aren't what I think do let me know.

brainfuck, 120 bytes
+[+[>+<+<]>]>-[[>>]+[<<]>>-],[<+++++[>------<-]>-[>[>>]+[<<]>-]>[>>]<[-]<[-<<]>,]++++++++[->++++<]>[>[-<.>]<[->>+<<]>>+]

Try it online!
Wrapped:
+[+[>+<+<]>]>-[[>>]+[<<]>>-],[<+++++[>--
----<-]>-[>[>>]+[<<]>-]>[>>]<[-]<[-<<]>,
]++++++++[->++++<]>[>[-<.>]<[->>+<<]>>+]

Explained:
+[+[>+<+<]>]>-         initialize what we will now consider cell 0 to 95
[[>>]+[<<]>>-]         initialize cells 2 4 etc 95*2 to 1; end on cell 0 at 0
,[                     main input loop (for each char of input)
  <+++++[>------<-]>-  subtract 31 from the input
  [>[>>]+[<<]>-]       lay a trail of (input minus 31) ones in the empty spaces
  >[>>]<[-]<[-<<]>     use the trail to clear the appropriate "print" flag
,]                     keep reading input until it ends
++++++++[->++++<]>     initialize the cell directly before flag 1 to 32
[                      we'll let the accumulator overflow; no harm done
  >[-<.>]              print the accumulator if the flag is still set
  <[->>+<<]>>+         shift over the accumulator and increment it
]

Ohm, 3 bytes
α@─

Try it online!
Note: you can also enter your input as a string (example), but it fails for the empty input case.

Julia, 21 bytes
s->setdiff(' ':'~',s)

TIO link for this solution

Pip, 5 bytes
PADCa

Removes all chacracters in the input from a predefined variable.
Try it online!
Pip, 9 bytes
PARM(X^a)

Converts the characters of the input to regex, and removes the characters from the printable ASCII builtin.
Try it online!

DC is your friend for this challenge. ;)

What a perfect builtin.

APL (Dyalog Extended), 14 10 bytes
⍞~⍨' '…'~'

Try it online!
-4 bytes from Adám!(inclusive range)
Explanation
   ' '…'~'     range of chars in visible ASCII range
  ⍨            flip the arguments of the function on the left
⍞~             Get all characters not in input

Fixed the mistake..

-4: ⍞~⍨' '…'~'

Pyth, 7 6 bytes
.-srd\
-srd\
.- - Subtract the second string from the first:

srd\ Create a range from space char to the delete char
implicitly read input

Try it online!

MUMPS, 35 bytes
r r,! f i=32:1:126 w:r'[$c(i) $c(i)

Explanation

Assign input to r and write a newline (!)
Loop from 32 to 126 and if r doesn't contain ('[) the character representation of the ASCII value ($char(), can be shortened to $c()), write the that character representation.
You can attach conditionals to commands with a colon. So w:1>0 "True" is the same as if 1>0 write "True"

Try the code here

Nice answer & nice explanation.  Is there an online interpreter for MUMPS and can you post a link to it so we can play with the code?

Thanks! I added a link to tio.run. You can change the code / inputs to explore

PowerShell Core, 39 32 bytes
$a=$args
' '..'~'|?{$_-cnotin$a}

Added splatting and case sensitivity
Try it online!
Inspired by colsw's answer

Thunno 2, 3 bytes
kcḍ

Attempt This Online!
Explanation
kcḍ  # Implicit input
  ḍ  # Symmetric set difference with...
kc   # ...all printable ASCII characters
     # Implicit output

Factor, 26 25 bytes
-1 byte by using ∖ from math.unicode instead of diff, as suggested by @chunes
[ 32 126 [a,b] swap ∖ ]

Try it online!
TIO uses an old build of Factor; on the latest version, [a,b] from math.ranges has moved to [a..b] from ranges.
Explanation

Code
Explanation
Stack

[ ... ]
Quotation (anonymous function)
"Hello!"

32 126 [a,b]
Inclusive range from 32 to 126
"Hello!" T{ range f 32 95 1 }

swap
Swap so range is below input
T{ range f 32 95 1 } "Hello!"

∖
Set difference
" \"#$%&'()*+,-./012..."

This works because in Factor, a string is basically a list of codepoints, and all sequences are sets.

-1

R, 50 bytes
function(s)intToUtf8(setdiff(32:126,utf8ToInt(s)))

returns an anonymous function. Converts the input string to integers, computes the set difference between the printable range and the input values, and then converts them back to a string and returns it.
Try it online!

05AB1E, 5 4 bytes
-1 thanks to Emigna
žQsK

Try it online!
žQ   # Push all printable characters
  s  # Swap input to the top
   K # Push a with no b's (remove input characters from all printable character)

@FrodCube Oops... I forgot to update the link. It should work now. TIO (empty input)

C#, 74 71 bytes
using System.Linq;s=>new int[95].Select((n,i)=>(char)(i+32)).Except(s);

Old version with creating a range for 74 bytes:
using System.Linq;s=>Enumerable.Range(32,95).Select(n=>(char)n).Except(s);

C (gcc), 75 72 70 68 50 49 bytes
Thanks to Peter -1 byte
i;f(s){for(i=31;++i<127;index(s,i)?:putchar(i));}

Try it online!

Can you use || to make this work on "standard" C?

@Neil Yes || also works.  Isn't ?: part of "standard" C?

I always thought it was a gcc extension.

@Neil That's correct. ?: is a GNU extension. It works as well in clang and tcc though.

You can remove 1 byte by replacing strchr with index.

PHP, 53 bytes
for($k=31;$k++<126;)~strstr($argn,$k)?:print chr($k);
# or
for($k=31;$k++<126;)echo~strstr($argn,$k)?"":chr($k);

Run as pipe with -r.

I have left no more playground

@JörgHülsermann You do. You just have to share it.

V, 20 bytes
òiÎflax
òcH ¬ ~@"<

Try it online!
Hexdump:
00000000: f269 ce66 1b6c 6178 0af2 6348 20ac 207e  .i.f.lax..cH . ~
00000010: 1b40 223c                                .@"<

Charcoal, 18 15 10 8 bytes
Ｆγ¿¬№θιι

Try it online! Link is to verbose version of code. Edit: Saved 3 bytes by ranging over characters instead of integers. Saved a further 5 bytes when I discovered the undocumented γ variable which holds the printable ASCII characters. Saved a further 2 bytes when @ASCII-only fixed predefined inputs in verbose mode (the answer is still valid as it stands, it's only the try it online link that wouldn't have worked at the time).

8 bytes (unless preinitialized inputs weren't working back then)

@ASCII-only They weren't working in verbose mode... they would probably have worked in succinct mode, but I like the verbose links.

It turns out this can be 6 bytes: Φγ¬№θι: simply filter out all characters from the (now document) variable γ that appear in the input.

k, 20 12 bytes
-8 bytes thanks to coltim.
^[`c$32+!94]

Try it online!
Explanation:
     32+!94  /list of int values of all printable characters
  `c$        /turn into characters
^[         ] /partial function application of "except"

What except ^ does is remove all instances of each of element in the right/second argument from the left/first argument.

I think this can be trimmed down to 12 bytes by using ^ except.

Husk, 6 bytes
-⁰…" ~

Try it online!

Nim, 66 bytes
let s=stdin.readAll
for c in' '..'~':
 if c notin s:stdout.write c

Try it online!

Vyxal, 4 bytes
kQ?F

Try it Online!
Explanation
kQ   # Printable ASCII
  ?F # Without the input

Nibbles, 2.5 bytes
--_"\n"

Attempt This Online!
Unfortunately, the printable characters built-in in Nibbles also includes the newline, so we have to explicitly exclude it.
Explanation
--_"\n"
-       List subtract
 -       list subtract
  _       printable characters
   "\n"   newline
         input

Flip, 21 bytes
'  |D '+1<D:|g DX: #

Attempt This Online!
ATO is not working right now, but I tested this locally. Contains a raw \x7F byte.
This would have been easier if I hadn't removed the J builtin, which generates an inclusive range.
Explanation
                             Push printable ASCII onto stack:

'                            Push space character
                             Loop body:
    D                            Duplicate the current char
      ' \x7f                     Push 127
          <                      Less than?
            :                    If so, mirror & do the following:
           D                         Duplicate TOS
         1
       +                             Add by 1
   |                                 Mirror the IP

                             Setwise difference w/ input:

              g              Read 1 char from the input
                D            Duplicate
                  :          Pop, is it nonzero? (i.e. not at EOF)
                             If so, mirror:
                 X               Remove all occurences of
                                 this char in the stack.
             |                   Mirror the IP back

                    #        When loop done, print entire stack as a string.
                             Terminate program.

Arturo, 17 bytes
$=>[--@` `..`~`&]

Try it!
Takes and returns a list of characters.
$=>[         ; a function where input is assigned to &
    --       ; set difference
    @        ; reify range
    ` `..`~` ; the range of printable ascii characters
    &        ; input
]            ; end function

T-SQL (SQL Server 2016), 519 bytes
with X as(select 32a,char(32)b union all select a+1,char(a+1)from X where a<126),E AS(SELECT n FROM(VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(n)),F AS(SELECT a.n FROM E a,E b),G AS(SELECT a.n FROM F a,F b),T AS(SELECT ROW_NUMBER()OVER(ORDER BY(SELECT NULL))n FROM G),I as(SELECT ASCII(SUBSTRING(t,n,1))a FROM T JOIN(select @i as t)S on T.n<=LEN(S.t)where n=0),R as(select b from X where a not in(select a from I))select STUFF((SELECT''+b FROM R FOR XML PATH(''),TYPE).value('(./text())[1]','VARCHAR(MAX)'),1,1,'')

... but this assumes the input string is in @i, therefore a runnable script will look like:
declare @i varchar(101) = 'Test';

with X as(select 32a,char(32)b union all select a+1,char(a+1)from X where a<126),E AS(SELECT n FROM(VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(n)),F AS(SELECT a.n FROM E a,E b),G AS(SELECT a.n FROM F a,F b),T AS(SELECT ROW_NUMBER()OVER(ORDER BY(SELECT NULL))n FROM G),I as(SELECT ASCII(SUBSTRING(t,n,1))a FROM T JOIN(select @i as t)S on T.n<=LEN(S.t)where n=0),R as(select b from X where a not in(select a from I))select STUFF((SELECT''+b FROM R FOR XML PATH(''),TYPE).value('(./text())[1]','VARCHAR(MAX)'),1,1,'')

Try it online!
How it works
Use CTEs to split the input string into individual characters on separate rows in a result set; use a recursive CTE to generate a result set having individual characters on separate rows for all characters between ASCII values 32 and 126; select all rows from the latter where characters are not found in the former; use STUFF with FOR XML PATH to aggregate those characters (in lieu of the STRING_AGG function, which only arrived in SQL Server 2017).
Legible version
declare @input varchar(101) = 'Test';

with X as (
    select 32a, char(32)b
    union all
    select a+1, char(a+1) from X where a < 126
),
E(n) AS(
    SELECT n FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(n)
),
E2(n) AS(
    SELECT a.n FROM E a, E b
),
E4(n) AS(
    SELECT a.n FROM E2 a, E2 b
),
cteTally(n) AS(
    SELECT ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) n
    FROM E4
),
INPUT_STRING as (
    SELECT ASCII( SUBSTRING(term, n, 1)) as [ASCII Code]
    FROM cteTally t
    JOIN (select @input as term) S on t.n <= LEN(S.term)
    where n = 0
),
DATA_RESULTS as (
     select b from X where a not in (select [ASCII Code] from INPUT_STRING)
 )

 select STUFF( (SELECT '' + b FROM DATA_RESULTS FOR XML PATH (''),TYPE).value('(./text())[1]','VARCHAR(MAX)'), 1, 1, '' )
 ;

Why?
Because I can.
Can it be shorter?
Almost certainly!

Mathematica, 35 bytes
20~CharacterRange~126~Complement~#&

Anonymous function. Takes a list of characters as input and returns a list of characters as output.

JavaScript (ES6), 73 72 bytes
f=(s,i=95)=>i?f(s,i-1)+(s.includes(c=String.fromCharCode(i+31))?'':c):''

This builds the string recursively, excluding characters found in the input.
Snippet:

f=(s,i=95)=>i?f(s,i-1)+(s.includes(c=String.fromCharCode(i+31))?'':c):''

console.log(f('Hello, World!'));
console.log(f('Hi'));
console.log(f(''));
console.log(f(' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'));

Lua, 78 bytes
s=io.read()for i=32,126 do c=string.char(i)io.write(s:find(c,1,1)and""or c)end

Aceto, 38 bytes
cC|d
dXpc
=`I&
LM-1I
d@7F&
€92-
r4*2

Explanation
We first read the input string and explode it (€, put the characters on the stack). Next, we push the numbers 34 (94*2-) and 127 (27F1-). The second value is then removed from the stack and memorized (M):
 M-1
  7F
€92-
r4*2

We then first set a catch mark so we can jump back to this place, and then duplicate the number on the stack (the 34). We load the 126 from the quick memory and test for equality, in which case we exit:
 X
=`
L
d@

Otherwise, we duplicate the value again, convert it to a character of that number and check whether that character is already on the stack (dcC). If it is, we mirror to the right side:
cC|
d

Otherwise, we duplicate the value and convert it to a character again, print that character, increment the value and raise an exception, jumping back to the catch mark.
   d
  pc
  I&

If we mirrored, we just increment and raise an exception, too (I&).

C, 57 bytes
i=32;f(char*s){for(;i<127;i++)!strchr(s,i)?putchar(i):0;}

How it works:

Initially sets i to 32, the ASCII character code for the space (the first printable ASCII character).
The function f takes a string s, the "input".
Loops, incrementing i until it reaches ~ (126), the last printable ASCII character.
!strchr(s,i) checks if i is not in s. If i is not in s, print i. Otherwise, do nothing.

I'm sure this can be golfed.

+1 to neutralize the downvoter, but isn't it currently excluding the ~? Shouldn't it be <='~' or (not sure if this is possible in C) i<127)?

@KevinCruijssen Oh huh, missed that! Thanks!

Retina, 48 45 bytes
^
95$*~¶
+T`p`_p`(.)(?=\1)
s`(.)(?=.*\1)|¶.*

Try it online! Includes test cases. Works by prepending a line of 95 ~s, translating them into the printable ASCII characters, then deleting duplicate characters and the original input. Edit: Saved 3 bytes by matching the characters to be translated individually.

shortC, 33 bytes
i;AOi=31;++i<'~';strchr(*@,i)?:Pi

Conversions made in this program:

A -> int main(int argc, char **argv) {
O -> for(
@ -> argv
P -> putchar
Auto-inserted closing ));}

The resulting program looks like:
i;int main(int argc, char **argv){for(i=31;++i<'~';strchr(*argv,i)?:putchar(i));}

Try it online!

Pyth, 17 bytes
Vr32 127I!}CNzpCN

The naive approach.
Explanation:
Vr32 127I!}CNzpCN
Vr32 127             For N in [32, 127[
           CN        Get the ASCII character for the code N
        I!}  z       If it is in the input string...
              pCN    ...then print it

Test it online!

Clojure, 60 or 49 bytes
#(apply str(sort(apply disj(set(map char(range 32 127)))%)))

These "apply"s are killing me :/ Oh, if returning a list is fine then this is a bit shorter.
#(sort(apply disj(set(map char(range 32 127)))%))

QBIC, 32 bytes
[32,126|X=chr$(a)~instr(;,X)|\?X

Time to implement chr$ and instr in QBIC...
[32,126|    Loop from 32 to 126
X=chr$(a)   Make X$ to be the character with Ascii value a (a is our loop counter)
~instr(;,X) If our input string (read from cmd line) contains cjar X$
|           THEN (empty, no-op)
\?X         ELSE, print char X$

PowerShell, 44 Bytes
[char[]](32..126|?{$_-notin[char[]]"$args"})

creates an array of the numbers 32 through 126 (printable char codes)
finds the char codes not present in the input $args and then converts them back to a char array.
apparently the 1..5 -gt 3 trick doesn't work for -in or -notin, which would save a few bytes.

Java 8, 68 bytes
s->{for(char c=31;++c<127;System.out.print(s.contains(c+"")?"":c));}

Try it here.

Pyke, 4 bytes
~KR-

Try it here!

Python 3, 52 bytes
I feel like there ought to be a shorter way to grab all the unicode characters than this set comprehension, but I haven't found it yet.
lambda s:''.join({chr(i+34)for i in range(93)}-set(s))

Common Lisp, 79 bytes
(defun f(s)(dotimes(x 95)(let((y(code-char(+ 32 x))))(or(find y s)(princ y)))))

Very straightforward code.

Japt, 5 bytes
;EkU1

Try it - includes all test cases
Note that quotation marks in input strings cannot be escaped in Japt and %s must be escaped with %%.

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


text:
Prime of my Life
This year my age is a prime number, and so is this year. This conjunction will repeat in 10 years and again in 12. If I live to 100, I will lived exactly 11 years in which my age and the year are both prime. My condolences to those of you born in odd-numbered years, who will experience this phenomenon at most once if at all.
As it turns out, if I tell you that the consecutive gaps between years in which my age and the year were, are, or will be both primes are 4, 2, 4, 14, 10, 2, 10, 14, 16, and 14, then that is enough information for you to tell me exactly which year I was born.
The Challenge
This challenge is to write a program or function that, given a list of even numbers, each representing gaps between consecutive prime-age prime-year conjunctions, print or return all years between 1AD and 2100AD inclusive such that a person born in that year (and living no longer than 100 years) would have exactly that sequence of gaps between prime-year prime-age conjuctions (i.e. no other such conjunctions)
Or, in more mathematical terms, given a list \$a\$, print or return all \$x\$ between 1 and 2100 such that there exists a \$0<b\le100\$ such that \$x+b\$ is prime, \$b\$ is prime, and \$x+b+\sum^n_{i=1}a_i\$ and \$b+\sum^n_{i=1}a_i\$ are both prime for all \$n\$ up to the length of \$a\$ (where the latter sum is guaranteed to be less than 100).
If there are no such years in that range, you may print or return anything falsy or nothing at all.
I/O is flexible: just be able to take a list of numbers as input and produce a list of numbers as output.
Examples
[4,2,4,14,10,2,10,14,16,14]          =>     [1986]
(6,4,2,4)                            =>     ()
6,4,2,4,8,6,10,12,14,10,6            =>     1980
4;4                                  =>     (No output)
[]...................................=>     (A list containing every odd number between 1 and 2099, plus the numbers 1136, 1732, and 1762)

Scoring
Shortest program, in bytes, wins.
Bonus: I will create a bounty to reward the shortest answer that produces the correct output using an algorithm which has an asymptotic worst case running time strictly better than \$O(YA+A^2)\$ where Y is the maximum birth year and A is the maximum age. (Y and A are not inputs to your program or function, but pretend they are for the purposes of determining if your algorithm qualifies.) If you wish to compete in the bonus challenge, it is up to you to convince me your program or function meets the requirements. You may assume that all built-ins use the asymptotically fastest known classical algorithm to achieve their results (e.g. generates primes with a Sieve of Atkin rather than a Sieve of Eratosthenes). Yes, it is possible to receive this bounty even if you win the regular challenge.

I was born in an odd numbered year, and have a prime age right now.  Its not only for people born in even numbered years ;)

Yeah - I was born in a prime year and am currently a prime age. Maybe consider changing it to "will turn a prime age".

What’s special about the numbers 1136, 1732, and 1762?

O(YA+A^2) is the same as O(1), since Y and A are both constants (respectively 2100 and 100, according to the challenge definition). Should answers to the “bonus challenge” take Y and A as input?

Since the input is described as "would have exactly that sequence of gaps", then the output for the empty input should not include odd years two less than a prime.

@Grimy Y and A are not inputs to your program or function, but I will pretend that they are inputs for the purpose of determining whether your algorithm qualifies

@JonathanAllan 0 is not an prime-numbered age. the gap between birth and the first prime age is never included.

I'm sad because I was born in an odd year :'(

@quintopia does this mean that, in order to qualify for the bonus challenge, the program should theoretically work for any value of Y and A? So for example, hardcoding all primes up to 100 is out?

@Grimy Well, I won't say that, but I will say that I will consider the length of your program as Y and A go to infinity. Which is to say, if someone makes a program whose length doesn't depend on Y or A, that program will surely beat one that does.

@quintopia Submissions are fixed programs, their length does not change. Should we submit an algorithm to generate programs given A and Y? Even then, having program length not depend on Y or A is impossible because of information theory. As Y and A go to infinity, the number of bits needed to encode them goes to infinity as well.

@Grimy If you're hardcoding primes, it's pretty straightforward to work out the asymptotic growth of the length of your program as you hardcode more primes to handle bigger years. You just write the program as described, and say "if the max year and age were Y and A, the program length would be O(f(Y,A))"--no need to actually write a program generator.

@Grimy By default, a program's length should grow as O(log(A*Y))--growth any faster than that should be noted.

05AB1E, 18 bytes
2101GтLDpÏN+DpÏ¥Q–

Try it online!
Explanation
2101G               # for each N in [1 ... 2100]
     тL             # push the range [1 ... 100]
       DpÏ          # keep only numbers that are prime
          N+        # add N to each
            DpÏ     # keep only numbers that are prime
               ¥    # calculate delta's
                Q–  # print N if the resulting list is equal to input

Jelly, 19 bytes
97ÆR+⁸ÆPÐfI⁼
⁽¥cçÐf

Try it online!
How it works
⁽¥cçÐf        Main link. Argument: A (array of integers)

⁽¥c           Yield 2100.
   çÐf        Apply the helper link to each n in [1, ..., 2100], with right
              argument A. Yield all values of n that return 1.

97ÆR+⁸ÆPÐfI⁼  Helper link. Left argument: n. Right argument: A

97ÆR          Prime range; yield all prime numbers in [1, ..., 97].
    +⁸        Add n to each of these primes.
      ÆPDf    Filter by primality, keeping only prime sums.
          I   Increments; compute all forward differences.
           ⁼  Return 1 if the result and A are equal, 0 if not.

Pyth, 24 bytes
fq.+f&P_+TYP_YU100QU2100

Try it online!
I feel like this can  be golfed down quite a bit, but here it is for now.

source: Stack Exchange

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

sort: votes


text:
Write a pluralization function for Russian
In English, nouns can take on two different forms depending on whether they are singular (one) or plural (anything else). For example, we would say "1 dog" but "2 dogs", "0 dogs", "57 dogs" and so forth.
In Russian, there are three categories. Instead of "1 dog, 2 dogs, 5 dogs", in Russian it would be "1 собака, 2 собаки, 5 собак".
The categories are divided according to the following logic:

"Singular": used for 1 and any number ending in 1, except for numbers ending in 11.

Examples: 1 собака, 21 собака, 101 собака

"Few": used for 2, 3, and 4, and any number ending in 2, 3, or 4 except for numbers ending in 12, 13, and 14.

Examples: 2 собаки, 3 собаки, 4 собаки, 32 собаки, 43 собаки, 104 собаки

"Many": anything that is not considered "Singular" or "Few".

Examples: 0 собак, 5 собак, 11 собак, 13 собак, 25 собак, 111 собак, 114 собак

The challenge
Given an integer input in the range [0, 1000], return 1 if it belongs to the "singular" category, 2 if it belongs to the "few" category, and 5 if it belongs to the "many" category.
Your program may be a function or it can use STDIN. You may print to STDOUT or return a value from the function
This is a code golf challenge, so the solution with the fewest number of bytes wins.

Can we take input as a string?

@Shaggy Yes, that's fine

Pretty sure singular form is only used for 1.

@Phoenix Not in Russian.

But... I speak Russian, and have since I was three... It sounds so wrong.

@Phoenix Really? Sound normal to me. How would you say 21 dogs? Not двадцать одна собака?

Why 1, 2, and 5 in particular? Also, why can't I use exit codes?

@CalculatorFeline 1, 2, and 5 are just "prototypical" examples of each category. I thought about allowing any arbitrary set of three values but it seemed like it would be hard to specify without opening loopholes. W.r.t. exit codes - that sounds fine to me, I just hadn't considered that possibility.

двадцать один собак, is the only way that sounds right to me. Although your way is technically correct, apparantly >_>

Well, if any output set is allowed then I can save 3 bytes.

"Двадцать одна собака" is perfectly fine, and it's the only way you can translate "21 dogs" to Russian (unless you're a lawyer)

@Phoenix That sounds so completely wrong to me - broken Russian - I've always used the form in the question and I find it correct, and apparently it is

@Phoenix From  Wikipedia: "Most numbers ending with "1" (in any gender: оди́н, одна́, одно́) require Nominative singular for a noun: два́дцать одна́ маши́на (21 cars)"

@CalculatorFeline If you start counting from 1, you get singular at 1, few first occurs at 2, many first show up at 5. Makes perfect sense :-)

Counting in Russian is extremely hard. It's perhaps worth noting that the final digit determines the case. 1=Nominative singular 2,3,4=Genitive singular, 5-0 Genitive plural. This changes with the case of the phrase, and as there are 6 cases, there are 24 forms of 'one' (which is masculine), 24 forms of 'two' (which is feminine) and so on. It is said of the professor of Russian in my local university would be unlikely to be able to translate "with 2345 dogs", because 'with' demands the instrumental case (a hard one).

@smirkingman, yep many native speakers do not get it right.

Python 2, 36 bytes
lambda n:'5521'[n%~9/-3>>n/10%~9/-9]

Try it online!
Same length arithmetically:
lambda n:5/(n%~9/-3>>n/10%~9/-9or 1)

Let's first look at simpler code that doesn't account for teens.
lambda n:'5521'[n%~9/-3]

Here, we want a mapping of the one's digit to an output that works like
[5, 1, 2, 2, 2, 5, 5, 5, 5, 5][n%10]

But, rather than take n modulo 10 (%10), we can do n%-10, which maps to the intervals [-9..0] to give remainders:
> [n%~9 for n in range(10)]
[0, -9, -8, -7, -6, -5, -4, -3, -2, -1]

This is promising because the first two entries 0 and -9 are far apart, and they need to be sent to different outputs. Also, -10 can be shortened to ~9.
From here, floor-dividing by /-3 gives chunks of 3 with the right starting spot
> [n%~9/-3 for n in range(10)]
[0, 3, 2, 2, 2, 1, 1, 1, 0, 0]

To get the desired output, we now just need to map 0->5, 1->5, 2->2, 1->1, which we do with the string selection '5521'[_].
Now, we also need numbers ending in 11 to 15 to always give 5. We first do this by detecting whether then tens digit is 1. Taking n/10 to remove the last digit, we then apply %~9 as before to get the outcomes
[0, -9, -8, -7, -6, -5, -4, -3, -2, -1]

for respective final digits. The digit of 1 that we want to detect is mapped to the extremal value -9. Floor-dividing by -9 turns it to 1 and everything else to 0.
> [k%~9/-9 for k in range(10)]
[0, 1, 0, 0, 0, 0, 0, 0, 0, 0]

Finally, we make this indicator being 1 always give output 5. This is done by bit-shifting the result of n%~9/-3 right by the indicator. The result of 0,1,2,3 always bit-shifts right to 0 or 1, which gives an output of 5 as desired.

Please explain.

Python 2, 45 bytes
lambda n,s='5122255555':(s+'5'*10+s*8)[n%100]

Try it online!

o_O i'm blown away... I had 56 bytes :\

Also, isn't (s+'5'*10+s*9) 110 chars?

@CalculatorFeline hmm, time to get a coffee @.@

@Rod or a covfefe?

Perl 5, 26 bytes
25 bytes of code + -p flag.
$_=/1.$|[5-90]$/?5:2-/1$/

Try it online!
For one more byte, there is $_=/(?<!1)[1-4]$/?2-/1$/:5.
Explanations: (on the 27 bytes version; the 26 is quite symmetrical)
Both "singular" and "few" end with "not a 1 followed by a digit from 1 to 4" (tested with (?<!1)[1-4]$/). In those case, the result is 2, minus 1 if the number ends with 1 (2-/1$/). Otherwise, the result if 5.

tfw Perl beats 05AB1E by a fair amount.

JavaScript (ES6), 53 49 48 40 39 38 37 36 bytes
n=>/[05-9]$|1.$/.test(n)?5:1+(n%5>1)

Saved 8 bytes thanks to CalculatorFeline.
Saved 1 byte thanks to ETHproductions.
Saved 1 byte thanks to Johan

Try it

f=
n=>/[05-9]$|1.$/.test(n)?5:1+(n%5>1)
oninput=_=>o.innerText=f(+i.value);o.innerText=f(i.value=0)
<input id=i type=number><pre id=o>

1[1-4] can be 1. and /1$/.test(s) could be +s%10==1. Never forget unary +!

Thanks, @CalculatorFeline - well-spotted on the first one :)

I don't think you need the unary + at all, s%10 should convert s to a number.

Yup, just realised that too, @ETHproductions.

Good to know :)

n%10 -> n%5 saves a byte

Jelly,  19  18 bytes
DµṖṚi1’ȧṪị“M;ọ6’D¤

A monadic link taking and returning non-negative integers.
Try it online! or see the three groups from 0 to 1000 inclusive in this test suite.
How?
DµṖṚi1’ȧṪị“M;ọ6’D¤ - Main link: non-negative number, n  e.g. 301      311      313
D                  - cast to decimal list                [3,0,1]  [3,1,1]  [1,3,3]
 µ                 - monadic chain separation, call that d
  Ṗ                - pop d                               [3,0]      [3,1]    [1,3]
   Ṛ               - reverse                             [0,3]      [1,3]    [3,1]
     1             - literal 1
    i              - first index of (0 if not found)      0          1        2
      ’            - decrement                           -1          0        1
        Ṫ          - tail d                               1          1        3
       ȧ           - logical and                          1          0        3
                 ¤ - nilad followed by link(s) as a nilad:
          “M;ọ6’   -   base 250 literal = 1222555555
                D  -   cast to decimal list [1,2,2,2,5,5,5,5,5,5]
         ị         - index into (1-based and modular)     1          5        2

Explanation please.

@CalculatorFeline still working on golfing...

@CalculatorFeline well I can't find better; explanation added.

In what character encoding those 18 characters can be represented by 18 bytes?

@exebook Jelly uses its own code page

@GamrCorps thanks for fielding

@exebook - yeah the code-page is linked to by the word "bytes" in the header.

05AB1E, 38 19 bytes
Uses the index-trick from Rod's python answer
•1rê¢°•©5T×®9×JIт%è

Try it online!
Explanation
•1rê¢°•              # push the number 5122255555
       ©             # store a copy in register
        5T×          # push 5 repeated 10 times
           ®         # retrieve the first number from register
            9×       # repeat it 9 times
              J      # join everything to string
               Iт%   # push input mod 100
                  è  # use this to index into the string of digits

You're losing to Perl, I think something is wrong here.

@Phoenix: Yeah. Either this challenge is well suited to regex or I'm doing something terribly wrong :) To be fair, Perl is often pretty golfy.

@Enigma ... and Perl golfers are often very good, right? ;-)

@Dada: Very true!

Explanation please.

@CalculatorFeline: There you go!

Those are characters not bytes really?

@exebook: They are bytes in the 05AB1E code page

PHP>=7.1, 44 Bytes
<?=$argn[-2]!=1&($m=($argn+9)%10)<4?2-!$m:5;

Online Version

3 bytes shorter: <?=$argn[-2]!=1&($m=($argn+9)%10)<4?2-!$m:5;.

Retina, 25 21 bytes
1.$
5
T`d`512225
!`.$

Try it online! -4 bytes thanks to Neil.

Save 4 bytes by using !`.$ to extract the last digit. Try it online!

I knew there was a better way!

MCxxxx Assembly, 123 Bytes
e:slx x0
mov x0 acc
dst 2 0
tlt acc 11
-tgt acc 14
-jmp v
+dgt 0
teq acc 1
+mov 1 x1
+jmp e
tlt acc 5
+mov 2 x1
v:-mov 5 x1

Note:
TiO doesn't support this language, which is used in the Zachtronics game Shenzhen I/O, so there's no link to test this.
Explanation:
This is a function that takes input through XBus port x0, and outputs through port x1. It's too long to execute on an MC4000, but fits nicely into the memory of an MC6000. XBus ports, for those unfamiliar, allow the transmission of discrete packets of digital data.
One piece of information that may be helpful in reading this: in MCxxxx assembly, test instructions set a flag that indicates which branch should be taken. Lines that begin with + are only executed if the most recent test returned true, and lines that begin with - are only executed if the test was false.
Line by line:
e:slx x0    # Label this line e, then sleep until input is available on XBus port x0
mov x0 acc  # Move the input into register acc
dst 2 0     # Set the leftmost digit of the input to 0
tlt acc 11  # Test if the value in acc is less than 11
-tgt acc 14 # If it's not, check if it's greater than 14
-jmp v      # If it's not, jump to the line labeled v (the last line)
+dgt 0      # If either of the previous tests returned true,
            #     set acc to the value of acc's rightmost digit
teq acc 1   # Test if acc equals 1
+mov 1 x1   # If it does, return 1
+jmp e      # Then jump to label e, which ends execution
tlt acc 5   # Test if acc is less than 5
+mov 2 x1   # If it is, return 2
v:-mov 5 x1 # If the previous test is false, return 5

A note about scoring: MCxxxx assembly doesn't have functions per se, but this is as close to a function as you can get - it's a program that fits in a single execution node, takes input through one port and outputs through another. As a result, I've scored this like a function (i.e. without counting the bytes necessary to make a valid MCxxxx emulator file).

Haskell, 62 58 bytes
f n|s<-"5122255555"=(s++('5'<$[0..9])++cycle s)!!mod n 100

Try it online!
Explanation
This builds the following string:
5122255555555555555551222555555122255555512225555551222555555122255555512225555551222555555122255555...
Which is a table where cell n contains the answer for the nth number. The table is only correct for the first 100 elements, hence the mod.

Can you explain what is going on here? You could surely shorten it using f n|s<-"5122255555"=(s++('5'<$[0..9])++cycle s)!!mod n 100

I didn't know that was possible!

There are a lot more tips and tricks in https://codegolf.stackexchange.com/questions/19255/tips-for-golfing-in-haskell really worth reading=)

Turtlèd, 35 bytes
!--.(1#0#)+.@3(1@1)(2@2)(3@2)(4@2),

Try it online!
This function requires that the input starts with a >, which I guess is ok because python2 uses input semi regularly, and that needs quotes.
Explanation:
!             input the number as a string, complete with the >
 --.          wrap around to the end of the string, and then move one back. if this
              is a single digit, we end up on the >,
              otherwise we end up on the second to last digit. write the digit/>

    (1#0#)    if it is 1, set the string to 0. this way it will always write 3 at the end.

          +.       write the last digit (or 0 if the second last digit was 1)
            @3      set the character variable to 3. this means if what was written was not
                       in (1, 2, 3, 4), then it will write 3 at the end
              (1@1)    if the character written was a 1, set the character to be written
                       at the end to 1
                   (2@2)(3@2)(4@2)
                     if it is any of 2,3,4, set the character to be written at the end to 2
                                  ,    write the character that was set

Does > serve a purpose in Turtled or is it an arbitrary character you've added to the input?

Scala, 110 bytes
n=>Stream.iterate("512225555555555555555")(_=>"1222555555").flatMap(_.toCharArray).map(_.toInt).take(n-1).head

Lexurgy, 88 bytes
s:
\1=>\1/_ $//\1 _ $
else:
{\2,\3,\4}=>\2/_//\1 _ $
else:
[]=>\5
c:
[]=>*/_//_ $

Ungolfed explanation:
singular: # 1 to 1 if no 1 preceding 1
\1=>\1/_ $//\1 _ $
else:     # 2,3,4 to 2 if no preceding 1
{\2,\3,\4}=>\2/_ $//\1 _ $
else:     # everything else to 5
[]=>\5/_ $

clean:    # keep only the last digit
[]=>*/_//_ $

Trivia: the technical linguistics terms for one, few, many is singular, paucal, plural.

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

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


text:
Generate a Texting Dictionary
this challenge was based on a sandboxed post by @dmckee
Old fashioned cell phones were and are used heavily as texting platforms, unfortunately the keyboard has only 12 + a few buttons, and is therefor ill-suited to naive text entry.
Common solutions make use of the traditional telephone coding (generally with a modest extension for 'q' and 'z'):
2: a,b,c
3: d,e,f
4: g,h,i
5: j,k,l
6: m,n,o
7: p(,q),r,s
8: t,u,v
9: w,x,y(,z)

In this case we are interested in the one-press-per-letter schemes that offer up words matching words on a frequency basis. That is if the user type "4663" the phone will offer up words like "good", "home", "gone", "hood", "hoof", etc that code to 4663 in order of their frequency.
Your task is to read one or more input files and generate a frequency sorted dictionary that could be used to implement this scheme.
Inputs

All input will be plain ASCII text.
You may accept input from named files, the standard input, or other conventional source supported by your implementation language, but there must be some mechanism to process several files in a single run.
Non-letter, non-whitespace characters should be stripped from the input, this means that contractions will be coded without their apostrophe: "don't" --> "dont" --> 3668
Words are a sequence of letters separated surrounded by whitespace
All whitespace (space, tab, newline, beginning-of-file, end-of-file) is equivalent.
Input will be all lowercase or caps your preference.

Output

The output consists of a ASCII text stream
You may direct this to a file, the standard output, or any other conventional destination supported by your implementation language
The output should consist of one line for each string of digits corresponding to at least one word in the input.
Each line should consist of the digit string and a list of all corresponding words sorted by frequency with the most frequent coming first. A sample line of output would be
4663 good home gone hood hoof

Tokens (digit strings and corresponding words) should be separated by a single space.
Equally frequent words may be sorted in any order.

The winner is the shortest code.
Test Cases
potato, potato, damd, fjefje, djfaejri

Top 1000 words used.

The potato was a down goat goat down game gill pont pint point.

More actual test cases will be given in about a week to prevent any sort of hard-coding action.

What should functionality be when there is nothing of the correct length in the input file(s)?

@StephenS you can bug out.

in the bigO notation, O(n) = O(2n)

@FelipeNardiBatista oh yeah :P I am really bad at bigO stuff

@Christopher you should add O(1), O(logN) and O(N*logN). the order would be O(1), O(logN), O(N), O(N*logN) and O(N^2)

Can you provide a better explanation of "Big O"? I'm left wondering how you accurately measure efficiency across different languages and machines.

@Shaggy Well the Big O is the same everywhere, It is the rate of time as the input (n) gets bigger

"Top 1000 words will be used with each word repeated x times based on the position on the list (word one is put 1000 times two is 999... ect [sic])." is this regarding the test case or the input file, and what does it mean exactly?

by All whitespace is equivalent do you mean that we have to support all whitespace as separators or only what we choose?

@JonathanAllan that is a test case. You would get word one 1000 times word two 999 times, word three 998 times...

@dzaima all whitespace

There seems to be 2 parts to this challenge. (1) read in a dictionary and organize the words by frequency (2) apply this dictionary to an input of digits. It's not clear to me how you have divided these tasks in the challenge. "Your task is to ... generate a frequency sorted dictionary" but the test case involves potato twice and 3 non-words. Wut??!

"You would get word one 1000 times word two 999 times, word three 998 times" what's the point of that? Not at all clear to me what you want us to do here.

@Octopus why are they divided? They are one task

Competing by big O doesn't make sense here. The output is exponentially long in the worst case.

@xnor done with it

I would suggest that you focus on writing your own challenges... This taking old challenges and posting isn't working out: there's a reason why they were left derelict for ages

@Christopher I wouldn't say its about rep, but more about reducing the number of low quality questions on PPCG

@beta is this low quality?

@Christopher I'm not sure

Your test cases include capitalized words, like The. What to do with it ?

@Setop umm they are different iirc

Your test cases should show the expected output

@mbomb007 good point, I uhh didn't know how to do this problem so i checked and the pearl problem gets them right

Jelly, 42 41 bytes
>”q+91N+O:3«9µ€Ḍ’0x
ċ@Þ³ṚQµÇ€⁸ṭ"Zḟ€0Ėṛ/Ðf

Try it online!
Monadic link take a list of strings as argument.
The footer is for formatting the output to a form suitable for outputting. Without it, the monadic link returns:
[[3, ["d", "f", "e"]], [4628, ["goav", "goat"]], [6346, ["mego", "mdim"]]]

(that is, a list, each has the format [number, list of words]).
The "Zḟ€0 idea was taken from this answer.

Explanation:
The first link, which given a string and output its telephone number, is mostly a port from my Python answer.
>”q+91N+O:3«9µ€Ḍ’0x     Link.
                        Implicit input, call it (st).
             µ€         Monadic link map for each character (ch):
>”q                     Larger than character 'q'? If yes, get 1, else get 0.
   +91N                 add 91, and then negate. Current value = -((ch>'q')+91)
       +O               Add the ord (ASCII value) of ch. Get ch-(ch>'q')-91.
         :3             Integer division by 3.
           «9           If the result is larger than 9, set it to 9. (« : min)
                        With the list of digits obtained by
                        mapping the previous chain to characters:
               Ḍ        Convert from decimal digits to number.
                ’       Decrement.
                 0x     Repeat that many digits of zero.

Then, the second link:
  Þ                         Sort by...
ċ@                            count. (frequency)
   ³                        I have no idea what is this used for.
    Ṛ                       Reverse. (so that words with max count appear first)
     Q                      Unique.
      µ                     With that value,
       Ç                    Map the previous link over this word list.
         ṭ"                 Vectorize tack with...
        ⁸                     the word list.
           Z                Zip (transpose).
            ḟ€0             Filter out 0 from each element.
               Ė            Enumerate.
                  Ðf        Filter, keep elements with truthy...
                ṛ/            last element.

Mathematica, 202 bytes
{g[#],##}~r~" "&@@@GatherBy[#&@@@SortBy[Tally@StringReplace[StringSplit@#,x_/;!LetterQ@x->""],-Last@#&],g=""<>ToString/@(\[LeftFloor]If[#<113,(#-91)/3,(#-88.2)/3.4]\[RightFloor]&/@ToCharacterCode@#)&]~(r=Riffle)~"
"<>""&

Note that \[LeftFloor] and \[RightFloor] are 3 bytes each.

Well since nobody answered besides you :/

C++, 566 533 bytes
-33 bytes thanks to Zacharý ( about 20 bytes ) and user202729 ( about 12 bytes )
#include<map>
#include<string>
#include<fstream>
#include<regex>
#include<set>
using namespace std;using s=string;struct z{s d;int f;int operator<(z a)const{return f<=a.f&&d<a.d;}};regex r("[^a-z]");void g(){fstream e("a"),o("d",ios::out);map<s,int>m;while(!e.eof()){s t;e>>t;t=regex_replace(t,r,"");++m[t];}map<s,set<z>>t;for(auto a:m){s k;for(auto c:a.first)k+="22233344455566677778889999"[c-97];t[k].insert({a.first,a.second});}for(auto&a:t){o<<'\n'<<a.first<<' ';for(auto m=a.second.rbegin();m!=a.second.rend();++m)o<<m->d<<' ';}}

Uses a set to ensure that the words in the z struct are ordered, so a reverse iterator loop can be done.

If you are using g++ you can use import and bits/stdc++.h.

Also I think s("...")[k-97] can be replaced by "..."[k-97] (indexing a char[] also works); and there is a redundant space. / Why is const z& necessary? Just z is enough (although the performance would be bad)

You don't need a a space here: return (f<=a.f&&d<a.d);=>return(f<=a.f&&d<a.d);

Also, using namespace std should save a few bytes if you get rid of all the std::s

@user202729 I use MSVC++. For the const required, see this answer. I can change it to a non constant value parameter though.

Looks like you can use int instead of bool in operator<. Also probably this will work...

Using #define B a.second should save some bytes.

Clean, 245 ... 214 210 bytes
import StdEnv
r=removeDup
$s=toString[48+min((toInt c-91-toInt c/113)/3)9\\c<-:s]
?f=foldr(\s-> \l=[(a+if(s==b)1 0,b)\\(a,b)<-l])(zip([0,0..],r f))f
@f=r[(s,reverse(map snd(sort(?[l\\l<-f| $l==s]))))\\s<-map$f]

Try it online!

Perl 5, 123 bytes + 1 (-a) = 124 bytes
y/A-Z//dc&$k{y/A-Z/22233344455566677778889999/r}{$_}++for@F}{$,=$";say$_,sort{$k{$_}{$b}-$k{$_}{$a}}keys%{$k{$_}}for keys%k

Try it online!
Takes input as uppercase.

Röda, 218 bytes
{g={|n|chars n|[("2223334445556667777888999"/"")[ord(_)-97]]|concat}m=new map
replace`[^\w\s]|_`,""|(_/`\s+`)|sort|count|m[g(_)]+=[-_,_1]if m[g(_1)]=[]unless[m[g(_1)]?]
keys m|sort|{|k|[k];m[k]|sort|_|[` $_2`];[`
`]}_}

Try it online!

Java 8, 480 + 19 = 499 bytes
A Runnable lambda. Byte count includes lambda and required import. Input and output are as specified through standard in/out. Input is in all lowercase. Dictionary items are not printed in any particular order.
import java.util.*;

()->{Map<String,Integer>f=new HashMap();new Scanner(System.in).useDelimiter("\\s+").forEachRemaining(n->f.put(n=n.replaceAll("[^a-z]",""),f.getOrDefault(n,0)+1));Map<String,Set>n=new HashMap();f.forEach((k,v)->{String c=k;for(int i=0;i<8;)c=c.replaceAll("["+"abc def ghi jkl mno pqrs tuv wxyz".split(" ")[i]+"]",++i+1+"");n.putIfAbsent(c,new HashSet());n.get(c).add(k);});n.forEach((k,v)->System.out.println(v.stream().sorted((y,z)->f.get(z)-f.get(y)).reduce(k,(y,z)->y+" "+z)));}

Try It Online
Ungolfed lambda
() -> {
    Map<String, Integer> f = new HashMap();
    new Scanner(System.in)
        .useDelimiter("\\s+")
        .forEachRemaining(
            n -> f.put(
                n = n.replaceAll("[^a-z]", ""),
                f.getOrDefault(n, 0) + 1
            )
        )
    ;

    Map<String, Set> n = new HashMap();
    f.forEach((k, v) -> {
        String c = k;
        for (int i = 0; i < 8;)
            c = c.replaceAll(
                "[" + "abc def ghi jkl mno pqrs tuv wxyz".split(" ")[i] + "]",
                ++i + 1 + ""
            );
        n.putIfAbsent(c, new HashSet());
        n.get(c).add(k);
    });

    n.forEach((k, v) ->
        System.out.println(
            v.stream()
                .sorted((y, z) -> f.get(z) - f.get(y))
                .reduce(k, (y, z) -> y + " " + z)
        )
    );
}

f is my frequency map, and n collects words based on their numeric encoding. As usual with programs this long, this is probably far from optimal. Improvements are welcome.
I could have replaced ++i+1+"" in the number encoding step with ""+-~++i for the same number of bytes. But I respect you all too much to do that.

this does not handle uppercase or capitalized words

@Setop Taking just uppercase or just lowercase was allowed in the challenge specification.

PHP, 273 bytes
<?$f=str_split;$w=explode(" ",preg_replace(['/\s+/','/[^a-z ]/is'],[' ',''],$argv[1]));$l=$f('22233344455566677778889999');foreach($w as$x){$z='';foreach($f($x)as$y){$z.=$l[ord($y)-97];}$a[$z][$x]++;}foreach($a as$n=>$b){arsort($b);echo$n." ".join(" ",array_keys($b))."
";}

Try it online!

Python 3, 179 156 155 bytes
Thanks Rod for -23 bytes!
Thanks anonymous user suggestion for -1 byte!
def f(l):
	d={}
	for w in l:k=(*[min(27,ord(x)-91-(x>'q'))//3for x in w],);d[k]=k in d and{w}|d[k]or{w}
	for k in d:print(k,sorted(d[k],key=l.count)[::-1])

Try it online!

what is the purpose of min(27,...) ?

@Setop Otherwise z will become 10, not 9.

Based on your solution, I had a try with defaultdict(Counter). I expected to save some bytes by avoiding count, but ended up spending a lot of bytes printing the result.