[Question]
  [
Based on [this question](https://codereview.stackexchange.com/q/236520) from Code Review.
Given precisely three positive integers, return the product of all of the distinct inputs. If none of the inputs are distinct, return 1. That is, implement the function:
\$ f(a,b,c) = \cases{1 & $a = b = c $ \\ a & $ b = c $ \\ b & $ a = c $ \\ c & $ a = b $ \\ a b c & otherwise } \$
Shortest code in each language wins.
### Test cases
```
a, b, c -> f(a,b,c)
7, 7, 7 -> 1
3, 3, 5 -> 5
2, 6, 6 -> 2
3, 4, 3 -> 4
1, 2, 3 -> 6
12, 9, 16 -> 1728
```
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 3 bytes
```
¢ÏP
```
[Try it online!](https://tio.run/##yy9OTMpM/f//0KLD/QH//0cb6yiYA1EsAA "05AB1E – Try It Online")
```
¢       # count occurences of each number
 Ï      # keep only those where the count is 1
  P     # product (1 if the list is empty)
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~46~~ \$\cdots\$ ~~43~~ 42 bytes
Saved 2 bytes thanks to [79037662](https://codegolf.stackexchange.com/users/89930/79037662)!!! 
```
f(a,b,c){a=a^b?a^c?b^c?a*b*c:a:b:b^c?c:1;}
```
[Try it online!](https://tio.run/##S9ZNT07@/z9NI1EnSSdZszrRNjEuyT4xLtk@CYgTtZK0kq0SrZKsQLxkK0Pr2v@5iZl5GprVXAVFmXklaRpKqikxeUo6aRrmOgogpKlpjU3KGIiwSRmDpUyxSRnpKJgBEQ5dJjgMNNRRMIJK1f4HAA "C (gcc) – Try It Online")
[Answer]
# JavaScript (ES6), 38 bytes
```
(a,b,c)=>a-b?b-c?c-a?a*b*c:b:a:b-c?c:1
```
[Try it online!](https://tio.run/##ZctBCsIwEIXhvaeYZVImlsS2QqDmLDNjK0ppihWvH6MBwQr/6n28Gz1plft1eZg5noc09kkRMoruT2Q4sJEghgJVXIlnT/6zeJskzmuchv0UL2pUR4R3WkNdg9394gEh1xZsN@gQulxB9/9s8rlgs0GL4L7YpRc "JavaScript (Node.js) – Try It Online")
---
# JavaScript (ES6), 53 bytes
Takes input as `[a,b,c]`.
```
A=>[[a,b,c]=A,1,a-b?a-c?a:b:c,a*b*c][new Set(A).size]
```
[Try it online!](https://tio.run/##bczRCoIwFMbx@57iXDo5Ki41EEz2DF2OXZytGYpskVLQyy@DQSDB/@7H9030pMU8xvuaOX@1YeiC6M5SEmo0qhNYImW6p8z01OrWIKU6NUo6@4KLXRPB8mV8WxWMd4ufbT77WzIk8oTwTTEGRQHlYcdHhK06cr1njtBsReZ/1tV2ELnac4nAf9yEDw "JavaScript (Node.js) – Try It Online")
### Commented
```
A =>                // A[] = input
  [                 // lookup table:
    [a, b, c] = A,  //   set size = 0 --> impossible, so use this slot
                    //   to split A[] into 3 distinct variables
    1,              //   set size = 1 --> return 1
    a - b ?         //   set size = 2 --> if a is not equal to b:
      a - c ?       //     if a is not equal to c:
        a           //       return a
      :             //     else:
        b           //       return b
    :               //   else:
      c,            //     return c
    a * b * c       //   set size = 3 --> return a * b * c
  ]                 //
  [new Set(A).size] // index into lookup table = size of the set
```
[Answer]
# [J](http://jsoftware.com/), 10 bytes
```
*/@-.}./.~
```
[Try it online!](https://tio.run/##Lcw7CoAwEATQfk8xrRIj@VoEQ07gJSRBbGxs9epxF2SneQyzZ@8Nq8Y4l0k/etZv3667wtCiIMGUGU6BEwSBrELkCKw0nkuBJ6Ngf0QaqO7HVVrJ/EUuceMQEiyPo8jDJRi2A/UP "J – Try It Online")
```
     }./.~  group by value and remove one from each group
   -.       set subtract from input
*/          product
```
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), 10 bytes
*Thanks to Adám and Bubbler in chat for helping golf this*
```
×/∪*1=⊢∘≢⌸
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v8/7VHbhMPT9R91rNIytH3UtehRx4xHnYse9ewASikYKRgrmHCBaCALSJuAIBcA "APL (Dyalog Classic) – Try It Online")
### Explanation:
```
×/             ⍝ Reduce by multiplication
  ∪            ⍝ The unique values of the input
   *           ⍝ To the power of
    1=         ⍝ Whether one is equal to
        ≢      ⍝ The length of
      ⊢∘ ⌸     ⍝ The indexes of each unique element
```
[Answer]
# [Python](https://docs.python.org/2/), 48 bytes
```
lambda l:eval("(%sin[%s,%s]or %s)*"*3%(l*4)+"1")
```
[Try it online!](https://tio.run/##DcZBCsMgEADAu69YBGHX7kVNEwjkJW0PliZEsEaiTenrbZjL5F9dt2TbAhPcW/Tv58tDHOfDR5SoSkg3VViVx7aDKqSldgqj7ugijaT2XUOcwYx5D6nCgiHlT0WiNvBJOHZ8FZZ77s937IRhy@4P "Python 2 – Try It Online")
Takes in a tuple. The idea is similar to [an answer in the Code Review question](https://codereview.stackexchange.com/a/236573/56493), which can be golfed to:
**51 bytes**
```
lambda a,b,c:a**(b!=a!=c)*b**(c!=b!=a)*c**(a!=c!=b)
```
[Try it online!](https://tio.run/##FcgxDoAgDADAr8BGm06ymfQl6tBiiCSKxODg6xHGu/LV485Ti4bN2k65dBcjpBRmQXRqWSwHQO0IlocBQ8fobmjlSbma6DDl8lYH0JaJPPntBw "Python 2 – Try It Online")
Each element is included in the product if it's different from the other two, with the power setting to a harmless `x**0 == 1` otherwise. We want to avoid writing the three similar terms being multiplied. Python unfortunately doesn't have a built-in list product without imports. So, we turn to `eval` shenanigans.
We use a longer expression that use logical short-circuiting:
**60 bytes**
```
lambda a,b,c:(a in[b,c]or a)*(b in[c,a]or b)*(c in[a,b]or c)
```
[Try it online!](https://tio.run/##FcrBCsMgEIThu0@xRw1ziTYJBPokaQ@rbYiQGgmG0qe3K3P5P5j8K9uRbF3pTo@688e/mBgeYdZMMS1Sz@MkNp32zQHc7MWhWb7NwdTvFvc39XM@Yyq06i6mfBVtTJ0gUw4Og7IYMUrf4FQPC/cH "Python 2 – Try It Online")
In this expression, the variable names cycle through `a,b,c` in that order four times. So, by tripling the format string `"(%sin[%s,%s]or %s)*"` and plugging in the input tuple repeated four times, we get the desired expression. We just need to append a `"1"` to deal with the trailing multiplication.
[Answer]
# [R](https://www.r-project.org/), ~~40~~ 37 bytes
-3 bytes by taking input with `scan()`.
```
prod(unique(x<-scan())^2,1/x)^!!sd(x)
```
[Try it online!](https://tio.run/##PcrLCoAgFIThfU9hu3NgItIum3qVICyhjV0F8eUtIWI2Hz9zRiMGYZzV97pZChCXnuzwBw4c93Obydn1cAv5vkgHYh4lqtLzmOfXTJ6jIU0d3jFnyQoKzWeJFu3fa6jPFWRyfAA "R – Try It Online")
`sd(x)` computes the standard deviation (which is 0 iff all entries are equal), so `!!sd(x)` is `TRUE` if some entries are different, and `FALSE` if all are equal.
* if all entries are different, then `unique(x)==x`, so we are down to `prod(x)^1`
* if 2 entries are equal, then the corresponding value gets cancelled out between `unique(x)^2` and `1/x`, so we are left with the sole "lonely" value
* if all 3 entries are equal, then we have `(...)^0` which is 1.
This is shorter than anything I could come up with based on `table`, `tabulate`, `duplicated` or `rle(sort())`.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~7~~ 6 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
ḟœ-Q$P
```
**[Try it online!](https://tio.run/##y0rNyan8///hjvlHJ@sGqgT8P9z@qGnN///R0eY6CiAUy6UTbayjAESmIKaRjoIZEEFFTYASIKahjoIRiBkLAA "Jelly – Try It Online")**
### How?
```
ḟœ-Q$P - list, L
    $  - last two links as a monad:
   Q   -   de-duplicate (L)
 œ-    -   (L) multi-set difference (that)
ḟ      - (L) filter discard if in (that)
     P - product
```
---
**7**s:
```
ĠṖÐḟị⁸P
ḟṖƙ`F$P
```
[Answer]
# [Haskell](https://www.haskell.org/), 37 bytes
```
f l=product[x|x<-l,filter(==x)l==[x]]
```
[Try it online!](https://tio.run/##Lcm7CgIxEIXhVzmFhcJs4XprnCcZUoS40eDsGrIRUvjsxgSEv/g452HX56Raq4dyTK/b22Upn3IdlHzQPKUtc9kpsxRj6mzDAkZMYcnYYLYRHiIXQs8Q5EBonTpHwrn1X4/t6NwTxk5Tv86rva91cDH@AA "Haskell – Try It Online")
Pretty straightforward -- filter for elements that appear only once and take the product.
[Answer]
# Excel (Version 1911), ~~80 Bytes~~, 42 Bytes
```
=PRODUCT(FILTER(A1#,COUNTIF(A1#,A1#)=1,1))
```
Input entered as a static column array (e.g. `={1;2;3}`) in cell `A1`
* Saved 38 bytes due to inspiration from Grimmy's 05AB1E solution.
[Answer]
# [R](https://www.r-project.org/), 36 bytes
```
prod((a=rle(sort(scan())))$v[a$l<2])
```
[Try it online!](https://tio.run/##K/r/v6AoP0VDI9G2KCdVozi/qESjODkxT0MTCFTKohNVcmyMYjX/myqYKZj/BwA "R – Try It Online")
`rle()` shows its worth again. Feels like some parentheses could be golfed out somehow. 
The fact that `prod()` of an empty numeric evaluates to 1 is the only reason this is efficient.
[Answer]
# [PHP](https://php.net/), ~~72~~ ~~71~~ bytes
```
sort($argv);[,$a,$b,$c]=$argv;echo$a-$b?$b-$c?$a*$b*$c:$a:($b-$c?$c:1);
```
[Try it online!](https://tio.run/##LcixCoAgEAbgl/kHDR2CXLTwQaLh7ojcFIte/4po@YavlaZzbq9n7ZcB9eO2aXUgB3aQbfkq7VIqyIMz2EMyaAAPkAiK5i@Jo02qGnTS8AA "PHP – Try It Online")
~~Might be shorter without the `sort` but nested ternary operator precedence blows my mind.~~
-1 byte thanks to @640KB
# [PHP](https://php.net/), 66 bytes
```
fn($a,$b,$c)=>$a-$c?$a-$b?$b-$c?$a*$b*$c:$a:$b==$c?:$c:$b==$c?:$b;
```
[Try it online!](https://tio.run/##Vc9Ba4MwFAfw8/Ip/pR3sOXVoqvtpks9DXYYrPe2lCSNyA4q09vYZ88S68CRR3j5Je8l6erOvZRd3QlBg@2HHhIn8XDCnsfAhQFsNlgfkAR/5BDZ3LPgKWPnY@7pdH7rS@a@DZ5wKPnnu9G9PjOSsdN07z59EpdC@CdW0lVNRIpJM5mlPJBakynDrEvS93xFekUmJ5WTltJTHlZ/qS6cb1W1X1aZOsL0a9X7DEt8C8CausVn3zZX25j2ZqNxi7E4D@dhwaAqQhzHdzy@Ha@vH@@F@BHOJX5kvw "PHP – Try It Online")
Kudos to @640KB for taming the ternary operator beast!
[Answer]
# [GolfScript](http://www.golfscript.com/golfscript/), 31 bytes
```
...{{*}*}:m;m\.|m/-m\.|,1=\1\if
```
This was... a lot more difficult than I thought it would be. Can be optimized. So much so, that I don't really want to give this much of an explanation.
Here's the process:
Take your input array and make 3 more copies of it. Make a function m, which multiplies the elements in an array together. Do that to the first array, then eliminate dupes from a second (keeping one of each). Perform m on it, then divide it from the first number. You should have the duplicate number (if there's only one pair dupe). Remove it rom your array, then return the last number. If the "suspected dupe" is 1, then just multiply again and output. If, when you remove all of the "suspected dupe"s, you're left with an array of size 1, just output 1 instead.
This was incredibly and probably needlessly complicated, but I couldn't find any good GolfScript shortcuts besides the multiplication bit. PITA.
[Try it online, I guess](https://tio.run/##S8/PSStOLsosKPkfbapgrGAc@19PT6@6WqtWq9Yq1zo3Rq8mV18XROkY2sYYxmSm/f8PAA "GolfScript – Try It Online")
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 44 bytes
```
,1+($args|group|? C* -eq 1|% N*)-join'*'|iex
```
[Try it online!](https://tio.run/##PY/dCoJAEIXv9ykGWXPX1gs1DYJI6L5XiKjNDEnzhwTXZ7fZzW04zMB3ZoaZuvrIpn3IspzpHfYwziJcM3pp8lblTdXX6gBHHwL5hlC5cPJ58KyKl@d7qpDDPBGSMQIYgoUCy1YY8YUlmsVCK7Es0gxTirJss/RhjS1LNcOlkWEcFLgwGo/KoZbXTt4EmEvxbnr@OY1s@7JDsMJ3Mm0a7lC2WPjJf5zv7IBDpvkL "PowerShell – Try It Online")
where `|? C* -eq 1` means `|? Count -eq 1` and `|% N*` means `|% Name`.
---
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 45 bytes
```
$p=1;$args|group|? C* -eq 1|%{$p*=$_.Name};$p
```
[Try it online!](https://tio.run/##PY9hC4JADIa/368YMkPlCtQ0SCSh7/0Fkbrsg@F1KgXqb7fd5TVeNnjebWyyfQvVPUTTLHiHHMYFZR5mWKm6m2rVDnI6wTmArXhBOLkjyiDHcnepnmLOUC4zY4XHgIJ7Iady4Eb@yhLNYq6VWBZpRiklWbZf@6jGlqWa0dLIMB8mcGE0HoqPFNde3DiYS@lwLH@OEt3Q9AQ29E@hTcMd9FaLPvmP@0c74LB5@QI "PowerShell – Try It Online")
[Answer]
# Python 3, ~~[63](https://tio.run/##DchLCoAgEADQqwyunJAgXASBJ6kW9pGMyQmzsNNbb/nON20cdHFgYChkj2mxQN36WJKiEvXOPsgrRZnRcYQMPgCBd0D1zHdI/xvTIEfRCCxn9H852bdKKz0ilg8)~~ ~~[62](https://tio.run/##XcvLCsIwFIThvU8xZJVIKDTxAmKfRF3ESzByzCkxlfr0MSgIFv7Vx0z/yleOtnh02Bdy9@PZgTaXpyMp5qK5cYjykZMcleeEESGCEDyoOfEQc/WtUZxEK1TpU6ji5W6tYWsHpWY/sx9b/pnRWNWmu8X022qYr5U3)~~ 61bytes
```
lambda l:prod(x for x in l if l.count(x)<2)
from math import*
```
You can [try it online](https://tio.run/##PclBCoMwEEbhvaf4l0kRobopRU9iu4iVwUCSGYYI6emjuHD5vif/vHEaXqKVMOFTg4vL6hDeoryaAmJFgU8I8ITQ/XhP2RQ79rYh5Yjo8gYfhTU/qqg/L5n52fbt8LW2ueXsS@oB)!
Thanks @FryAmTheEggman for saving me 1 byte.
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 31 bytes
```
#&@@Times@@Tally@#~Cases~{_,1}&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b7X1nNwSEkMze1GEgl5uRUOijXOScWpxbXVcfrGNaq/Q8oyswriU6LrjbXAcLa2FguuIixjrGOKYqIkY6ZjhmaGhMdYxQRQx0jsMh/AA "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 27 bytes
```
{[*] .Bag.grep(0=>1)>>.key}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/OlorVkHPKTFdL70otUDDwNbOUNPOTi87tbL2f3FipYIeUFVafhGXhrmOAghp6nBpGOsoAJEpiGmko2AGRCCmIZBtqaNgCOT8BwA "Perl 6 – Try It Online")
(Using a `Pair` as matcher compares only values and ignores the key.)
[Answer]
# [PHP](https://php.net/), ~~92~~ 79 bytes
```
fn($a)=>array_product(array_keys(array_intersect(array_count_values($a),[1])));
```
[Try it online!](https://tio.run/##Vc5dS8MwFAbga/MrXkYvGsgYrftQaueV4IXg7rtSQpbSqSQhSYUh/vaa1CodnIuT5@R8mM4MD4@mMyRpy6FVacJpuefW8ktjrD71wqe/r3d5cVN6Vl5aJ/9LQvfKN5/8o5cuDmBVVlNKi6EgJPHSeYcSFbmpsGNjoGYAViss98ii37IYm7lvoucM2xBzz6f/69Ay93X0jMWWK9@OHvSeIRsnTXt3@R2pw4WttpKLLsV0KnchA8UXAaToNN6cVo1UQp9kOpYYFkd/9AuGpP2Tw/OheXp9Kcj38AM "PHP – Try It Online")
This isn't going to win for brevity, but just thought I'd try it entirely using chained PHP array functions.
Now using @Guillermo Phillips's suggestion for PHP 7.4 arrow function syntax to save 13 bytes.
# [PHP](https://php.net/), 66 bytes
```
fn($a,$b,$c)=>$a-$c?$a-$b?$b-$c?$a*$b*$c:$a:$b==$c?:$c:$b==$c?:$b;
```
[Try it online!](https://tio.run/##Vc9Ba4MwFAfw8/Ip/pR3sOXVoqvtpks9DXYYrPe2lCSNyA4q09vYZ88S68CRR3j5Je8l6erOvZRd3QlBg@2HHhIn8XDCnsfAhQFsNlgfkAR/5BDZ3LPgKWPnY@7pdH7rS@a@DZ5wKPnnu9G9PjOSsdN07z59EpdC@CdW0lVNRIpJM5mlPJBakynDrEvS93xFekUmJ5WTltJTHlZ/qS6cb1W1X1aZOsL0a9X7DEt8C8CausVn3zZX25j2ZqNxi7E4D@dhwaAqQhzHdzy@Ha@vH@@F@BHOJX5kvw "PHP – Try It Online")
And another crazy ternary version inspired by [@Guillermo Phillips's answer](https://codegolf.stackexchange.com/a/199247/84624)!
[Answer]
# [Burlesque](https://github.com/FMNSSun/Burlesque), 24 bytes
```
psJ{{1j}qfcqpd}M-jNBL[!!
```
[Try it online!](https://tio.run/##SyotykktLixN/f@/oNirutowq7YwLbmwIKXWVzfLz8knWlHx/39DBSMFY1MA "Burlesque – Try It Online")
```
ps     # Parse to list
J      # Duplicate
{
 {1j}  # Push 1 & swap
 qfc   # Find least common element
 qpd   # Product
}M-    # Create array applying each function to make each element
       # {{Original list}, 1, least common, product}
jNB    # Remove duplicates from original list
L[     # Find length
!!     # Select that element from the array 
       # (zero indexed, hence the push swap to fill zero)
```
# Burlesque, 31 bytes
```
psJU_qpd{f:{-]1==}fe[~}IEisq1if
```
[Try it online!](https://tio.run/##SyotykktLixN/f@/oNgrNL6wIKU6zapaN9bQ1rY2LTW6rtbTNbO40DAz7f9/MwUgBAA "Burlesque – Try It Online")
Can probably be golfed further.
```
ps      # Parse to array
JU_     # (Non-destructive) is each element unique?
qpd     # boxed product
{
 f:     # Frequency (returns {{count val} ...})
 {
  -]1== # Count == 1
 }
 fe     # Find element where
 [~     # Take the tail
}
IE      # If unique then product, else find single
is      # Is an error (i.e. single not found)
q1      # boxed 1
if      # If error, push 1
```
[Answer]
# Mathematica, 40 bytes
```
f[l_]:=Times@@(If[Count[l,#]<2,#,1]&/@l)
```
You can [try it online](https://tio.run/##y00syUjNTSzJTE78/z8tOic@1so2JDM3tdjBQcMzLdo5vzSvJDpHRznWxkhHWccwVk3fIUfzf0BRJlA4LbraUMdIx7g2NpYLLmKsYwwW@Q8A)!
[Answer]
# [Python 2](https://docs.python.org/2/), 52 bytes
```
l=input();r=1
for x in l:r*=1%l.count(x)or x
print r
```
[Try it online!](https://tio.run/##JU3LCsIwELzvV@xF2soitNUKlRzr1Ys/oHGlwZCEJcX262OCh2GGeTBhi7N3XdL@xaiwqqpklXFhiXVzEdXC2wuuaBzaUfaq3dmD9ouL9dqUAIIYF1FSHgJ8Z2MZ77LwCIhRtkKIvLLGcgBFaw4Rp9t1EvHyLzyFH590pp56yKATdDTQkPUxOy111P8A "Python 2 – Try It Online")
[Answer]
# [Bash](https://www.gnu.org/software/bash/) + GNU utilities, 26
```
sort|uniq -u|dc -e1?*?*?*p
```
The 3 input integers are each given on their own line.
In the case of non-distinct inputs, `dc` warnings are printed to stderr. These may be ignored.
`uniq -u` does most of the heavy lifting here. With the `-u` option, only non-duplicated lines are returned. uniq requires its input to be `sort`ed.
The `dc` expression pushes 1 to the stack, then reads up to 3 integers, multiplying each in turn, then `p`rinting the output. If uniq pipes less than 3 integers to dc, then the surplus `?` will not add to the stack and the following `*` will spit out a warning because \* needs to pop 2 operands from the stack. But these are just warnings, dc continues execution until it prints the final product.
[Try it online!](https://tio.run/##FYa9DkAwAAb3PsUXYZEYqJ/BYLIZxCaxoBVNpKUllr571V1yuWU2u3t3cXBoPrMaTBF4Ti3kvSGIzCQDhEPbdyMsJmeUvu0jxYXksWxFwtMm/j0dU5K7Cl5CQVGQDCVK/zkoSZH5fg "Bash – Try It Online")
[Answer]
# [C#](https://docs.microsoft.com/en-us/dotnet/csharp/), 60 bytes
```
int f(int a,int b,int c)=>a==b?a==c?1:c:a==c?b:b==c?a:a*b*c;
```
[Answer]
# TI BASIC, 45 Bytes
```
Prompt A,B,C
ABC
If A=B
C
If A=C
B
If B=C
A
If A=B and A=C
1
Ans
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 6 bytes
```
≡ᵍ~gˢ×
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/pfXa6koGunoFRu/6htw6Ompoe7Omsfbp3w/1Hnwodbe@vSTy86PP3//@hocx0FEIrViTbWUQAiUyDLSEfBDIggYiZAYSDLUEfBCMoC0pY6CoZmsbEA "Brachylog – Try It Online")
```
 ᵍ        Group elements by
≡         value.
    ˢ     For each group,
  ~g      if it is a singleton list, extract its only element,
    ˢ     else discard it.
     ×    Take the product.
```
[Answer]
# [Factor](https://factorcode.org/) + `sets.extras math.unicode`, 20 bytes
```
[ non-repeating Π ]
```
[Try it online!](https://tio.run/##TYpLCgIxEAX3c4p3AQMz/lAPIG7ciCtx0cRWg0wSkx5QhrmLJ/JKMYq/Lt6iqN6TFhfSerVYzqeILFHxRQJF1CRH1Vij3Y5zODdsNUf4wCJXH4wVzIqiLZCvxfhF97Z@Zvi1CqPMrw3yPlbm@mcVJiifv13awDrbC@yZxNgD7jdsU00eUUifVHoA "Factor – Try It Online")
Factor has a word `non-repeating` that gives you every element of a sequence that doesn't repeat. Turns out the answer to this question is just taking the product of this.
[Answer]
# MMIX, 48 bytes (12 instrs)
```
foo CMP $255,$0,$1
    CMP $3,$1,$2
    BZ  $255,0F     // if(a == b) goto ab
    BZ  $3,1F       // if(b == c) goto bc
    CMP $255,$0,$2
    BZ  $255,2F     // if(a == c) goto ac
    MUL $0,$0,$1    // a *= b
    MUL $0,$0,$2    // a *= c
1H  POP 1,0         // bc: return a
0H  CSZ $2,$3,1     // ab: if(b == c) c = 1
    POP 3,0         // return c
2H  POP 2,0         // ac: return b
```
[Answer]
# [Thunno 2](https://github.com/Thunno/Thunno2), 4 [bytes](https://github.com/Thunno/Thunno2/blob/main/docs/codepage.md)
```
cḅịp
```
[Try it online!](https://Not-Thonnu.github.io/run#aGVhZGVyPSZjb2RlPWMlRTElQjglODUlRTElQkIlOEJwJmZvb3Rlcj0maW5wdXQ9JTVCNyUyQyUyMDclMkMlMjA3JTVEJTIwLSUzRSUyMDElMEElNUIzJTJDJTIwMyUyQyUyMDUlNUQlMjAtJTNFJTIwNSUwQSU1QjIlMkMlMjA2JTJDJTIwNiU1RCUyMC0lM0UlMjAyJTBBJTVCMyUyQyUyMDQlMkMlMjAzJTVEJTIwLSUzRSUyMDQlMEElNUIxJTJDJTIwMiUyQyUyMDMlNUQlMjAtJTNFJTIwNiUwQSU1QjEyJTJDJTIwOSUyQyUyMDE2JTVEJTIwLSUzRSUyMDE3MjgmZmxhZ3M9Qw==)
#### Explanation
```
cḅịp  # Implicit input
c     # Counts of each number
  ị   # Only keep items of the input
 ḅ    # where the count equals 1
   p  # Product of this list
```
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 97 bytes
```
param($n)$a,$b,$c=$n|group;(($n-join'*'|iex),(($a,$b|?{$_.count-eq1}).name,1)[$a.count-eq3])[!$c]
```
[Try it online!](https://tio.run/##PcpRCsIwDADQswiBNZINxvRLZN5jDIkl6GRLa3UoWM8e54@/jxfDU9L9IuNoFjnx5EARmOBE4Peg@ZzCHHdu4fIaBi3WRR7khbTIb@X2DcfKh1kfpdzqD1bKk1CNHfCfmx67FfjezA6uoS1t8As "PowerShell – Try It Online")
Not terribly impressive, but given that PowerShell doesn't have a ternary operator like JavaScript, nor the same `for` structure as Python, I don't think this is too bad.
We take input `$n` as an array, then feed that into `Group-Object`, which stores the (potentially) three values into `$a, $b, $c`. Then we use array-indexing as a pseudo-ternary. We work "backwards" on the function definition given in the challenge, starting from the bottom. If we have a `$c`, then we have three unique values, so we `-join` `$n` with `*` and `iex` it (similar to `eval`). Otherwise, we have at least a duplicate, so we re-index whether `$a`'s `.count` is `-eq`ual to `3`. If it is, then all three values are the same, and we output `1`. Otherwise, we pull out the lonely value (i.e., its `.count` is `-eq`ual to `1`) and output its `.name`. In any case, the result is left on the pipeline and output is implicit.
[Answer]
# [Perl 5](https://www.perl.org/) `-MList::Util=product -apl`, ~~45~~ 44 bytes
*@FryAmTheEggman saves a byte*
```
$_=product(grep{$t=$_;2>grep$t==$_,@F}@F)||1
```
[Try it online!](https://tio.run/##K0gtyjH9/18l3ragKD@lNLlEI70otaBapcRWJd7ayA7EAbKBHB0Ht1oHN82aGsP/1qrZthqa1v/NFYCQy1jBWMGUy0jBTMEMyDZRMOYyVDBSMP6XX1CSmZ9X/F/X1yezuMTKKrQkMwdmyX/dxIIcAA "Perl 5 – Try It Online")
]