g | x | w | all
Bytes Lang Time Link
027AWK250331T162546Zxrs
002Thunno 2230614T173040ZThe Thon
004GolfScript230224T141727Zemirps
011Julia 1.0230223T141409ZAshlin H
nanPiet + asciipiet230224T061936ZAiden Ch
022Alice230224T034235ZJulian
006Pyt230224T015455ZKip the
091Pascal230224T015012ZKai Burg
010K ngn/k221014T084800Zoeuf
011Factor221014T081230Zchunes
001Vyxal221014T075921ZDialFros
nanPxem210322T104653Zuser1004
024Dash210322T084527Zuser1004
2923Rust180923T112143Znull
038PHP201017T231546ZZsolt Sz
017Rust190101T002525Zdon brig
003Husk201016T205546ZLegionMa
022JavaScript180903T102552ZShaggy
002MathGolf180925T065942Zmaxb
005Pyth181006T173130ZTryer
077Pepe180923T110517Zu-ndefin
005Braingolf180927T042316ZFatalErr
032C clang180922T143855Zuser3604
038Lua180921T185400ZMarcio M
006Jelly180907T162207ZKitten H
023JavaScript180922T193038Zguest271
252Common Lisp180920T202945ZRenzo
029Math++180920T191451ZSuperJed
067JavaScript Node.js180914T104708Zuser5812
002Jelly180920T173023Zdylnan
014q180920T171741ZThaufeki
026Haskell180920T003452ZMatt R
002Python180919T140454ZMilbrae
003Stax180919T134059ZMulti
017><>180904T084817ZPidgeyUs
012Pari/GP180914T053713Zalephalp
025Powershell180905T145509Zmazzy
006Brachylog180910T101640ZKroppeb
011Ruby180910T100848ZG B
024SmileBASIC180908T000404Z12Me21
091brainfuck180907T235029ZPrismo
003Pyth180907T164031Zuser4854
024Julia 1.0180907T154448Zgggg
004K oK180905T151225Zmkst
037SWIFT 37 Bytes180905T071437ZLeena
039TSQL180905T204023ZBradC
026C gcc180904T161017Zgastropn
013R180904T085008ZJ.Doe
021Red180905T074641ZGalen Iv
004J180905T073850ZGalen Iv
025Cubix180904T084036ZLuke
013Mathematica180904T112121ZLegionMa
027Java 9180904T012401ZQuintec
020R180904T121805ZKirill L
025Flobnar180904T061933ZJo King
041C gcc180904T080934Zetene
016Ruby180904T075227ZG B
030PHP180904T030149ZTitus
010Attache180904T022742ZConor O&
007Perl 6180903T232809Znwellnho
032Clean180903T213230ZΟurous
014Charcoal180903T122942ZNeil
017Triangularity180903T112551ZMr. Xcod
00205AB1E180903T105708ZKevin Cr
020Python 3180903T100547ZTFeld
003Japt N180903T102416ZShaggy
003APL Dyalog Unicode180903T101958ZAdá

AWK, 27 bytes

1,$0=$1!~$2&&$2!~$3&&$1!~$3

Attempt This Online!

35 bytes but will work for arbitrarily long string:

{for(x=1;i++<NF;)x*=!b[$i]++}1,$0=x

Attempt This Online!

Thunno 2, 2 bytes

Explanation

U   # Uniquify the input list
ċ   # Or, take the set union of the input list with itself
ȯ   # Or, take the set intersection of the input list with itself
 ⁼  # Then, check if this new list is equal to the input list

GolfScript, 4 bytes

..|=

Try it online!

Input is taken as an array of three numbers

Explanation

..|=
 .|  # Setwise OR the input array with itself
.  = # Is it equal to the initial input?

Julia 1.0, 18 11 bytes

~x=x==x∪x

Try it online!

-7 bytes (!!) thanks to MarcMush: replace length(x∪x)>2 with x==x∪x

Piet + ascii-piet, 37 bytes (24×2=48 codels)

TAbTlTiTrTtTLDqMmMEuAkAaAqQIBSAMVcRrr

Try Piet online!

Probably not the golfiest that could happen but manipulating the stack order in Piet is a bit of a pain.

Pointer Path

Alice, 22 bytes

3&/ M \.!-~?-Zn'0+O@
 

Try it online!

3&/ M \                   Reads the three arguments and puts them on the stack
       .!-~?-             Compares the two last arguments, then the first with the last
                          It leaves [0, 0] on the stack if the two numbers are the same
                          Otherwise any other pair of numbers
             Z            Packs the two numbers together [0, 0] yields 0
              n           Logical not, if the pack result is 0 return 1 and any other number returns 0
               '0+O@      Output and bye

