g | x | w | all
Bytes Lang Time Link
049JavaScript Node.js250228T165007ZFhuvi
047Java JDK250402T114702ZFhuvi
064JavaScript ES6170717T112134ZArnauld
010Uiua240709T201357Znoodle p
080AWK241105T203359Zxrs
004iogii241028T013850ZUnrelate
048sed240709T211259Zguest430
026Zsh240702T115249Zroblogic
025Julia 1.0240706T145154ZMarcMush
076Python 2170717T144418ZLangeHaa
031Perl 5 + M5.10.0 F170717T120136ZDom Hast
039Brainfuck240630T121949Zjan
009Uiua SBCS240630T041556Zchunes
045R240629T205215ZGlory2Uk
021Arturo230626T022353Zchunes
018J230626T060623Zsouth
036PowerShell Core230626T020759ZJulian
003Thunno 2 BM230624T191054ZThe Thon
029Factor + math.unicode230312T155526Zchunes
005Vyxal g230312T115454ZThe Thon
007MATL170717T115015ZSuever
062Python 3210224T235054Zmovatica
013k170717T140339Zzgrep
003Husk201106T161538ZDominic
006Jelly201106T160113Zcaird co
006Japt h201106T153758ZShaggy
089Clojure170719T090100ZJoshua
001const missed=ar=>String.fromCharCodear.reducea170722T152710ZJSwindin
0998th170721T090711ZChaos Ma
030J170721T225145ZRichard
040Python 3170717T080255Ztotallyh
046C# .NET Core170717T080549ZCharlie
012><>170719T142742ZTeal pel
086C++14170718T140919Zsehe
011x86 Machine Code170719T134601ZCody Gra
032Octave170718T145232ZGiuseppe
006Husk170718T081015ZLeo
124SWI Prolog170718T073046ZJan Droz
067R170717T183434ZMax Mikh
092Python 3170717T173306ZAncientS
045BrainFlak170717T162703ZDJMcMayh
067CJam170717T105336ZIlmari K
025Retina170717T105251ZNeil
044PHP170717T142741ZTitus
056Rexx Regina170717T083003Ztheblitz
014Japt170717T140927ZOliver
nanExcel170717T134248ZEngineer
042Python 3170717T124931ZFelipe N
046Mathematica170717T083801ZZaMoC
00505AB1E170717T124259ZAdnan
063Scala170717T123137ZV. Court
nanC gcc170717T101652ZKeyu Gan
046Java 8170717T092351ZKevin Cr
043PHP170717T115226Zuser6395
017APL Dyalog170717T113104ZAdá
00705AB1E170717T074940ZErik the
069Python 2170717T101847Zmdahmoun
046PHP>=7.1170717T102707ZJör
070JavaScript ES6170717T092751Zedc65
088Common Lisp170717T100540ZRenzo
021Ruby170717T093946Zmanatwor
125ES6170717T083530ZJonas Wi
020J170717T092740ZJonah
104C#170717T085700ZTheLetha
030Haskell170717T081019ZAnders K
083Mathematica170717T082603ZZaMoC
010Alice170717T075539ZMartin E
005Pyth170717T075455ZLeaky Nu
007Jelly170717T074426ZLeaky Nu
018Charcoal170717T074519ZNeil

JavaScript (Node.js), 49 56 bytes

This answer is an improved Node.js port of this answer, published with the courtesy of edc65.

(s,p,b=Buffer)=>b(s).some(c=>p+1<(p=c-1))&&b([p])

Try it online!


Alternative answer : 53 bytes

s=>(Buffer(s).map((b,i,a)=>a[i+1]-++b?b:9)+"").trim()

Try it online!

Input is a string.

We identify the character having more than 1 in difference (between ASCII codes) with its successor, and replace it with its value +1.

We replace every other character with a Horizontal Tab (ASCII code 9), then we convert the Buffer back into a string and we trim every whitespace character, which leaves only the wanted character alone.


Alternative answer, storing the previous value +1 : 53 bytes

