[Question]
  [
Doing code review, I stumbled upon the following code, that tests the status of a checkbox:
```
if (!isNotUnchecked()) { ... }
```
I had to brainstorm for 30 minutes to find out what actual checkbox status the code was expecting. Please write me a program that can simplify these silly expressions!
---
The program should accept as input a string representing the expression to simplify (for example: `!isNotUnchecked()`). The program should output a logically equivalent simplified expression, either `isChecked()` or `!isChecked()`.
The method name in the input expression always starts with `is`, contains 0..n `Not`, and ends with `Checked()` or `Unchecked()`.
The method can be prefixed by any number of `!`.
## Examples
```
isChecked() => isChecked()
isUnchecked() => !isChecked()
isNotChecked() => !isChecked()
!isNotChecked() => isChecked()
!!!isNotNotUnchecked() => isChecked()
```
  
[Answer]
# [Python](https://docs.python.org/2/), 51 bytes
```
lambda s:sum(map(s.count,'!NU'))%2*'!'+'isC'+s[-8:]
```
[Try it online!](https://tio.run/nexus/python2#S7ON@Z@TmJuUkqhQbFVcmquRm1igUayXnF@aV6KjrugXqq6pqWqkpa6orq2eWeysrl0crWthFfu/PCMzJ1XB0KqgKDOvRCFNIzOvoLREQ1PzvxJQVUZqcnZqioamEheQF5qXjML3yy9BVqCIKaIIEQMiZL0A "Python 2 – TIO Nexus")
[Answer]
## [Retina](https://github.com/m-ender/retina), 23 bytes
```
Unc
!C
Not
!
O`is|!
!!
```
[Try it online!](https://tio.run/nexus/retina#U9VwT/gfmpfMpejM5ZdfwqXI5Z@QWVyjyKWoyPX/f2axc0ZqcnZqioYmV2YxUBkSD6gaIamIzleEiAARki4A "Retina – TIO Nexus")
### Explanation
```
Unc
!C
```
Turn `Unchecked` into `!Checked`.
```
Not
!
```
Turn all `Not`s into `!`. We now get something like `!!!is!!!!Checked()`.
```
O`is|!
```
Sort all matches of either `is` or `!`. Since `! < is`, this moves all the `!` to the beginning of the string, so the above example would become `!!!!!!!isChecked()`.
```
!!
```
Remove pairs of `!` to cancel repeated negation.
[Answer]
# [///](https://esolangs.org/wiki////), 26 bytes
```
/Unc/NotC//isNot/!is//!!//
```
[Try it online!](https://tio.run/nexus/slashes#@68fmpes75df4qyvn1kMpPUVM4v19RUV9fX/ZxY7Z6QmZ6emaGhyZRYD1SHxQDrgXEV0viJEBIiQdP0HAA "/// – TIO Nexus")
Port of my [Retina answer](https://codegolf.stackexchange.com/a/120010/48934).
[Answer]
# [Python](https://docs.python.org/), 43 bytes
```
lambda s:sum(map(ord,s))%2*'!'+'isC'+s[-8:]
```
An unnamed function taking the string, `s` and returning a string.
**[Try it online!](https://tio.run/nexus/python3#S7ON@Z@TmJuUkqhQbFVcmquRm1igkV@UolOsqalqpKWuqK6tnlnsrK5dHK1rYRX7vyS1uKRYwVZBAySakZqcnZqioamuA@SF5iWj8P3yS5AVKGKKKELEgAhZryZXWn6RAsgehcw8MF1sxcVZUJSZV6IB4ukoqNvaqesopIF5mpr/AQ "Python 3 – TIO Nexus")**
No need to check for existence of characters when `!`, `Not`, and `Un` all have exactly one odd ordinal (and `c` and `C` are both odd), so just sum up the ordinals and use the value modulo 2 to decide if we want a `!` or not.
Other than that the form is the same as [xnor's answer](https://codegolf.stackexchange.com/a/120014/53748), as I didn't find anything better. The following is also 43:
```
lambda s:'!isC'[~sum(map(ord,s))%2:]+s[-8:]
```
[Answer]
## JavaScript (ES6), ~~51~~ 50 bytes
```
f=
s=>(s.split(/!|n/i).length%2?'':'!')+'isChecked()'
```
```
<input oninput=o.textContent=f(this.value)><pre id=o>
```
Works by looking for `!`, `N`, and `n` characters, which invert the checked state. `split` returns an odd array length by default, so we add the `!` when the `split` length is even. Edit: Saved 1 byte thanks to @ETHproductions. Alternative version, also for 50 bytes:
```
s=>`${s.split(/!|n/i).length%2?``:`!`}isChecked()`
```
[Answer]
# [Retina](https://github.com/m-ender/retina), 24 bytes
```
Unc
NotC
+`isNot
!is
!!
```
[Try it online!](https://tio.run/nexus/retina#@x@al8zll1/izKWdkFkMZHApZhZzKSpy/f@fWeyckZqcnZqiocmVWQxUh8QD6YBzFdH5ihARIELSBQA "Retina – TIO Nexus")
[Answer]
# Java 7, ~~100~~ 77 bytes
```
String c(String s){return(s.split("[!NU]").length%2<1?"!":"")+"isChecked()";}
```
**Expanation:**
```
String c(String s){  // Method with String parameter and String return-type
  return(s.split("[!NU]").length
                     //  Count the amount of '!', 'N' and 'U' in the input String (+ 1)
    %2<1?            //  and if they are an even number:
     "!"             //   Start with an examination mark
    :                //  Else:
     "")             //   Start with nothing
    +"isChecked()";  //  And append "isChecked()" to that
}                    // End of method
```
**Test code:**
[Try it here.](https://tio.run/nexus/java-openjdk#lY5BC4JAEIXv/opxINglWKhjBh0650U8iYdtXXRpXcUdgxB/uxl5iSAM5vDgfXxvlJXew2UIADxJMgqmhDrjSlBsCZ4Pnaa@c8wL31pDDLMwTnPkwmpXUrXZH3cnDPGAyLdo/LnS6qYLxjEaJ4C2v9rZu@jvjSmglsYt@iwHyV/zAMnDk65F05No54qsY4p9@DiPfpKpU6vZuKG14vA/Onzz833/Mwbj9AQ)
```
class M{
  static String c(String s){return(s.split("[!NU]").length%2<1?"!":"")+"isChecked()";}
  public static void main(String[] a){
    System.out.println(c("isChecked()"));
    System.out.println(c("isUnchecked()"));
    System.out.println(c("isNotChecked()"));
    System.out.println(c("!isNotChecked()"));
    System.out.println(c("!!!isNotNotUnchecked()"));
  }
}
```
**Output:**
```
isChecked()
!isChecked()
!isChecked()
isChecked()
isChecked()
```
[Answer]
# [Aceto](https://github.com/L3viathan/Aceto), 49 bytes
```
&M"pp"
L!)(de
&c;`Che"
`!d!sick
!',@p"!'
'N'U`!Lu
```
yadda yadda Hilbert curve.
First of all, we push the three important characters on the stack: 
```
!'
'N'U
```
Then we set a catch mark and start by reading a single character. We `d`uplicate it and negate it, and if the result of this is truthy (so if the string was empty; so the input ended), we jump to the end:
```
;`
d!
,@
```
With the remaining copy of the input character, we check whether it is contained in the rest of the stack (i.e. if its one of !, N, U). If it's not, we raise an error, throwing us back to our catch mark where we read another character:
```
&c
`!
```
Otherwise, we load what's on quick storage (essentially a register that's initially an empty string; falsy), negate it and send it back to quick storage, then raise the error too (going back to reading characters):
```
&M
L!
```
When the input stopped, we are sent to the end. There, we reverse the direction, push an exclamation mark, and load quick storage and negate it. If that is truthy (i.e. we've had an odd number of negation things), we print the exclamation mark we've pushed:
```
p !'
`!Lu
```
Finally, we push the string in two parts and print them (for space saving reasons):
```
"pp"
)(de
  Che"
  sick
   "
```
Afterwards, the program still runs back to the original beginning, but since none of the commands output anything or have loopy behaviour, that doesn't matter. Actually, the first non-nopping command we reach raises an exception, skipping a majority of the code because we jump to the catch mark, meaning all Aceto sees in that part is:
```
&
!' @
'N'U
```
Since `U` is now not preceeded by a single-quote character and is therefore not seen as a character literal, it gets interpreted as a command: `U` reverses all the elements on the stack (now it's `!`, `N`, `U`, from the top), and `'N` and `'!` push more characters, meaning we end with the stack `[U, N, !, N, !]`.
*Side note: This is the first Aceto program written (in part) with the help of [Aceto's new editor](https://asciinema.org/a/57a0wa44k6lowek7amt4fu649).*
[Answer]
## C, ~~78~~ ~~70~~ 68 Bytes
Thank you Christoph!
```
c;f(char*s){for(c=1;*s;)c^=!!strchr("!NU",*s++);s="!isChecked()"+c;}
```
[Try it online](https://tio.run/nexus/c-gcc#bY8xa8NADIVn36/QHQTuzi60s7gu2bNlalIwio1N6bmcRBbjn93ZUdIMpSlIGh7S0/dWwt7T0JbIYe6n4im9YGQM9J6sZSk0FO/sbu@ayHUdkJOzI2@Hjj66kw@uJlzWMQt8tmP2cJ7GEwQzm@pmCtKxvB0hwQymqtzvy@au7DM9aLtJ/i7a/1X7o2s9@DzrWNDcUZQFTaURwYvyXMEQorZorOv6V9EYvXcbhvQKGz5ktYnSQO@jhIBmWb/z9EStvrkA)
Output:
```
isChecked() => isChecked()
isUnchecked() => !isChecked()
isNotChecked() => !isChecked()
!isNotChecked() => isChecked()
!!!isNotNotUnchecked() => isChecked()
```
[Answer]
# [Perl 5](https://www.perl.org/), 31 bytes
*-2 bytes thanks to [@Dom Hastings](https://codegolf.stackexchange.com/users/9365/dom-hastings).*
30 bytes of code + `-p` flag.
```
/c/i;$_="!"x(y/UN!//%2).isC.$'
```
[Try it online!](https://tio.run/nexus/perl5#U1YsSC3KUdAt@K@frJ9prRJvq6SoVKFRqR/qp6ivr2qkqZdZ7Kynov7/P5DOSE3OTk3R0OTKLA7NS0bi@eWXICQV0fkQASBC1qSIVRgA "Perl 5 – TIO Nexus")
`y/UN!//` counts the number of occurrences of `Un`, `Not`, and `!`. The result is that many `!` modulo 2, followed by `isChecked()`. 
---
Another attempt, based on regex, for 38 bytes (Dom Hastings saved 1 byte on that one):
```
s/isNot|isUn(c)/!is\u$1/?redo:s/!!//g
```
[Try it online!](https://tio.run/nexus/perl5#U1YsSC3KUdAt@F@sn1nsl19Sk1kcmqeRrKmvmFkcU6piqG9flJqSb1Wsr6ior5/@/39msXNGanJ2aoqGJhdIaTISD6gdIamIzocIABGyJkWswgA "Perl 5 – TIO Nexus")
[Answer]
# [Scala](http://www.scala-lang.org/), ~~39~~ 30 bytes
```
s=>"!"*(s.sum%2)+"isChecked()"
```
[Try it online!](https://tio.run/nexus/scala#dUxNC4IwGL73K94Ngq1gh46FQnStLtIPWPNVZ7oNNyMQf7uNgkgieA7Pt73WqAKcpDaAj4Am97B3Dga4ywaKLWSh06aEJP0wGCafpJTQFfPC9@1yw9dU@0OF6oY543Qad68147Gsrchs3ykUPuTaiBLDURv0opWOFVwUtkOpKubieWgMh3GanS2iuhg102cbvgvk1yFvL2K@JX@SJw "Scala – TIO Nexus")
Unfortunately I couldn't get it to deduce the type of s.
Edit: Moved the type declaration to the header (I think this is allowed, if not I'll put it back).
[Answer]
# [Ruby](https://www.ruby-lang.org/), 40 bytes
```
->x{?!*(x.count('!UN')%2)+'isChecked()'}
```
[Try it online!](https://tio.run/nexus/ruby#S7T9r2tXUW2vqKVRoZecX5pXoqGuGOqnrqlqpKmtnlnsnJGanJ2aoqGpXvu/KDUxJSczL7VYLzexoLqmoqagtKRYITG6Irb2vxKSUiUuIC80LxmF75dfgqxAEVNEESIGRMh6AQ "Ruby – TIO Nexus")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 22 bytes
```
…Unc„!C:'€–™'!:'!†„!!K
```
[Try it online!](https://tio.run/nexus/05ab1e#qymr/P@oYVloXvKjhnmKzlbqj5rWPGqY/Khlkbqilbrio4YFIHFF7/@VSof3K9jaKRzer6TzP7PYOSM1OTs1RUOTK7MYqBmJ55dfgpBUROcrQkSACFmXInZxAA "05AB1E – TIO Nexus")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 16 bytes
```
ÇOÉ'!×…isCyR8£RJ
```
[Try it online!](https://tio.run/nexus/05ab1e#qymr/H@43f9wp7ri4emPGpZlFjtXBlkcWhzk9b9S6fB@BVs7hcP7lXT@A8UzUpOzU1M0NLkyi0PzkpF4fvklCElFdL4iRASIkHUpYhcHAA "05AB1E – TIO Nexus")
Uses the trick of summing the ordinals from [Jonathan Allan's python answer](https://codegolf.stackexchange.com/a/120046/47066).
**Explanation**
```
 ÇO                # sum of ascii values of input
   É               # is odd
    '!×            # repeat "!" that many times
       …isC        # push the string "isC"
           IR8£R   # push the last 8 chars of input
                J  # join everything to string
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~24~~ 23 bytes
```
o"!N" l u)ç'! +`‰C”×B()
```
# Explanation
```
 o"!N" l u)ç'! +`‰C”×B()
Uo"!N" l u)ç'! +`‰C”×B()`
Uo"!N"                     # Only keep "!", "n" and "N" from the input
           ç'!             # Repeat the string "!" by
       l u)                # the parity of the length of the newly formed string
               +`‰C”×B()` # and concatenate with the string "isChecked()"
```
[Try it online!](https://tio.run/nexus/japt#@5@vpOinpJCjUKp5eLm6ooJ2wqFO50NTDk930tD8/19JMbPYL7/EOSM1OTs1RUNTCQA "Japt – TIO Nexus")
[Answer]
## PHP (5.5 - 5.6), ~~52~~ ~~50~~ 49 Bytes
```
<?='!'[count(spliti('!|N',$argn))%2]?>isChecked()
```
Try it [here](http://sandbox.onlinephpfunctions.com/code/12de9387b5efbc4d90f85439f33dfd291dd19ada).
```
-2 Bytes by @Titus. Ty :)
-1 Byte  by @ETHproductions. Ty :)
```
## PHP (>=5.5), ~~66~~ ~~65~~ 61
```
for($b=b;$a=$argn[$i++];)$b^=$a;echo$b&"!"|" ","isChecked()";
```
Without regex it gets a bit more compex :) Try it [here](http://sandbox.onlinephpfunctions.com/code/1c1f850c8bf8ded4d60361c8f95ffd90d7df4b28).
```
-4 Bytes by @Titus. Ty :)
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~16~~ 15 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
OSḂ⁾!iṫ⁾sCø³ṫ-7
```
A full program that takes the string as a command line argument and prints the result
**[Try it online!](https://tio.run/##y0rNyan8/98/@OGOpkeN@xQzH@5cDaSLnQ/vOLQZyNY1////v6KiYmaxX34JEIXmJWekJmenpmhoAgA)**
`OSḂ⁾!iṫ-7³ṫṭ⁾sC` or `OSḂ⁾!iṫ-7³ṫ⁾sC;` would both also work for 15.
### How?
Uses the same idea as [my Python answer](https://codegolf.stackexchange.com/a/120046/53748), but saves bytes using a different construction of `!isC` or `isC` and some implicit printing in Jelly...
```
OSḂ⁾!iṫ⁾sCø³ṫ-7 - Main link: s
O               - cast to ordinals
 S              - sum
  Ḃ             - mod 2
   ⁾!i          - literal ['!','i']
      ṫ         - tail -> ['i'] if OSḂ was 0; ['!','i'] if OSḂ was 1
                - this is printed due to the following starting a new leading
                - constant chain. Printing smashes so either "i" or "!i" is printed.
       ⁾sC      - literal ['s','C']
                - this is printed (as "sC") due to the following niladic chain.
          ø     - start a new niladic chain
           ³    - program's first input (3rd command line argument), s
            ṫ-7 - tail from index -7 = ['h','e','c','k','e','d','(',')']
                - implicit print (of "hecked()")
```
previous @ 16 bytes 9 (using concatenation and pairing with the same underlying idea):
```
OSḂ⁾!iṫ;⁾sC,ṫ€-7
```
[Answer]
# [Perl 6](https://perl6.org), ~~35~~ 31 bytes
```
{'!'x m:g/<[!NU]>/%2~'isChecked()'}
```
[Try it](https://tio.run/nexus/perl6#dc7LTsMwEAXQvb/iegG205BIILEgTYTUfTfQFWFRnKG1aB7CDiqqmh9jx48FNzyUgpAsS55zPTOtJbxcRjph5StOdV0Q0n4nuNiivFrF0zs@X9xn8cl5J4ydrUk/USGV2Pc@fu3IOqTYmIqsVO9vka7LBxkjv0EQ4CKKAsQqYa2fceujCWs2ywqT4V/CHuvnrxZnGWRuqqZ1YU7bhrSjQmHHAGNx2EkOqEJ8a4ihgg4Caeav7ofYvh9tetDRkxm7qPQY@bHOazf7l/lfP2L@GfDn15BR6gM "Perl 6 – TIO Nexus")
```
{'!'x tr/!NU//%2~'isChecked()'}
```
[Try it](https://tio.run/nexus/perl6#dY7BasJAEIbv@xT/gu3upmkWWuglRATvXqy3XOpmSpdqEtxNsYh5MW99sXTVKrEiLAM73zfzT@MIXy@JSdnyG/emKghZtxFcrOFXmk9mWt89tcK68QeZTyqkEtsuqCNPziPDwpbkpPrZJaZazqVGPkUU4TlJImiVsibsfw1qyurFW4mHw1zK3qvV34rHIWRuy7rxcU7rmoynQmHDAOuwv0eGtEFIOjgqxkmKjx20EMiGobRnxLZd7@A97X2ZdbPS9CG/pJPKj29ifs0vMD8K4f0L6Vm/ "Perl 6 – TIO Nexus")  
(requires mutable input string which will be mutilated)
## Expanded:
```
{
  #(
    '!'
  x               # string repeat
    # m:g/<[!NU]>/
    tr/!NU//      # find the number of negatives
      % 2         # modulus 2
  #)
  ~                # string concat
    'isChecked()'
}
```
[Answer]
# Sed, 36 Bytes
Same idea as all the other direct substitution answers.
```
:
s/Unc/NotC/
s/isNot/!is/
s/!!//
t
```
[Answer]
# sed, ~~37~~ 38 bytes
```
:;s/is(Not|Un)/!is/;s/!!//;t;s/ch/Ch/
```
37 + 1 for `-r` switch:
```
sed -r ':;s/is(Not|Un)/!is/;s/!!//;t;s/ch/Ch/'
```
[Answer]
## Mathematica, ~~82~~ ~~61~~ 60 Bytes
Small tweak, added one more infix operator:
```
"!"~Table~Mod[#~StringCount~{"o","n","!"},2]<>"isChecked()"&
```
Previously:
```
"!"~Table~Mod[StringCount[#,{"o","n","!"}],2]<>"isChecked()"&
```
Count up all the o's, n's and !'s then mod 2 and put that many ! in front.
Old version:
```
"!"~Table~Mod[StringCount[StringReplace[#,{{"o","n"}->"!"}],"!"],2]<>"isChecked()"&
```
[Answer]
# Excel, 90 bytes
```
=IF(ISODD(SEARCH("C",SUBSTITUTE(SUBSTITUTE(A1,"Un","!"),"Not","!"))),"","!")&"isChecked()"
```
[Answer]
# Windows Batch, 120 bytes
Previously 268 257 253 245 239 221 182 176 169 123 bytes
```
@set a=%1
@set s=#%a:~,-2%
@set s=%s:!=N#%
@for %%a in (%s:N= %)do @set/ac+=5
@if %c:~-1%==0 cd|set/p=!
@echo isC%a:~-8%
```
The programs replaces all the `!` into `N#`. Because now all negation signs, !(Now it is `N#`), `Not`, and `Un` contains `N`, the program can counts the number of appearance of `N` and determines if an leading `!` is required.
Each time the program counts an `N`, the counter is added by 5. The reason for adding 5 is because each alternating values when adding 5 ends in either 0 or 5. This can be used to determine whether the value is odd or even and the leading `!` us added if required.
In addition, xnor's last-eight-character trick is utilized.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~29~~ ~~28~~ ~~25~~ 21 bytes
```
f“NU!”LḂ”!x;“µịÆẹṠƊẹ»
```
[Try it online!](https://tio.run/nexus/jelly#@5/2qGGOX6jio4a5Pg93NAEpxQproNChrQ93dx9ue7hr58OdC451AelDu/8f3XO4/VHTmiwgBipRsLVTAKqP/P8/Wj2z2DkjNTk7NUVDU10HyAvNS0bh@@WXICtQxBRRhIgBEbLeWAA "Jelly – TIO Nexus")
```
f“NU!”LḂ”!x;“µịÆẹṠƊẹ»  Main link, argument is z
f“NU!”                 Filter to only keep "NU!"
      LḂ”!x            Repeat exclamation mark by the parity of the length
           ;“µịÆẹṠƊẹ»  Concatenate to "isChecked()"
```
-4 bytes thanks to Jonathan Allan!  
-4 bytes thanks to Jonathan Allan! (by using compressed strings) 
[Answer]
# PHP, 55 Bytes
```
<?=preg_match_all("#!|N#i",$argn)&1?"!":""?>isChecked()
```
[Try it online!](https://tio.run/nexus/php#s7EvyCjgUkksSs@zVVJUzCz2yy8BotA854zU5OzUFA1NJWsue7v/Nva2BUWp6fG5iSXJGfGJOTkaSsqKNX7KmUo6YM2aaob2SopKVkpK9naZxXDN//8DAA "PHP – TIO Nexus")
# PHP, 58 Bytes
```
<?=preg_match_all("#[!NU]#",$argn)%2?"!":"","isChecked()";
```
instead `"#[!NU]#"` you can use `"#[!N]#i"`
[Try it online!](https://tio.run/nexus/php#s7EvyCjgUkksSs@zVVJUzCz2yy8BotA854zU5OzUFA1NJWsue7v/Nva2BUWp6fG5iSXJGfGJOTkaSsrRin6hscpKOmDdmqpG9kqKSlZKSjpKmcVIuv//BwA "PHP – TIO Nexus")
# PHP, 68 Bytes
Version without Regex 
```
for(;$c=$argn[$i++];)$d^=!trim($c,"UN!");echo"!"[!$d],"isChecked()";
```
[Try it online!](https://tio.run/nexus/php#s7EvyCjgUkksSs@zVVJUzCz2yy8BotA854zU5OzUFA1NJev/aflFGtYqybZgZdEqmdrasdaaKilxtoolRZm5GirJOkqhfopKmtapyRn5SopK0YoqKbE6SpnFyIb8BwA "PHP – TIO Nexus")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 19 bytes
```
`‰C”×B()`i'!pU¬xc u
```
[Try it online!](https://ethproductions.github.io/japt/?v=2.0a0&code=YIlDlNdCKClgaSchcFWseGMgdQ==&input=LW1SIFsKImlzQ2hlY2tlZCgpIiwKImlzVW5jaGVja2VkKCkiLAoiaXNOb3RDaGVja2VkKCkiLAoiIWlzTm90Q2hlY2tlZCgpIiwKIiEhIWlzTm90Tm90VW5jaGVja2VkKCkiCl0=)
### Unpacked & How it works
```
`‰C”×B()`i'!pUq xc u
`‰C”×B()`   Compressed string for "isChecked()"
i     Insert the following string at the beginning...
'!p     "!" repeated the following number of times...
Uq        Split the input into chars
xc        Sum the charcodes
u         Modulo 2
```
Using the charcode-sum trick from [Jonathan Allan's Python solution](https://codegolf.stackexchange.com/a/120046/78410).
[Answer]
# [Pascal (FPC)](https://www.freepascal.org/), 119 bytes
```
var s:string;j:word;c:char;begin read(s);for c in s do j:=j+ord(c);if 1=j mod 2then write('!');write('isChecked()')end.
```
[Try it online!](https://tio.run/##NYoxDgIhEEWvMlRAjCZaQrayt/MAOMwuoMJmhrjHxy00@cXLe38NguF1nFcc4xMYxEnnXBdf3NY4enSYAvsHLbkCU4hGrJ8bA8IuBGKD4qZy2L8Grc8znKcC7xbh0hNV2Dh3Mlpp63@Y5ZoInxSN1ZZqPI2hlMpya33fveK/fgE "Pascal (FPC) – Try It Online")
Using method that almost every answer does, summing codepoints of characters in the input, then checking parity of the sum.
[Answer]
# [ReRegex](https://github.com/TehFlaminTaco/ReRegex), 32 bytes
```
/!!//Not/!/Unc/!C/is!/!is/#input
```
## Explained
Works like the Retina answer
```
/!!//                            #Remove all !! pairs
     Not/!/                      #Replace all Nots with !s
           Unc/!C/               #Replace any Unc's with !C (Turning Unchecked into !Checked)
                  is!/!is/       #Float all !'s past the is to the left
                          #input #Take the stdin as input
```
[Try it online!](https://tio.run/##K0otSk1Prfj/X19RUV/fL79EX1E/NC9ZX9FZP7NYUV8xs1hfOTOvoLTk/39FIAeoAIiACjJSk7NTUzQ0/wMA "ReRegex – Try It Online")
]