Pyt, 6 bytes

ĐỤ=Ʃ3=

Try it online!

Đ         implicit input; Đuplicate
 Ụ        get Ụnique items
  =       is equal element-wise?
   Ʃ      Ʃum of list (coerce booleans to ints)
    3=    is equal to 3?; implicit print

Pascal, 91 B

This is a complete program conforming to ISO standard 10206 “Extended Pascal” and at 91 bytes certainly more readable than brain****.

program p(input,output);var x,y,z:integer;begin read(x,y,z);write(ord(card([x,y,z])=3))end.

The [x,y,z] denotes a set, thus duplicate values get collapsed. This means, the set literal [4, 4, 4] is identical to [4]. The card function returns the number of distinct elements in the set. Here this will be anything between 1 and 3 inclusive. We test for equality to 3 (… = 3) which evaluates to a Boolean expression (denoted by the built-in constants false and true) and convert this enumeration value into an integer using ord.

K (ngn/k), 10 bytes

{(#x)=#?x}

Try it online!

A little bit more interesting answer in my opinion, but still boring. Takes a list of integers as input.

Explanations:

{(#x)=#?x}  Main function. x is input
       ?    Unique (Remove all duplicated elements)
      #     Length
     =      Is it equal to
 (#x)       The length of x itself

Factor, 11 bytes

all-unique?

Try it online!

Vyxal, 1 byte

Try it Online!

Easy peasy

Pxem, Filename: 28 bytes + Content: 0 bytes = 28 bytes.

Try it online! (with pxem.posixism)

With comments

XX.z
# for three times; do push( read integer); done
.a._._._XX.z
# call subroutine
## NOTE. When DOT-e is performed when stack is a,b,c,bottom,
## then subroutine begins with same content of stack
## And when subroutine ends when stack is d,e,f,bottom,
## then previous stack would be d,e,f,a,b,c,bottom
## to continue origimal procedure
## In this program content is empty, so is subroutine
## thus x,y,z,bottom to x,y,z,x,y,z,bottom,
## which duplicates entire stack
.a.eXX.z
# while size < 2 && pop != pop; do
.a.zXX.z
  # dup; dup; while size<2 && pop!=pop; do
  ## this is equal to while stack is empty; do
  .a.c.c.zXX.z
    # push '1'; putc pop; exit
    .a1.o.dXX.z
  # done
  .a.aXX.z
# done
.a.aXX.z
# push '0'; putc pop; (implicity) exit
.a0.oXX.z
.a

Dash, 27 24 bytes

$(($1-$2&&$2-$3&&$3-$1))

Try it online!

Sorry for a boring answer; at first if bashism would work, but I could not get out of POSIXism.

The code above evaluates to a string of either 0 or 1.

Rust, 29 23 bytes

|a,b,c|a!=b&&b!=c&&a!=c

Try it online!

PHP, 38 bytes

echo(4==count(array_unique($argv)))*1;

Called with e.g. php codegolf.php 2 3 4. $argv always contains the filename of the script, hence 3 unique numbers make 4 elements.

Rust, 17 bytes

Anything XORd with itself yields zero. So. Any language with multiplication and XOR can do this:

(a^b)*(b^c)*(a^c)

Since input specifics were rather vague I chose a liberal interpretation. Or if you want to be more strict, we can define it as a closure (kind of like a lambda function),

24 bytes

|a,b,c|(a^b)*(b^c)*(a^c)

Try it on the Rust Playground

Husk, 3 bytes

S=U

Try it online! Takes the three numbers in a list.

JavaScript, 22 bytes

If we can output boolean values then the last 2 bytes can be removed.

a=>new Set(a).size>2&1

Try it online

For the same byte count, this works on arrays of any size but assumes the input will never contain a 0 and output is a boolean.

a=>!a[new Set(a).size]

Try it online

MathGolf, 2 bytes

▀=

Try it online!

Explanation

▀    Get unique elements
 =   Check if equal to the input

Pyth, 5 bytes

s<2l{

Try it online!

Looks like someone already did pyth but I didn't know about the I for testing invariants.

Pepe, 85 77 bytes

rEeEREeErrEEEEEeRrEeErrEEEEEerEEEEEEERerEEEEEerRrEEEEEEeErREEREEEEErEeReeReEE

Try it online! Input is a,b,c. Change the "separated by" box to , to make it work!

Braingolf, 5 bytes

ul3-n

Try it online!

Edit: fixed from identical -> distinct

C (clang), 32 bytes

f(a,b,c){return a!=b&b!=a&a!=c;}

Try it online!

Lua, 38 bytes

x,y,z=...print(x~=y and x~=z and y~=z)

Try it online!

Jelly, 5 6 bytes

ɠḲQL=3

Try it online!

From 5 to 6 bytes because this is my first time and I messed up (whoops) fixed it now

ɠḲQL=3
^^^^^
||||Is it equal to three?
|||How many unique numbers do we have? (length of unique numbers array)
||Sort By Unique
|Split by Spaces
Read Input

JavaScript, 25 24 28 27 23 bytes

Using bitwise, comparison and logical operators Try it online!

(4 bytes saved courtesy of Jonathan Frech)

(a,b,c)=>a!=b&a!=c&b!=c

Common Lisp, 25 2 bytes

/=

Try it online!

-23 bytes thanks to @ceilingcat!

Math++, 40 29 bytes

?>a
?>b
?>c
(a-b)&(b-c)&(a-c)

JavaScript (Node.js), 67 bytes

f=a=>a.map((m,i)=>a.map((n,j)=>m==n&i!=j).every(z=>!z)).every(y=>y)

Try it online!

Jelly, 2 bytes

Try it online!

q 14 bytes

{x~distinct x}

Technically this solution will return '1b' or '0b', which is the way a boolean value is distinguished from a numeric type, though it retains all arithmetic functionality, and so is in essence a 1 or 0:

q)1b +35
36

To return 1 or 0 non-boolean you have the below, which takes the byte count to 21

{$[x~distinct x;1;0]}

Haskell, 26 bytes

g a b c=and$map(==)[a,b,c]

Python 2

def e(a,b,c):return 1 if len(set([a,b,c]))>2 else 0

...could be shortened to

def e(a,b,c):return len(set([a,b,c]))>2

Stax, 3 bytes

ä▼Z

Run and debug it

Explanation

ux=         #Full program, unpacked, implicit input as array
u           #Keep only unique elements in array, maintaining first order of appearance
 x=         #Copy original input onto stack, is it equal to unique-ified array.

Short and sweet. Wish Stax would implicitly check against "X" register if there was nothing to check against, but it works out regardless.

><>, 19 17 bytes

-2 bytes by Jo King.

:{:{:{=}=}=++0=n;

Try it online!

Pari/GP, 12 bytes

a->#Set(a)>2

Try it online!

Powershell, 27 25 bytes

-2 bytes thanks @AdmBorkBork

+!(($args|group).Count-3)

Test script:

$f = {
+!(($args|group).Count-3)
}

&$f 1 2 3
&$f 3 2 1
&$f 2 1 3
&$f 2 2 3
&$f 2 1 1
&$f 2 1 2

Explanation:

    $args|group           # Group arguments
   (           ).Count    # Count of groups 
  (                   -3) # is 0 if inputed integers are unique
 !                        # operator not converts int to boolean: true if integers are unique
+                         # converts boolean to int: 1 if integers are unique, otherwise 0

Brachylog, 6 bytes

d?∧1|0

Try it online!

short explanation

d? deduplcates input an test if still equal to input(?)

∧1 if true return 1

|0 else return 0

Ruby, 11 bytes

->a{a==a|a}

Try it online!

Assuming we can return a boolean. Which everyone is doing nowadays.

SmileBASIC, 25 24 bytes

READ A,B,C?A-B&&B-C&&C-A

brainfuck, 91 bytes

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

Try it online!

How it works

,>,>,                   'read input as A, B, and C
[-<-<->>]>>+            'compute A-C, B-C
++++++[>+++++++<-]+     'prepare output
<<<<[>]>>               'if A-C != 0 && B-C != 0
[
    <<<[-<->]           'compute A-B
    <[>]>>->            'if A-B != 0
    [>.<<<->>-]         'print 1
    <+
]
<+
[                       'else (this else is for both of the if statements, even though they are nested... wierd, I know)
    >>>[>]              
    <-.>                'print 0
]

Pyth, 3 bytes

s{I

Takes input as a list.
Try it here

Explanation

s{I
 {IQ     Check if the (implicit) input is invariant under deduplication.
s        Cast to int.

If we're allowed to treat True and False as 1 and 0 (which they are under the hood in Pyth), we can drop the s to get down to 2 bytes.

Julia 1.0, 24 bytes

f(x...)=length(Set(x))>2

Try it online!

K (oK), 4 bytes

3=#?

Try it online!

Does the count of the distinct elements equal 3?

SWIFT 37 Bytes

Set(Array(readLine()!)).count==3 ?1:0

T-SQL, 39 bytes

SELECT IIF(a=b OR b=c OR c=a,0,1)FROM s

Input is taken as separate columns a, b, c from a pre-existing table s, per our IO standards.

Tried a variation using COUNT DISTINCT from input taken as separate rows, but that was a couple bytes longer.

C (gcc), 25 26 bytes

f(a,b,c){a=a-b&&a-c&&b-c;}

Try it online!

R, 13 bytes

A different solution to @Kirill by using mad() for an unintended purpose!

mad(scan())>0

Try it online!

Red, 21 bytes

func[b][b = unique b]

Try it online!

J, 4 bytes

-:~.

Try it online!

Explanation:

Is the argument equal -: to itself after removing the duplicates ~.

Cubix, 55 25 bytes

-29 thanks to Jo King

O@O1u|@O@II-!/;I-!/;u^?-p

Try it online!

It should be possible to golf off quite a few bytes.

Mathematica, 13 bytes

Boole[E!=##]&

Pure function. Takes three integers as input and returns 0 or 1 as output. I know that this is rather similar to David G. Stork's answer, but it exploits SlotSequence to shave off a byte (as compared to Boole@*Unequal).

Java 9, 43 27 bytes

thanks to @Olivier Grégoire

(a,b,c)->a!=b&b!=c&a!=c?1:0 

Previous attempt:

(a)->a[0]==a[1]||a[0]==a[2]||a[1]==a[2]?0:1

R, 24 22 20 bytes

all(table(scan())<2)

Try it online!

Returns a boolean, but as folks have already discussed on the Python answer, this should be OK.

Thanks to digEmAll for saving 2 bytes.

Flobnar, 25 bytes

$-<*\\\!!@
::*<&&&
-$$>
$

Try it online!

Given integers a,b,c, evaluates !!((c-b)*(b-a)*(c-a))

C (gcc), 50 41 bytes

-9 bytes thanks to GB !

m(int*a){a=*a==a[2]^*a==*++a^*a==*++a^1;}

Try it online!

No built-in sets in C, and iterating is too long, but at least i can shave off a few bytes by taking advantage of the fact that *a == a[0] ...

Ruby, 16 bytes

->a{1-(a<=>a|a)}

Try it online!

PHP, 30 bytes

<?=array_unique($argv)==$argv;

takes input from command line arguments; prints 1 for truthy, empty string for falsy

Attache, 10 bytes

`==#Unique

Try it online!

This is a fork of the operator `== and Unique, equivalent to:

{ _ == Unique[_] }

Alternatives

{#_=#Unique[_]} (15 bytes)

Any##Same=>Pairs@Sort (21 bytes)

Any@{`=&>_[[0'1,1'2,2'0]]} (26 bytes)

&${not(x=y or y=z or x=z)} (26 bytes)

&${x/=y and y/=z and x/=z} (26 bytes)

{Any!Same=>Chop&2!_[0'1'1'2'2'0]} (33 bytes)

Perl 6, 7 bytes

*.Set>2

Try it online!

Clean, 32 bytes

import Data.List
$l|hasDup l=0=1

Try it online!

Charcoal, 14 bytes

≔E³NθI¬⊖⌈Eθ№θι

Try it online! Link is to verbose version of code. 5 bytes could be saved by using a slightly non-standard input format [[x, y, z]]. Explanation:

≔E³Nθ

Input 3 numbers and make a list.

I¬⊖⌈Eθ№θι

Count the number of occurrences of each number in the list. Take the maximum, subtract 1, take the logical not, then cast to string for implicit print.

Triangularity, 17 bytes

..i..
.MiC.
}u)3=

Try it online!

How it works

Excluding the mandatory triangular padding, we're left with:

iMiC}u)3=

Which can minimally be explained as: Push all STDIN as an array of strings (representing each line of input), count the occurrences of all of STDIN's elements in itself (which, in case all are distinct, should yield [1, 1, 1]), sum, then check whether the sum is equal to 3. There are 2 tricks here (which together save no less than 14 bytes):

05AB1E, 2 bytes

ÙQ

Try it online or verify some more cases.

Explanation:

Ù     # Uniquify the (implicit) input
 Q    # Check if it's still equal to the (implicit) input

Python 3, 23 21 20 bytes

lambda*a:len({*a})>2

Try it online!

Japt -N, 3 bytes

eUâ

Try it


Explanation

deduplicates the input and e tests if it's equal to the original.

APL (Dyalog Unicode), 3 bytesSBCS

Anonymous tacit prefix function. Takes list as argument.

∪≡⊢

Try it online!

 does the set of unique elements from the argument

 match

 the unmodified argument?