s=>(Buffer(s).map(b=>b+~a?(a=b+1,9):a,a=1)+"").trim()

Try it online!

Java (JDK), 47 bytes

Not the shortest Java answer, but using Streams as an alternative solution.

s->(char)s.chars().reduce(1,(a,b)->b%a<1?b+1:a)

Try it online!


We identify the character having more than 1 in difference (between ASCII codes) with its predecessor (excluding the first char).

JavaScript (ES6), 64 bytes

Or 53 bytes in Node.js, as suggested by Fhuvi.

Takes input as a string.

s=>(g=p=>(c=String.fromCharCode(n++))<s[p]?p?c:g(p):g(p+1))(n=0)

Try it online!

How?

Uiua, 10 bytes

▽¬⤚˜∊+⊢⟜°⊏

Try it: Uiua pad

Keep non-members of the input in the first character of the input added to each number from zero to the length of the input.

AWK, -vFPAT="[[:alpha:]]" 80 bytes

@load "ordchr";{for(;i++<NF-1;)printf ord($i)+1!=ord($(i+1))?chr(ord($i)+1)x:""}

Try it online!

iogii, 4 bytes

;)xh

😉

;       Dup the input on top of itself
 )      incremented.
  x     Remove original characters from the incremented list,
   h    then keep only the first remaining.

sed, 53 48 bytes

-5 bytes from @roblogic

s/(.).*(.)/echo & {\1..\2}|rs 0 1|sort|uniq -u/e

Try it online!

this... ended up being almost entirely an 'exec' statement. I guess that means I should just call it

Bash, 57 46 bytes

-11 bypes from @roblogic

