[Question]
  [
Based on [this](https://codereview.stackexchange.com/q/133518) question from Code Review
Given a non-empty string of printable ASCII characters, output the *second* non-repeating character. For example, for input `DEFD`, output `F`.
### Input
* A single string, in [any suitable format](http://meta.codegolf.stackexchange.com/q/2447/42963).
### Output
* The *second* character that doesn't repeat, when reading left-to-right, again in a suitable format.
* The output character is case-insensitive.
* If no such character exists (e.g., all characters repeat), output an empty string.
### Rules
* The algorithm should ignore case. That is, `D` and `d` count as the same character.
* Either a full program or a function are acceptable.
* The input string will be guaranteed non-empty (i.e., at least one character in length).
* The input string is ASCII. Any valid character could repeat, not just alphanumeric (this includes spaces).
* [Standard loopholes](http://meta.codegolf.stackexchange.com/q/1061/42963) are forbidden.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so all usual golfing rules apply, and the shortest code (in bytes) wins.
### Examples
Input is on first line, output is on second line.
```
DEFD
F
FEED
D
This is an example input sentence.
x
...,,,..,,!@
@
ABCDefgHijklMNOPqrsTuVWxyz
B
AAAAAABBBBB
Thisxthis
This this.
.
```
  
[Answer]
# [MATL](https://github.com/lmendo/MATL), 11 bytes
```
tk&=s1=)FT)
```
This exits with an error (allowed by default) if there is no second non-repeated character.
[**Try it online!**](http://matl.tryitonline.net/#code=dGsmPXMxPSlGVCk&input=J1RoaXMgaXMgYW4gZXhhbXBsZSBpbnB1dCBzZW50ZW5jZS4n)
### Explanation
```
t      % Implicitly take input string. Duplicate
k      % Convert to lowercase
&=     % 2D array of equality comparisons
s      % Sum of each column
1=     % True for entries that equal 1
)      % Apply logical index to the input string to keep non-repeated characters
TF)    % Apply logical index to take 2nd element if it exists. Implicitly display 
```
[Answer]
## [Retina](https://github.com/m-ender/retina), 25 bytes
```
i!2=`(.)(?<!\1.+)(?!.*\1)
```
[Try it online!](http://retina.tryitonline.net/#code=JShHYAppITI9YCguKSg_PCFcMS4rKSg_IS4qXDEp&input=REVGRApGRUVEClRoaXMgaXMgYW4gZXhhbXBsZSBpbnB1dCBzZW50ZW5jZS4KLi4uLCwsLi4sLCFACkFCQ0RlZmdIaWprbE1OT1BxcnNUdVZXeHl6CkFBQUFBQUJCQkJCClRoaXNYdGhpcwpUaGlzIHRoaXMu) (The first line enables running the code on a test suite of several inputs.)
### Explanation
This is just a single regex match, the regex being:
```
(.)(?<!\1.+)(?!.*\1)
```
That is, match a character and ensure it doesn't appear anywhere else in the input. The rest is configuration:
* `i` activates case insensitivity.
* `!` tells Retina to print the matches as opposed to counting them.
* `2=` tells Retina to print only the second match as opposed to all of them.
[Answer]
## 05AB1E, ~~15~~ 12 bytes
```
l©v®y¢iy}}1@
```
**Explained**
```
l©            # store lower case string in register
  v     }     # for each char in lower case string
   ®y¢iy      # if it occurs once in string, push it to stack
         }    # end if
          1@  # push the 2nd element from stack and implicitly display
```
[Try it online](http://05ab1e.tryitonline.net/#code=bMKpdsKuecKiaXl9fTFA&input=VGhpcyBpcyBhbiBleGFtcGxlIGlucHV0IHNlbnRlbmNlLg)
Saved 3 bytes thanks to @Adnan
[Answer]
# [Jelly](http://github.com/DennisMitchell/jelly), 11 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
Œlµḟœ-Q$Ḋḣ1
```
[Try it online!](http://jelly.tryitonline.net/#code=xZJswrXhuJ_Fky1RJOG4iuG4ozE&input=&args=J1RoaXMgaXMgYW4gZXhhbXBsZSBpbnB1dCBzZW50ZW5jZS4n) or [verify all test cases](http://jelly.tryitonline.net/#code=xZJswrXhuJ_Fky1RJOG4iuG4ozEKw4figqxq4oG3&input=&args=J0RFRkQnLCAnRkVFRCcsICdUaGlzIGlzIGFuIGV4YW1wbGUgaW5wdXQgc2VudGVuY2UuJywgJy4uLiwsLC4uLCwhQCcsICdBQkNEZWZnSGlqa2xNTk9QcXJzVHVWV3h5eicsICdBQUFBQUFCQkJCQicsICdUaGlzeHRoaXMnLCAnVGhpcyB0aGlzLic).
### How it works
```
Œlµḟœ-Q$Ḋḣ1  Main link. Argument: s (string)
Œl           Convert s to lowercase.
  µ          Begin a new, monadic chain. Argument: s (lowercase string)
       $     Combine the two links to the left into a monadic chain.
      Q        Unique; yield the first occurrence of each character.
    œ-         Perform multiset subtraction, removing the last occurrence of each
               character.
   ḟ         Filterfalse; keep characters that do not appear in the difference.
        Ḋ    Dequeue; remove the first character.
         ḣ1  Head 1; remove everything but the first character.
```
[Answer]
# Python 2, ~~59~~ 58 bytes
Returns a list of a single character, or an empty list if no output. (Stupid case-insensitivity...)
```
s=input().lower();print[c for c in s if s.count(c)<2][1:2]
```
[**Try it online**](http://ideone.com/5CoR7S)
[Answer]
## Batch, 171 bytes
```
@echo off
set a=.
set s=%~1
:l
if "%s%"=="" exit/b
set c=%s:~0,1%
call set t=%%s:%c%=%%
if "%s:~1%"=="%t%" set a=%a%%c%
set s=%t%
if "%a:~2%"=="" goto l
echo %c%
```
Alternative formulation, also 171 bytes:
```
@echo off
set a=.
set s=%~1
:l
if "%s%"=="" exit/b
set c=%s:~0,1%
set t=%s:~1%
call set s=%%s:%c%=%%
if "%s%"=="%t%" set a=%a%%c%
if "%a:~2%"=="" goto l
echo %c%
```
[Answer]
# Pyth, ~~16~~ 15 bytes
1 byte thanks to @mbomb007
```
~~=rz1.xhtfq1/zTzk~~
=rz1:fq1/zTz1 2
```
[Test suite.](http://pyth.herokuapp.com/?code=%3Drz1%3Afq1%2FzTz1+2&test_suite=1&test_suite_input=DEFD%0AFEED%0AThis+is+an+example+input+sentence.%0A...%2C%2C%2C..%2C%2C%21%40%0AABCDefgHijklMNOPqrsTuVWxyz%0AAAAAAABBBBB%0AThisxthis%0AThis+this.&debug=0)
[Answer]
## Actually, 19 bytes
```
;╗`ù╜ùc1=`░ε;(qq1@E
```
[Try it online!](http://actually.tryitonline.net/#code=O-KVl2DDueKVnMO5YzE9YOKWkc61OyhxcTFARQ&input=IkRFRkQi)
Explanation:
```
;╗`ù╜ùc1=`░ε;(qq1@E
;╗                   push a copy of input to reg0
  `ù╜ùc1=`░          [v for v in s if
   ù╜ùc1=              s.lower().count(v.lower()) == 1]
           ε;(qq     append two empty strings to the list
                1@E  element at index 1 (second element)
```
[Answer]
## C#, 129 128 bytes
```
char c(string i){var s=i.Where((n,m)=>i.ToLower().Where(o=>o==Char.ToLower(n)).Count()<2).ToArray();return s.Length>1?s[1]:' ';}
```
works fine.
I wish i didnt need to lowercase everything
[Answer]
# C# lambda with Linq, 63 bytes
```
s=>(s=s.ToUpper()).Where(c=>s.Count(C=>c==C)<2).Skip(1).First()
```
[Answer]
# C#, 141 bytes
```
void p(){var x=Console.ReadLine().ToLower();var c=0;foreach(char i in x){if(x.Split(i).Length-1<2){if(++c==2){Console.WriteLine(i);break;}}}}
```
# Without break(smallest), 135 bytes
```
void p(){var x=Console.ReadLine().ToLower();var c=0;foreach(char i in x){if(x.Split(i).Length-1<2){if(++c==2){Console.WriteLine(i);}}}}
```
# With for(;;), 150 bytes
```
void p(){for(;;){var x=Console.ReadLine().ToLower();var c=0;foreach(char i in x){if(x.Split(i).Length-1<2){if(++c==2){Console.WriteLine(i);break;}}}}}
```
# Ungolfed with comments
```
void p()
{
    var x=Console.ReadLine().ToLower();//Get lowercase version of input from STDIN
    var c=0; //Create "count" integer
    foreach(char i in x){//For each char in input from STDIN
        if(x.Split(i).Length-1<2)//If current char occurs once in input from STDIN
        {
            if(++c==2){ //Add 1 to count and if count is 2
                Console.WriteLine(i); //Print result to STDOUT
                break; //Exit foreach
            } //End of IF
         } //End of IF
     } //End of FOREACH
} //End of VOID
```
12 bytes saved by TuukkaX(change count to c).
3 bytes saved by TuukkaX(change string to var).
4 bytes saved by TuukkaX in "With for(;;)"(changed while(true) to for(;;)).
2 bytes saved by TuukkaX(changed c++;if(c==2) to if(++c==2)).
14 bytes saved by Bryce Wagner(changed x.ToCharArray() to x).
[Answer]
# x86 machine code, 43 bytes
In hex:
```
FC31C031C95641AC84C0740E3C6172F63C7A77F28066FFDFEBEC5EAC49740B89F751F2AE5974F44A77F1C3
```
Function takes a pointer to the input string in (E)SI and an integer in (E)DX and returns the (E)DX-th non-repeating character or zero if there's no such character. As a side-effect it converts the string to upper case.
Disassembly:
```
fc             cld
31 c0          xor    eax,eax
31 c9          xor    ecx,ecx
56             push   esi
_loop0:                         ;Search for the NULL char,
41             inc    ecx       ;counting the length in the process
ac             lodsb
84 c0          test   al,al
74 0e          je     _break0   ;NULL found, break
3c 61          cmp    al,0x61   ;If char is
72 f6          jb     _loop0    ;between 'a' and 'z'
3c 7a          cmp    al,0x7a   ;convert this char
77 f2          ja     _loop0    ;to uppercase in-place
80 66 ff df    and    byte ptr [esi-0x1],0xdf
eb ec          jmp    _loop0
_break0:
5e             pop    esi       ;Reset pointer to the string
_loop:                          ;ECX=string length with NULL
ac             lodsb            ;Load next char to AL
49             dec    ecx
74 0b          je     _ret      ;End of string found, break (AL==0)
89 f7          mov    edi,esi   ;EDI points to the next char
51             push   ecx
f2 ae          repnz scasb      ;Search for AL in the rest of the string
59             pop    ecx
74 f4          je     _loop     ;ZF==1 <=> another instance found, continue
4a             dec    edx
77 f1          ja     _loop     ;If not yet the EDX-th non-rep char, continue
_ret:
c3             ret
```
[Answer]
# APL, 32 bytes
```
{⊃1↓⍵/⍨1=+/∘.=⍨(⎕UCS ⍵)+32×⍵∊⎕A}
```
[Try it](http://tryapl.org/?a=%7B%u22831%u2193%u2375/%u23681%3D+/%u2218.%3D%u2368%28%u2395UCS%20%u2375%29+32%D7%u2375%u220A%u2395A%7D%27Hello%27&run) || [All test cases](http://tryapl.org/?a=%u236A%20%7B%u22831%u2193%u2375/%u23681%3D+/%u2218.%3D%u2368%28%u2395UCS%20%u2375%29+32%D7%u2375%u220A%u2395A%7D%20%A8%20%27DEFD%27%20%27FEED%27%20%27This%20is%20an%20example%20input%20sentence.%27%20%27...%2C%2C%2C..%2C%2C%21@%27%20%27ABCDefgHijklMNOPqrsTuVWxyz%27%20%27AAAAAABBBBB%27%20%27Thisxthis%27%20%27This%20this.%27&run)
Explanation:
```
                (⎕UCS ⍵)+32×⍵∊⎕A  Add 32 to uppercase letters
            ∘.=⍨                    Make an equality matrix
          +/                        Check how many matches
    ⍵/⍨1=                           Keep elements with 1 match
  1↓                                Drop the first one
⊃                                   Return the second one
```
I was about to post it with 16 bytes, but the I realized it had to be case-insensitive...
[Answer]
# Retina, ~~43~~ 36 bytes
```
iM!`(.)(?<!\1.+)(?!.*\1)
!`(?<=^.¶).
```
[Try it online!](http://retina.tryitonline.net/#code=aU0hYCguKSg_PCFcMS4rKSg_IS4qXDEpCiFgKD88PV4uwrYpLg&input=REVGZA)
[Answer]
# Mathematica, 49 bytes
```
Cases[Tally@ToUpperCase@#,{_,1}][[2,1]]~Check~""&
```
Anonymous function. Takes a list of characters as input. Ignore any errors that are generated.
[Answer]
## JavaScript (Firefox 48 or earlier), 60 bytes
```
f=s=>(m=s.match(/(.).*\1/i))?f(s.replace(m[1],"","gi")):s[1]
```
Returns `undefined` if there are only zero or one non-repeating characters. Works by case-insensitively deleting all occurrences of characters that appear more than once in the string. Relies on a non-standard Firefox extension that was removed in Firefox 49. ~~119~~ 91 byte ES6 version:
```
f=s=>(m=s.match(/(.).*?(\1)(.*\1)?/i))?f((m[3]?s:s.replace(m[2],"")).replace(m[1],"")):s[1]
```
Recursively searches for all characters that appear at least twice in the string. If the character appears exactly twice then both occurrences are deleted otherwise only the first occurrence is deleted (the other occurrences will be deleted later). This allows the occurrences to have a difference case.
[Answer]
# J, 25 bytes
```
(1{2{.]-.]#~1-~:)@tolower
```
## Usage
```
   f =: (1{2{.]-.]#~1-~:)@tolower
   f 'DEFD'
f
   f 'FEED'
d
   f 'This is an example input sentence.'
x
   f '...,,,..,,!@'
@
   f 'ABCDefgHijklMNOPqrsTuVWxyz'
b
   f 'AAAAAABBBBB'
   f 'Thisxthis'
   f 'This this.'
.
```
## Explanation
```
(1{2{.]-.]#~1-~:)@tolower  Input: s
                  tolower  Converts the string s to lowercase
              ~:           Mark the indices where the first time a char appears
            1-             Complement it
         ]                 Identity function to get s
          #~               Copy only the chars appearing more than once
      ]                    Identity function to get s
       -.                  Remove all the chars from s appearing more than once
   2{.                     Take the first 2 chars from the result (pad with empty string)
 1{                        Take the second char at index 1 and return it
```
[Answer]
# Bash, 58 bytes
```
tr A-Z a-z>t
tr -dc "`fold -1<t|sort|uniq -u`"<t|cut -c2
```
**Caution:** This creates a temporary file named **t**. If it already exists, it will be overwritten.
[Answer]
# C, 174 bytes
```
int c(char*s){int y=128,z=256,c[384],t;memset(c,0,z*6);for(;t=toupper(*s);s++){c[t]++?c[t]-2?0:c[z+(c[y+c[z+t]]=c[y+t])]=c[z+t]:c[z]=c[y+(c[z+t]=c[z])]=t;}return c[y+c[y]];}
```
This is not the most short, but quite efficient implementation. In essence it uses double-linked list to maintain ordered set of candidate characters and scans input string just once. Returns character code or zero if none found.
A little bit ungolfed version:
```
int c(char*s)
{
    int y=128,z=256,c[384],t;
    //It's basically c[3][128], but with linear array the code is shorter
    memset(c,0,z*6);
    for(;t=toupper(*s);s++)
    {
        c[t]++ ?        // c[0][x] - number of char x's occurrence
            c[t] - 2 ?  // > 0
                0       // > 1 - nothing to do  
                : c[z + (c[y + c[z + t]] = c[y + t])] = c[z + t]  // == 1 - remove char from the list
            : c[z] = c[y + (c[z + t] = c[z])] = t; // == 0 - add char to the end of the list
    }
    return c[y + c[y]];
}
```
[Answer]
## C#, 143 bytes
```
char c(string s){var l=s.Select(o=>Char.ToLower(o)).GroupBy(x=>x).Where(n=>n.Count()<2).Select(m=>m.Key).ToList();return l.Count()>1?l[1]:' ';}
```
[Answer]
# TSQL, 128 bytes
Golfed:
```
DECLARE @ varchar(99)=',,zzzbb@kkkkkkJgg'
,@i INT=99WHILE @i>1SELECT
@i-=1,@=IIF(LEN(@)>LEN(x)+1,x,@)FROM(SELECT
REPLACE(@,SUBSTRING(@,@i,1),'')x)x PRINT SUBSTRING(@,2,1)
```
Ungolfed:
```
DECLARE @ varchar(99)=',,zzzbb@kkkkkkJgg'
,@i INT=99
WHILE @i>1
  SELECT
    @i-=1,@=IIF(LEN(@)>LEN(x)+1,x,@)
  FROM
    (SELECT 
       REPLACE(@,SUBSTRING(@,@i,1),'')x
    )x
PRINT SUBSTRING(@,2,1)
```
[Fiddle](https://data.stackexchange.com/stackoverflow/query/508407/whats-the-second-non-repeating-character)
[Answer]
# Ruby, 53 bytes
Input is STDIN, output is STDOUT. In Ruby, out-of-index positions in an array or string return `nil`, which is not printed.
`String#count` is a strange function in Ruby because instead of counting the number of occurrences for the string that was passed in, it counts the number of occurrences for each letter in that string. It's usually annoying but we can use it to our advantage this time. `String#swapcase` swaps upper and lower case letters.
```
$><<gets.chars.reject{|c|$_.count(c+c.swapcase)>1}[1]
```
Old version that wasn't safe against special characters like `.` - 46 bytes
```
$><<gets.chars.reject{|c|$_=~/#{c}.*#{c}/i}[1]
```
[Answer]
# Java 8, ~~172~~ 157 bytes
```
(String s)->{s=s.toLowerCase();for(char i=0,c;s.length()>0;s=s.replace(c+"","")){c=s.charAt(0);if(!s.matches(".*"+c+".*"+c+".*")&&++i>1)return c;}return' ';}
```
-15 bytes.. Dang I was bad at golfing back then. ;)
**Explanation:**
[Try it here.](https://tio.run/##jVDLbsIwELzzFUsOYDfBomcLVJ7qodBKoPZQ9eAahxgSJ7UdCkX59tQBKm4NK2tsr2fXM7thO9ZJM6E2q23JY2YMzJhUxwaAVFbokHEB8@oKwCOmgaOF1VKtwWDqskXDgbHMSg5zUNCD8kro9I@mZ4hNn9JvoUfMCIRpmGp06iR73YBTQ2Kh1jZCuN@lFVuLLHafIu57XuB5GB@5y1YVA4u6mMoQNQ1JmOWRMMgjd57vqNcNt1q@L/v3WAubawWcFudTG9q0KGklOMs/Yyf4onuXyhUkzvVF@fsHMHy2vDgYKxKS5pZk7snGCinCkTeeTMdOGv2XNJ1M6knLSBpwiykQe5ZksXCDz3ILRrj5Ky5IbQtCSBAEFTQfasmD4WgswvWj3Gzj2fz55UubZf76tj/81JeeYljFTbb21sFtA6iYf0aLRlH@Ag)
```
(String s)->{                          // Method with String parameter and character return-type
  s=s.toLowerCase();                   // Make the input-String lowercase
  for(char i=0,c;s.length()>0;         // Loop over the characters of `s`
      s=s.replace(c+"","")){           // And after every iteration, remove all occurrences of the previous iteration
    c=s.charAt(0);                     // Get the current first character
    if(!s.matches(".*"+c+".*"+c+".*")  // If it doesn't occur more than once
     &&++i>1)                          // And this was the second one we've found
      return c;                        // Return this second characters
  }                                    // End of loop
  return' ';                           // Else: return an empty character/nothing
}                                      // End of method
```
[Answer]
# [R](https://www.r-project.org/), 79 bytes
```
function(z){y=tolower(el(strsplit(z,"")));x=table(y);y[y%in%names(x[x==1])][2]}
```
[Try it online!](https://tio.run/##BcFBCoAgEADAvwjCLnSpq@xLxIOFgWBr6EZa9HabKWPsF28SM8ODbyfJKd@hQEhQpdQzRYFnUgoRTSPxawrQ0XTbdWTN/ggVmm1Es0NnF/eN8QM "R – Try It Online")
I definitely feel like something can be golfed out here. But I really enjoyed this challenge.
This answer splits the string into a vector of characters, changes them all to lower case, and tables them (counts them). Characters that occur once are selected and compared to characters within the aforementioned vector, then the second value that is true is returned as output. An empty string, or a string with no repeating characters outputs NA.
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), ~~38~~ 32 bytes
*-6 bytes thanks to nwellnhof by changing `.comb` to a case-insensitive regex*
```
{~grep({2>m:g:i/$^a/},.comb)[1]}
```
[Try it online!](https://tio.run/##LY1Pa4NAFMTv71O8ihSF7Yb20ENASewqvfTPIbSH0sAmPO0262pdBa3Yr27XpsPwY2AGpqZG387lgJc5RjiPP0VDdTDexOW6WKuVv5erifFjVR7Ct@v3ac6rBgOtDNkQr2L0lWHoV13reNDSnCLPwxEQrRwwD1wdMg@jGL3zDKZZpJmADCBLUwECYPehLDpLg9TLstaEytRdi5ZMS@ZIHHoAzjljbMHFBjYA2@ROUF7cq8@Tfnh8ev5q7K57ee2Hb0hc@6dkEZwf@tbhP@OSOXD4BQ "Perl 6 – Try It Online")
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok) / [K4](https://kx.com/download/), 11 bytes
**Solution:**
```
*1_&1=#:'=_
```
[Try it online!](https://tio.run/##y9bNz/7/X8swXs3QVtlK3TZeKSQjs1gBiBLzFFIrEnMLclIVMvMKSksUilPzSlLzklP1lP7/BwA "K (oK) – Try It Online")
**Explanation:**
```
*1_&1=#:'=_ / the solution
          _ / convert input to lowercase
         =  / group alike characters
      #:'   / count (#:) each group
    1=      / 1 equal to length of the group?
   &        / where true
 1_         / drop the first
*           / take the first
```
[Answer]
# [Thunno 2](https://github.com/Thunno/Thunno2) `h`, 6 [bytes](https://github.com/Thunno/Thunno2/blob/main/docs/codepage.md)
```
LDcḅịḣ
```
[Try it online!](https://Not-Thonnu.github.io/run#aGVhZGVyPWQmY29kZT1MRGMlRTElQjglODUlRTElQkIlOEIlRTElQjglQTMmZm9vdGVyPSZpbnB1dD0nREVGRCclMjAtJTNFJTIwJ0YnJTBBJ0ZFRUQnJTIwLSUzRSUyMCdEJyUwQSdUaGlzJTIwaXMlMjBhbiUyMGV4YW1wbGUlMjBpbnB1dCUyMHNlbnRlbmNlLiclMjAtJTNFJTIwJ3gnJTBBJy4uLiUyQyUyQyUyQy4uJTJDJTJDISU0MCclMjAtJTNFJTIwJyU0MCclMEEnQUJDRGVmZ0hpamtsTU5PUHFyc1R1Vld4eXonJTIwLSUzRSUyMCdCJyUwQSdBQUFBQUFCQkJCQiclMjAtJTNFJTIwJyclMEEnVGhpc3h0aGlzJyUyMC0lM0UlMjAnJyUwQSdUaGlzJTIwdGhpcy4nJTIwLSUzRSUyMCcuJyZmbGFncz1DaA==)
#### Explanation
```
LDcḅịḣ  # Implicit input
    ị   # Filter the input by:
L c     #  The count of the character lowercased
 D      #  In the input lowercased
   ḅ    #  Equals one?
     ḣ  # Remove the first character
        # Implicit output of next character
        # (or the empty string if it doesn't exist)
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-g`](https://codegolf.meta.stackexchange.com/a/14339/), 8 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
k@oX ÅÃÅ
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LWc&code=a0BvWCDFw8U&input=IkZFZWQi)
```
k@v èXv)É
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 9 bytes
```
⇩)ġ~₃f∑Ḣh
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=2#WyIiLCIiLCLih6kpxKF+4oKDZuKIkeG4omgiLCIiLCJUaGlzeHRoaXMiXQ==)
*-3 thanks to @lyxal*
#### Explanation
```
⇩)ġ~₃f∑Ḣh  # Implicit input
⇩)ġ        # Group by lowercasing
   ~₃      # Filter by length == 1
     f∑    # Flatten and join
       Ḣ   # Remove the first character
        h  # Then take the next one
           # (or an empty string
           #  if it doesn't exist)
           # Implicit output
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~9~~ 6 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
lÐ¢Ï¦н
```
Input as a list of characters.
[Try it online](https://tio.run/##yy9OTMpM/f8/5/CEQ4sO9x9admHv///RSiFKOkoZQJwJxMVArIDGTgTiPCg7FYgroGK5QFwAxDlQcZi@PKh4KRCXQMWLoWryoGIwdjKUracUCwA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9TVmmvpPCobZKCkn1l8P@cwxMOLTrcf2jZhb3/df67uLq5cLm5urpwhWRkFisAUWKeQmpFYm5BTqpCZl5BaYlCcWpeSWpecqoel56eno6ODohQdOBydHJ2SU1L98jMys7x9fMPKCwqDikNC6@orOJyBAMnEAAbW1ECJCAWgFh6AA).
**Explanation:**
```
l       # Convert the characters in the (implicit) input-list to lowercase
 Ð      # Triplicate this lowercase list
  ¢     # Pop two, and get the count of each character in the list
   Ï    # Pop the counts and remaining list, and only keep the characters at the truthy
        # (count==1) positions
    ¦   # Remove the first character
     н  # Pop and leave the new first character
        # (after which it is output implicitly as result)
```
Unfortunately the `.m` (least frequent character(s) builtin) [doesn't retain its order in the legacy version of 05AB1E](https://tio.run/##MzBNTDJM/f8/Ry/3//@QjMxiBSBKzFNIrUjMLchJVcjMKygtUShOzStJzUtO1QMA) and will [only keep the first character instead of a list in the new 05AB1E version](https://tio.run/##yy9OTMpM/f8/Ry/3//@QjMxiBSBKzFNIrUjMLchJVcjMKygtUShOzStJzUtO1QMA), otherwise this could have been 5 bytes with `l.m¦¬`.
]