[Question]
  [
Your task is to write a non-empty computer program comprised of some sequence of bytes. If we choose a particular byte in the program and remove all instances of it from the program, the modified program should output the removed byte.
For example if our program were
```
aabacba
```
Then `bcb` would output `a`, `aaaca` would need to output `b` and `aababa` would output `c`.
It does not matter what the unmodified program does.
Answers will be scored in bytes with the goal being to minimize the number of bytes.
  
[Answer]
## zsh, ~~603~~ ~~594~~ ~~566~~ ~~561~~ ~~548~~ ~~440~~ ~~415~~ ~~399~~ ~~378~~ 370 bytes
```
ec
ho \\n;ca t<<<$'\x20';exi t
d$c -e8BC6P
d0c -eKp
$'\172\163\150' $'\055\143' $'\146\157\162 v \151\156 \173\043\056\056\134\175\175\073\173 \146\147\162\145\160 \055\161 $\166 '$0$'\174\174\074\074\074$\166\073\175'
$'\145v\141\154' $':\073\072\046\046\145\170\151\164';#%&()*+,/9=>?@ADEFGHIJLMNOQRSTUVWXYZ[]^_`jklmsuwy
0# $#;for b in {$..z};{ fgrep -q $b $0||<<<$b;}
```
Depends on coreutils + `dc`.
[Try it online!](https://tio.run/##TVFpc9MwFPyuX7GTiIgrjpzIDmDXLZSj3PdZF0hsuUlJ5dR2g0ma3x6eFShoZp9W2nfsSMtysklGFaLxqNTOspwgDIXOM7HRCZvkiGMTJCNUYRhyEdd9KQJdT1GxlCfo6lv39v1XLJUNfzpnlOIO@7HrD2LXkwJ0lp4Xu2pguat8uh@S3scCRF2CT2Q4iKUieL6FO1B051lI0kjHtljZYtpJ9CW23X0XnKIPwaV1oCzkP1j5TytPWJvKW1BoDKjG2x2rSjIvaY60sxoDcuvSVyJoX@lcvXb9xs3e7Z1od@/u/QcPHx08fvLs@YuXr9@8fff@w8dPn78cHn399v3kx@y0PP/5i8k2eDvI8gJjTA1W3HGW62CF7LjQc3TPwMfg8uKiedxxsN7QuzPWpNdNuoiNwEpAOI5YizVLcwZaOqFv6Rq0Cn2aL6bmGIe8PsJOhJbVqwLdFC1etxBefmpU6bJqmE1Jp1mGS@2vhKiX6kXPnM9m6HS2c4TJK8wLXWpTNZ6SPNXC9vi/kqwZvfkN)
That was... a journey.
This answer has three parts. The first 4 lines handle certain special cases to simplify the code that follows. The next 2 lines and the last line both accomplish essentially the same thing, but exactly one is run with any given character removal. They are written with mostly complementary character sets, so that removing any character breaks only one at most, allowing the other to continue to function.
Looking at the first part, we first handle
* newline removal with `ec\nho \\n`
* space removal with `ca t<<<$'\x20'` (followed by `exi t` to avoid running later code, which would result in extraneous output)
* `$` removal with `d$c -e8BC6P` (`8BC6` = `9226` is `36*256 + 10`, and 36 and 10 are the byte values of the `$` and newline characters respectively; we use hex digits in decimal to avoid having to include them in the large comment in line 6)
* `0` removal with `d0c -eKp` (`K` gets the decimal precision, which is `0` by default)
In the next part, the only characters used (aside from the garbage at the end of the second line) are `$'\01234567v;`, space, and newline. Of these, four have been accounted for, so the remainder (`'\1234567v`) cannot occur in the last line. Expanding the octal escapes (`$'\123'` represents the ASCII character with value 1238), we get:
```
zsh -c 'for v in {#..\}};{ fgrep -q $v '$0'||<<<$v;}'
eval ':;:&&exit'
```
The first line loops through all characters used in the program and searches for each one in its own source code (`$0` is the filename of the script being run), printing any character that is not found.
The second line looks a little strange, and appears to do the same thing as `exit` with a bunch of nops. However, encoding `exit` as octal directly results in `$'\145\170\151\164'`, which does not contain `2` or `3`. We actually need to make this *less* resilient to removals. This is because if any of `'\014567v` are removed, breaking the first line, the second line also breaks, allowing the remainder of the code to execute. However, we need it to also break if `2` or `3` are removed so that lines 3 and 4 can run. This is accomplished by shoehorning in `:` and `;`, which have a 2 and 3 in their octal representation respectively.
The junk at the end of line 2 is simply there to ensure every printable ASCII character appears at least once, as the way the checking is done by looping through each one requires this.
If `exit` was not called in the first section (i.e. it was mangled by the removal of one of `'\01234567v`), we move on to the second, in which we must accomplish the same thing without using any of these characters. The last line is similar to the decoded first line, except that we can contract the range of the loop to save a few bytes, because we already know that all characters except for `'\01234567v` have been covered. It also has `0# $#` before it, which comments it out and prevents it from producing extraneous output if `0` or `$` were removed.
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), 1 byte
```
1
```
[Try it online!](https://tio.run/##K0otycxLNPz/H4gA "Retina – Try It Online")
When all instances of the single byte (`1`) are removed, the output is `1`. Simple enough.
[Answer]
## Lenguage, 216173027061157310 bytes
`216173027061157310 = (144115617572598740 + 144115241762960340 + 144115194786755540) / 2`. There are `216173027061157310 - 144115617572598740` `$`s, `216173027061157310 - 144115241762960340` `#`s and `216173027061157310 - 144115194786755540` spaces.
The 144115617572598740 `#`s and spaces encode the following BF program:
```
++++++[>++++++<-]>.
```
[Try it online!](https://tio.run/##SypKzMxLK03O/v9fGwyi7SC0jW6snd7//wA)
The 144115241762960340 `$`s and spaces encode the following BF program:
```
+++++++[>+++++<-]>.
```
[Try it online!](https://tio.run/##SypKzMxLK03O/v9fGwKi7cCUjW6snd7//wA)
The 144115194786755540 `$`s and `#`s encode the following BF program:
```
++++++++[>++++<-]>.
```
[Try it online!](https://tio.run/##SypKzMxLK03O/v9fGwqi7UCkjW6snd7//wA)
Edit: Saved 72057832274401770 bytes thanks to @Nitrodon.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 1 byte
```
0
```
Completely different from the Retina answer. *whistles*
[Try it online!](https://tio.run/##y0rNyan8/9/g/38A "Jelly – Try It Online")
[Answer]
# Polyglot\*, 1 byte ([awaiting confirmation](https://codegolf.stackexchange.com/questions/171789))
```
0
```
[Try it online!](https://tio.run/##KynKTMxLL81JLMosqfz/3@D/fwA "Triangularity – Try It Online") (using Triangularity)
\*: This works in a (rather wide) variety of languages (except for esolangs like 4, ><> and the like and some other exceptions). Identical to [the Jelly answer](https://codegolf.stackexchange.com/a/171797/59487) in source code, but the method of I/O is different – Output is via exit code. When one removes `0` from the source code, they're left with an empty program, which often doesn't error and yields exit code **0** in the majority of languages.
[Answer]
# [sed](https://www.gnu.org/software/sed/), 1 byte
```
```
[Try it online!](https://tio.run/##K05N0U3PK/3/n@v/fwA "sed – Try It Online")
Completely different from the Retina answer, or the Jelly answer.
[Answer]
# [Unary](https://esolangs.org/wiki/Unary) (non-competitive), 96 bytes
```
00000000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000050: 0000 0000 0101 0101 0101 0101 0101 0101  ................
```
Here is [`xxd`](https://linux.die.net/man/1/xxd) dump.
A wider definition of Unary language allows any characters in its source code. But I havn't find a compiler or interpreter which would work for this. So I marked this answer as non-competitive. If you can find one which posted before this question asked, I will link to it.
[Answer]
# [Gol><>](https://github.com/Sp3000/Golfish), 143 bytes
```
<\Hs+:+:PPPs\
\sM:+:+H
HP+:+:PPPs++\
HsssssssM+++\
;HssssMMMMM++\
;o+:+:PPs++\
+:+:P+:PPP\H+P:P+:
ssssMMMMMM\H
sHsssMMMMM+\
Hsssss+++\
HMMMMMMs
```
[Try it online!](https://tio.run/##PYzLCcAwDEPvXsUbtB1AF4MH8LkfKOSg/XEbh0QnSTzpau/58M48AtRNN3dnSNB@rxD4LFVDwCHTnvaK1lWxDbTIsjUMqHcrC7aAEGs6b@sTg2DmBw "Gol><> – Try It Online")
This contains the characters `<\Hs+:PM;o` and newline
* `<` [Try it online!](https://tio.run/##PYy7CQAxDEN7r@INcguoMXgA1/eBgxTaH9/FIVEliSdd/T0f3pkBatPm7gwJ2u8VAl@lagg4ZTrSUdGGKvaJFlm2hgH1YWXDFhBiT9dtfWISzPwA "Gol><> – Try It Online")
* `\` [Try it online!](https://tio.run/##PYzLDcAwCEPvrMIGaQfwBYkp@pEq5eD9RUNo45Mf2D77c9y8InZQmzZ3p9CGUwj8P6kKWDIdsE2yVFKvXMammyWop5OVNAixat9grqHejHgB "Gol><> – Try It Online")
* `H` [Try it online!](https://tio.run/##RYzLDcAwCEPvrOIN0q4QiQE49yNVysH7ixRQWp@ejfE5nuPm5b4b0dBUlSbG/jJEVwSYsNQRZksMpRtVzF5ivhk0SL5ut5/XYs7Vle4T "Gol><> – Try It Online")
* `s` [Try it online!](https://tio.run/##LYy7DcBACEN7VvEGlwzgBokBqPORIl2R/UUOiBueAL9zPsf9XhG7EwPDzFxcF4FC@1eACxU5NmqmcPY5uajrhCVK/akvTTeWAi2qRHw "Gol><> – Try It Online")
* `+` [Try it online!](https://tio.run/##RYw9DoBQCIN3joQegIWEA3T2JzF5Q@8fBF/ULgX6lX1c28kjc4VRNSIIAV3VxOI9GKccsjyzt2oZTRRQ1iiqEiof4TCh/fz8Uz5TZt4 "Gol><> – Try It Online")
* `:` [Try it online!](https://tio.run/##PYy7DQAxCEN7VmGEuwHcRGIA6vtIJ6Xw/iKE6OICYXj23b/r5RNxOqhqZnRxNlUIbB1UXcClfKQ7yrapsn2CxeUyM46cKptqDiF25u@rMiyCEQM "Gol><> – Try It Online")
* `P` [Try it online!](https://tio.run/##PYzLDcAwDELvXoUN0g7AxRv43I9UKQf2l9s4ajgBenD257h1Ze5BoaEpLOSfAY1VAGHUlGOkraIPVeyLGwYtamgL8qCJa/Lf1RcnocwX "Gol><> – Try It Online")
* `M` [Try it online!](https://tio.run/##PYy7DcBADEJ7r8IGlwxA6QFc5yNFusL7yznbSqgeCDjnc9x@RexGx8BQVTcxXwgK9csAE3oLaTY2LppdKlNYEyM0UbJnFM/B/4I@jHgB "Gol><> – Try It Online")
* `;` [Try it online!](https://tio.run/##PYy7CQAxDEN7r@INwg2gxuABXN8HDlJof3yXmESVJJ509fd8eGceAWrT5u4MCdrvFQJfpWoIWDLdyYZG6gVObto5C6gPK5u1gBB7uU7rsQhmfg "Gol><> – Try It Online")
* `o` [Try it online!](https://tio.run/##PYzLCcAwDEPvXkUbpB1AF4MH8LkfKPTg/XEbh0QnSTzpfJ/jjitzdwYampmFi4f@HhTaLAEXxpCip62idlUcZIFla@eEdSuLVacE13K@1iUHEZkf "Gol><> – Try It Online")
* Newline [Try it online!](https://tio.run/##PUy5DcAwCBzoNnAyAA0SA1DnkSK5YH8RnsRX3X/O57jtct@VDANDREzVOCiI5LeAyBuMEFspTqSa3ctasRopQZKuJscHrdl3mG/Usbm/ "Gol><> – Try It Online")
I wanted to solve this in a 2D language, but most 2D languages are ruled out from this challenge. Gol><> works because of the large number of operations including operations with overlapping functionality, this ensures that we can write a meaningful program with any 1 character banned.
We use the standard [radiation-hardening](/questions/tagged/radiation-hardening "show questions tagged 'radiation-hardening'") technique for 2D languages here. The removal of characters causes the length of a line to change which creates a new alignment and sends the pointer down a new path untouched by the radiation.
Each character gets its own line of the program and which line is run is triggered by the removal. We could possibly choose a smaller character set to work with `<\Ho;P1+` and newline should work, however the lines would be very long making this overall more costly.
]