eval echo $@ {$1..${@:$#}}|rs 0 1|sort|uniq -u

Try it online!

Zsh, 30 26 bytes

b=({$1..$_});<<<${b:|argv}

Try it online!  30bytes

The ${b:|a} array substitution removes matched elements, leaving only the unique elements of array b

Julia 1.0, 25 bytes

!a=setdiff(a[1]:a[end],a)

Try it online!

Python 2 - 76 bytes

Loses to existing Python 2 solution but it's a slightly different approach so I thought I'd post it anyway:

lambda c:[chr(x)for x in range(ord(c[0]),ord(c[0]+26)if chr(x)not in c][0]

Perl 5 + -M5.10.0 -F, 31 bytes

28 bytes code + 3 for -F

say grep"@F"!~$_,$F[0]..chop

Try it online!

Explanation

Creates a list of first character ($F[0] as @F is automatically set to the input, $_, split) to last character (chop, which works on $_ by default) and strips out any items that exist in the source string.

Brainfuck, 39 bytes

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

Try it here!

, a
>+[- unset bit
    <[->+<] add a into bit space
    ,[->->+<<] take b and sub into bit space and move into 3rd cell 
    the bit is now minus 1 if continue and minus 2 if end
    >>[-<<+>>]< move clone back
    ++ end if inconsistency
]
<-.

Uiua SBCS, 9 bytes

⊢▽¬⊃∊∘⊸+1

Try it!

⊃∊∘ can be replaced with ⤚∊ for -1 byte once comes out of experimental.

Explanation

⊢▽¬⊃∊∘⊸+1­⁡​‎⁠‎⁡⁠⁢⁤‏⁠‎⁡⁠⁣⁡‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢‏‏​⁡⁠⁡‌⁢⁢​‎‎⁡⁠⁡‏‏​⁡⁠⁡‌­
       +1  # ‎⁡increment input
      ⊸    # ‎⁢keeping original input underneath
   ⊃∊∘     # ‎⁣membership mask, keeping incremented input underneath
  ¬        # ‎⁤invert mask
 ▽         # ‎⁢⁡keep
⊢          # ‎⁢⁢first

R, 45 bytes

\(s,L=intToUtf8(9:122,T))L[!!diff(L%in%s)][3]

Attempt This Online!

L is a vector of the characters containing the upper- and lowercase letters. With L%in%s a vector of TRUE/FALSE values is obtained and then diff reveals the positions where TRUE and FALSE adjacent. The 3rd index corresponds to the missing letter.

Arturo, 21 bytes

$->s[--@s\0..last<=s]

Try it!

$->s[            ; a function taking an argument s
    <=s          ; duplicate s
    last         ; last letter in s
    ..           ; range
    s\0          ; first letter in s
    @            ; reify range
    --           ; set difference (between the range and duplicated s)
]                ; end function

J, 18 bytes

{.@(>:-.])&.(3&u:)

Same approach as many others.

Try it online!

{.@(>:-.])&.(3&u:)
            (3&u:)  NB. convert to char codes
    >:              NB. increment
        ]           NB. input
      -.            NB. set difference
  @                 NB. then
{.                  NB. take the head
          &.        NB. lastly, perform the inverse of 3&u:, which converts back to char

PowerShell Core, 36 bytes

param($a)$a[0]..$a[-1]|?{$_-notin$a}

Try it online!

Takes the chars as an array of strings

$a[0]..$a[-1]  # creates a range from the first to the last character in the argument
|?{$_-notin$a} # keeps only the character that is not in the argument

Thunno 2 BM, 3 bytes

⁺$ṗ

Attempt This Online!

Port of my Vyxal answer.

Explanation

⁺$ṗ  # Implicit input, converted to ordinals by B flag
⁺    # Increment each ordinal in the list
 $   # Push the input (as an ordinal list) again
  ṗ  # Set difference between the incremented and original lists
     # Implicit output of minimum ordinal as a character

Factor + math.unicode, 29 bytes

[ dup minmax [a,b] swap ∖ ]

Try it online!

Vyxal g, 5 bytes

C›C?F

Try it Online!

Explanation

C›C?F  # Implicit input
C      # Convert to charcodes
 ›     # Increment
  C    # Convert from charcodes
   ?F  # Remove elements which are in the input
       # g flag gets minimum (first) element

MATL, 8 7 bytes

1 byte saved thanks to @Luis

tdqf)Qc

Try it at MATL Online

Explanation

      % Implicitly grab the input as a string
t     % Duplicate the string
d     % Compute the differences between successive characters
q     % Subtract 1 from each element
f     % Get the locations of all non-zero characters (1-based index)
)     % Extract that character from the string
Q     % Add one to get the next character (the missing one)
c     % Convert to character and display

Python 3, 62 bytes

Outgolfed, but has a clean string interface :)

def f(s,i=0):a=chr(ord(s[0])+i);return a==s[i]and f(s,i+1)or a

Try it online!

k, 17 13 bytes

-4 bytes thanks to coltim.

{*(`c$1+x)^x}

Try it online!

Explanation:

{           } /def func(x): # x should be a list of chars
      1+x     /  above  = [ord(c)+1 for c in x]
  (`c$   )    /  above  = [chr(i) for i in above]
          ^x  /  result = [e for e in above if e not in x]
 *            /  return result[0]

Husk, 3 bytes

-¹…

Try it online!

I'm slightly nervous about posting this, as it seems wierd to beat all other answers (including one in Husk) by such a significant margin... but it seems to work for the test cases, at least...

How?

-       # output elements that are different between:
 ¹      # 1. the input list, and
  …     # 2. the input list, with all the gaps filled 
        #    with the missing character ranges

Jelly, 6 bytes

O‘Ọḟ⁸Ḣ

Try it online!

How it works

O‘Ọḟ⁸Ḣ - Main link. Takes a string S on the left
O      - Convert to char codes
 ‘     - Increment each
  Ọ    - Convert from char codes

         This yields the characters that directly follow each character in S
         Call this C

    ⁸  - Yield S
   ḟ   - Remove the characters from C that are in S
     Ḣ - Return the first one

Japt -h, 6 bytes

â¡Îc+Y

Try it

â¡Îc+Y     :Implicit input of array U
â          :Setwise union with
 ¡         :Map each 0-based index Y in U
  Î        :  First element of U
   c       :  Codepoint
    +Y     :  Add Y
           :Implicit output of last element

Clojure, 102 89 bytes

#(nth(filter(fn[a](not(some #{a}%)))(map char(range(int(first %))(inc(int(last %)))))) 0)

Anonymous function, takes a string as parameter and returns the first missing character.

Seems like clojure ain't that good for golfin'...

Edit: Stripped whitespace and used nth ... 0 instead of first

const missed=ar=>String.fromCharCode(ar.reduce((a,v)=>a+1!==v.charCodeAt()?a:v.charCodeAt(),ar[0].charCodeAt())+1)

8th, 99 bytes

Rationale

If the distance between letters is greater than two, then there is a missing letter. Letter distance is obtained by computing the difference between ASCII code of each letter.

Code

: f ' nip s:each repeat over n:- 2 n:= if n:1+ "" swap s:+ . reset 1 then depth n:1- while! reset ;

Ungolfed version

: f \ s -- c 
  ' nip s:each    \ convert each letter into its ASCII code and put them on stack
  repeat
    over
    n:- 2 n:=     \ check if there is a missing letter 
    if            
      n:1+        \ compute the ASCII code of missing letter
      "" swap s:+ \ convert ASCII code into printable character
      .           \ print out the missing letter
      reset 1     \ set condition to exit from while!
    then
    depth n:1-    \ verify if there are letters to check
  while!          
  reset           \ clean stack
;

Usage and examples

ok> "abcdf" f
e
ok> "OQRS" f
P
ok> "xz" f
y
ok> "abcdefghijklmnopqrstuwxyz" f
v
ok> "ab" f

ok> "def" f

ok>

J,30 bytes - till I can get rid of more parentheses!

a.{~((([:i.#)+/a.i.{.)-.a.i.])       'abcef'

Returns d

 a.{~     take from 
 ((([:i.#) number of input bytes
 +/a.i.{.) starting from 2nd input byte
 -.a.i.]) subtract all but missing character from input

Or, a byte longer (31), completely different method but perhaps more elegantly?

a.{~<:a.i.t#~0,~<:2-/\a.i.t=:|.           'STUVX'

    returns W

Python 3, 74 62 58 44 40 bytes

-12 bytes thanks to Erik the Outgolfer. -18 bytes thanks to Leaky Nun. -4 bytes thanks to musicman523.

Takes input as a bytestring.

lambda s:chr(*{*range(s[0],s[-1])}-{*s})

Try it online!

Another cool solution:

lambda s:chr(*{*range(*s[::~-len(s)])}-{*s})

C# (.NET Core), 48 47 46 bytes, input as char array

s=>{for(int i=0;s[++i]==++s[0];);return s[0];}

Try it online!

Explanation: the first element in the array is incremented as well as a pointer iterating the following elements. When both the first element and the current element are different, it returns the first element.

C# (.NET Core), 58 56 50 bytes, input as string

s=>{var c=s[0];while(s.IndexOf(++c)>=0);return c;}

Try it online!

Previous 58-byte solution (referenced in the first comment):

s=>{for(int i=1;;i++)if(s[i]-s[0]>i)return(char)(s[i]-1);}

Algorithms using System.Linq

The following algorithms must add using System.Linq; (18 bytes) to the byte count and therefore are longer.

I quite liked this one (52+18 bytes):

s=>{int i=0;return(char)(s.First(c=>c-s[0]>i++)-1);}

And you also have a one-liner (45+18)-byte solution:

s=>(char)(s.Where((c,i)=>c-s[0]>i).First()-1)

And a very clever (37+18)-byte solution, courtesy of Ed'ka:

s=>s.Select(e=>++e).Except(s).First()

><>, 12 bytes

i/o;
?/1+:i-

Try it online!

Explanation

i/o;
?/1+:i-

i/            | Push 1 byte input to the stack then move to second line
 /1+:         | Add 1 to the stack top then duplicate it
     i-       | Push 1 byte input and take from the stack top
?/            | Check stack top is 0, if not 0 move back to line 1
 /o;          | Print the stack top

C++14, standard library, generic container type (87 86 bytes)

[](auto a){return++*adjacent_find(begin(a),end(a),[](auto a,auto b){return a+1!=b;});}

Container type from namespace ::std is assumed (e.g. std::string, std::list or std::vector. Otherwise using namespace std; or similar would be assumed.

Thanks to @Ven, with a little bit of preprocessor hacking, you get get it down to 82 bytes (1 newline)

#define x [](auto a,int b=0){return++
x *adjacent_find(begin(a),end(a),x a!=b;});}

See it Live On Coliru

C++14 no standard library (still generic, 64 63 bytes)

[](auto& a){auto p=*begin(a);for(auto c:a)if(c!=p++)return--p;}

Again, need to help name lookup only if container type not from namespace ::std (or associated with it)

Live On Coliru for std::string e.g.

Live On Coliru for char const[] e.g.

x86 Machine Code, 11 bytes

8A 11
41
8A 01
48
38 C2
74 F6
C3  

The above bytes define a function in 32-bit x86 machine code that finds the missing letter. It takes a single parameter, which is a pointer to the first element of a character array. (The length of the array is not needed, and the character array need not be NUL-terminated.)

The function uses the fastcall calling convention, where its parameter is passed in the ECX register. (It isn't essential that this calling convention or ECX be used for the input; we just need a register-based calling convention. You could trivially modify the code to take input in any register.)

The return value (the missing character) is returned in the AL register (low byte of EAX).

Note that characters are assumed to be 1 byte in length. This is perfectly sufficient for 8-bit ASCII characters, but is obviously not guaranteed to work on Unicode characters. The challenge doesn't specify, and the sample inputs only show basic ASCII. The whole world is ASCII, right?

Ungolfed assembly mnemonics:

; char FindMissingChar(char *letters);
Top:
    mov     dl, BYTE PTR [ecx]    ; load nth character from array
    inc     ecx                   ; increment pointer
    mov     al, BYTE PTR [ecx]    ; load n+1th character from array
    dec     eax                   ; decrement AL (shorter than 'dec al')
    cmp     dl, al                ; compare these two characters
    je      L2                    ; keep looping if n+1 is the char expected to follow n
    ret                           ; otherwise, return with the missing character in AL

Try it online!
(The TIO link passes the -m32 switch to GCC to ensure that it is compiling in 32-bit mode, and also applies an attribute to ensure the compiler uses the correct calling convention.)

Octave, 34 32 bytes

@(x)char(setdiff(x(1):max(x),x))

Anonymous function; returns the missing character.

Try it online!

Husk, 6 bytes

→S-(ḣ→

Try it online!

This function takes a string (list of characters) as input, and returns a character as output.

Explanation

→S-(ḣ→
    ḣ→    Get the list of all characters from the null byte to the last character of the input
 S-       Subtract the input from this list
→         Get the last element of the result

SWI Prolog, 124 bytes

m([H|T]):-n(H,N),c(T,N),!,m(T).
n(I,N):-o(I,C),D is C+1,o(N,D).
c([N|_],N).
c(_,N):-print(N),!,fail.
o(C,O):-char_code(C,O).

Examples:

?- m(['a','b','c','d','f']).
e
false.

?- m(['O','Q','R','S']).
'P'
false.

?- m(['x','z']).
y
false.

?- m(['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z']).
v
false.

Little explanation:

The m is the "main" procedure,the n produces next expected character in the list. The c does comparison - if expectation matches the next item, continue, else print out expected character and jump out of the window.

R, 67 bytes

l=letters;L=LETTERS;a=scan(,'');`if`(a==l&&T,l[a!=l][1],L[a!=L][1])

Try it online!

Python 3, 92 bytes

from string import *; f=lambda s:{*[a for a in ascii_letters if a>=s[0] and a<=s[-1] ]}^{*s}

Try it online!

Long solution but I like how sets work, and it seemed shorter in my head.

Brain-Flak, 45 bytes

{([{}()]({})){{}({}<>)((<()>))}{}}{}({}[()])

Try it online!

44 bytes of code, and +1 byte for the -c flag.

Surprisingly short for a language terrible at manipulating strings.

CJam, 6 bytes (full program) / 7 bytes (code block)

q),^W=

Try it online!

This is a full CJam program that reads the input string from standard input and prints the missing letter to standard output. CJam doesn't actually have "methods", which is what the challenge asks for, but the closest thing would probably be an executable code block, like this:

{),^W=}

Try it online!

This code block, when evaluated, takes the input as a string (i.e. an array of characters) on the stack, and returns the missing character also on the stack.


Explanation: In the full program, q reads the input string and places it on the stack. ) then pops off the last character of the input string, and the range operator , turns it into an array containing all characters with code points below it (including all letters before it in the alphabet). Thus, for example, if the input was cdfgh, then after ), the stack would contain the strings cdfg (i.e. the input with the last letter removed) and ...abcdefg, where ... stands for a bunch of characters with ASCII codes below a (i.e. all characters below the removed last input letter).

The symmetric set difference operator ^ then combines these strings into a single string that contains exactly those characters that appear in one of the strings, but not in both. It preserves the order in which the characters appear in the strings, so for the example input cdfg, the result after ),^ will be ...abe, where ... again stands for a bunch of characters with ASCII codes below a. Finally, W= just extracts the last character of this string, which is exactly the missing character e that we wanted to find (and discards the rest). When the program ends, the CJam interpreter implicitly prints out the contents of the stack.


Bonus: GolfScript, 6 bytes (full program)

),^-1>

Try it online!

It turns out that nearly the same code also works in GolfScript. We save one byte in the full program version due to GolfScript's implicit input, but lose one byte because, unlike CJam's W, GolfScript doesn't have a handy single-letter variable initialized to -1.

Also, CJam has separate integer and character types (and strings are just arrays containing characters), whereas GolfScript only has a single integer type (and has a special string type that behaves somewhat differently from normal arrays). The result of all this is that, if we want the GolfScript interpreter to print out the actual missing letter instead of its ASCII code number, we need to return a single-character string instead of just the character itself. Fortunately, making that change here just requires replacing the indexing operator = with the array/string left truncation operator >.

Of course, thanks to GolfScript's implicit I/O, the code above can also be used as a snippet that reads a string from the stack and returns a single-character string containing the missing letter. Or, rather, any snippet that takes a single string on the stack as an argument, and returns its output as a printable string on the stack, is also a full GolfScript program.

Retina, 33 25 bytes

$
¶$_
T`p`_p`.*$
D`.
!`.$

Try it online! Works with any range of ASCII characters. Edit: Saved 8 bytes thanks to @MartinEnder. Explanation: The first stage duplicates the input. The second decreases all of the characters in the copy by 1 code point. The third stage deletes all of the characters in the copy that still appear in the original. This just leaves the original input, the character that precedes the first character of the original input and the missing character. The last stage then just matches the missing character.

PHP, 44 bytes

operating on separate command line arguments:

for($c=$argv[1];++$c==$argv[-~++$i];)echo$c;            # 44 bytes
for($c=$argv[$i=1];++$c==$argv[++$i];)echo$c;           # 45 bytes
<?=end(array_diff(range($argv[1],end($argv)),$argv));   # 53 bytes
<?=trim(join(range($argv[1],end($argv))),join($argv));  # 54 bytes

Rexx (Regina), 56 bytes

a=arg(1)
say translate(xrange(left(a,1),right(a,1)),'',a)

Try it online!

Finally one that enables REXX to use its strong string-manipulation.

Japt, 14 bytes

mc
g oUo¹kU md

Try it online!

Excel, 110 + 2 = 112 bytes

=CHAR(CODE(LEFT(A1))-1+MATCH(0,IFERROR(FIND(CHAR(ROW(INDIRECT(CODE(LEFT(A1))&":"&CODE(RIGHT(A1))))),A1),0),0))

Must be entered as an array formula (Ctrl+Shift+Enter) which adds curly brackets { } on each end, adding two bytes. Input is as a string in A1, which is OK per OP.

This is not the shortest answer by far (Excel rarely is) but I like seeing if it can be done.

Python 3, 42 bytes

f=lambda a,*r:r[0]-a>1and chr(a+1)or f(*r)

Try it online!

Uses unpacked bytestring as input: f(*b'OQRS')

Mathematica, 46 bytes

Min@Complement[CharacterRange@@#[[{1,-1}]],#]&

05AB1E, 5 bytes

ÇŸçsK

Uses the 05AB1E encoding. Try it online!

Scala, 63 chars, 63 bytes

for(i<-1 to t.size-1)if(t(i-1)+1!=t(i))return (t(i)-1).toChar
0

See TIO link for tests. t is the input (a String), and I output a char. I tried doing it with a string (like this) but I don't think it is correct to output the code of the missing char. This would make the code 3 bytes shorter.

Try It Online!

C (gcc), 33 35 36 48 60 bytes

All optimizations should be turned off and only on 32-bit GCC.

f(char*v){v=*v+++1-*v?*v-1:f(v);}

Take input as a string.

Try it online!

Java 8, 70 57 56 48 46 bytes

a->{for(int i=0;++a[0]==a[++i];);return a[0];}

-14 (70 → 56) and -2 (48 → 46) bytes thanks to @CarlosAlejo.
-8 (56 → 48) bytes thanks to @Nevay.

Explanation:

Try it here.

a->{            // Method with char-array parameter and char return-type
  for(int i=0;  //  Start index-integer at 0 and loop as long as
    ++a[0]      //   the previous character + 1 (by modifying the character at index 0)
    ==a[++i];   //   equals the next character (by raising the index by 1 before checking)
  );            //  End of loop
  return a[0];  //  Return the now modified character at index 0 in the array
}               // End of method

PHP, 43 bytes

for($x=$argn[0];$argn[++$i]==++$x;);echo$x;

APL (Dyalog), 17 bytes

(⊃⎕AV/⍨∨\∧~)⎕AV∘∊

Try it online!

⎕AV∘∊ Boolean: each character in the Atomic Vector (character set) member of the argument?

() apply the following tacit function:

 the first element of

⎕AV the Atomic Vector (the character set)

/⍨ which

∨\ follows the initial (member of the argument)

 but

~ is not (a member of the argument)

05AB1E, 9 7 bytes

ǤÝsKçθ

Try it online!

Python 2, 69 bytes

lambda a:chr((ord(a[0])+ord(a[-1]))*-~len(a)/2-sum(ord(x)for x in a))

Try it online!

Some explanations As we know the first and the last elements of the list, we can easily compute the sum of the codes of all the chars in the list + the missed char (using summary formulas of arithmetic progression). The difference between this sum and the sum of the codes of all the chars in the list gives the code of the missed letter.

PHP>=7.1, 46 bytes

Take input as string

<?=trim(join(range(($a=$argn)[0],$a[-1])),$a);

PHP Sandbox Online

JavaScript (ES6), 70 bytes

Input as a character array

(a,p)=>a.some(c=>(q=p+1,p=c.charCodeAt(),p>q))&&String.fromCharCode(q)

Less golfed

a=>{
  p = undefined;
  for(i = 0; c = a[i]; i++)
  {
    q = p+1
    p = c.charCodeAt()
    if (p>q)
      return String.fromCharCode(q)
  }
}

Test

F=(a,p)=>a.some(c=>(q=p+1,p=c.charCodeAt(),p>q))&&String.fromCharCode(q)

function update() {
  var a0=A0.value.charCodeAt()
  var a1=A1.value.charCodeAt()
  if (a1>a0) {
    var r = [...Array(a1-a0+1)]
      .map((x,i)=>String.fromCharCode(a0+i))
      .filter(x => x != AX.value)
    I.textContent = r.join('') + " => " + F(r)
  }
  else {
    I.textContent=''
  }
}

update()
input { width: 1em }
Range from <input id=A0 value='O' pattern='[a-zA-Z]' length=1 oninput='update()'>
to <input id=A1 value='T' pattern='[a-zA-Z]' length=1 oninput='update()'>
excluding <input id=AX value='Q' pattern='[a-zA-Z]' length=1 oninput='update()'>
<pre id=I></pre>

Common Lisp, 88 bytes

(lambda(s)(loop as(x y)on s if(>(#1=char-code y)(1+(#1#x)))return(code-char(1+(#1#x)))))

Try it online!

Ruby, 21 characters

->a{[*a[0]..a[-1]]-a}

Returns a single element array, according to question owner's comment.

Sample run:

irb(main):001:0> ->a{[*a[0]..a[-1]]-a}[['a','b','c','d','f']]
=> ["e"]

Try it online!

ES6, 125 bytes:

(a=>((s,f)=>(r=(i,b)=>a[i]?r(i+1,b||(s[f](i)-s[f](i-1)-1&&String.fromCharCode(s[f](i-1)+1))):b)(1,0))(a.join(""),"charCodeAt"))

http://jsbin.com/vasoqidawe/edit?console

The returned function needs to be called with an array

(["a","c"])

one could save another 9 bytes through removing .join("") and passing a string:

("ac")

ES6, 108 bytes:

(a=>((s,f,o)=>(a.find((_,i)=>(o?++o:o=s[f](i))!==s[f](i)),String.fromCharCode(o)))(a.join(""),'charCodeAt'),0))

http://jsbin.com/tudiribiye/edit?console

J, 20 bytes

{&a.>:I.1 0 1&E.a.e.

Try it online!

C#, 104 bytes

using System.Linq;a=>(char)Enumerable.Range(a.Min(),a.Max()-a.Min()).Except(a.Select(c=>(int)c)).First()

Full/Formatted version:

using System.Linq;

namespace System
{
    class P
    {
        static void Main()
        {
            Func<char[], char> f = a =>
                (char)Enumerable.Range(a.Min(), a.Max() - a.Min())
                                .Except(a.Select(c=>(int)c))
                                .First();

            Console.WriteLine(f(new[] { 'a', 'b', 'c', 'd', 'f' }));

            Console.ReadLine();
        }
    }
}

Haskell, 33 30 bytes

f a=until(`notElem`a)succ$a!!0

Try it online!

Mathematica, 83 bytes

T=ToCharacterCode;FromCharacterCode[T@#[[Position[Differences@T@#,{2}][[1,1]]]]+1]&

input

[{"a","b","c","d","f"}]

Alice, 10 bytes

/X.
\ior@/

Try it online!

Explanation

This is just a framework for linear programs that operate entirely in Ordinal (string processing) mode:

/...
\.../

The actual linear code is then:

i.rXo@

Which does:

i   Read all input.
.   Duplicate.
r   Range expansion. If adjacent letters don't have adjacent code points, the
    intermediate code points are filled in between them. E.g. "ae" would turn
    into "abcde". For the inputs in this challenge, this will simply insert
    the missing letter.
X   Symmetric set difference. Drops all the letters that appear in both strings,
    i.e. everything except the one that was inserted by the range expansion.
o   Output the result.
@   Terminate the program.

Pyth, 5 bytes

-rhQe

Try it online!

Jelly, 7 bytes

.ịOr/Ọḟ

Try it online!

Charcoal, 18 bytes

Fγ¿¬∨∨‹ι⌊θ›ι⌈θ№θιι

Try it online! Link is to verbose version of code. Takes input as a string. Works with any almost contiguous sequence of ASCII characters.