Are all three integers distinct?

14

2

You will be given 3 integers as input. The inputs may or may not be different from each other. You have to output 1 if all three inputs are different from each other, and 0 if any input is repeated more than once.

This is , so make your code as short as possible!

subin saju

Posted 2018-09-03T10:00:53.710

Reputation: 309

1Welcome to PPCG. Nice first challenge. We are quite strict about objective winning criteria on this site. [tag:code-golf] seems to be the obvious choice here, so I will add that to your post. Correct me if I'm wrong. – Adám – 2018-09-03T10:11:40.380

1Some test cases would be nice. – Adám – 2018-09-03T10:17:08.097

19Whoever is downvoting all answers should at least explain why... – Arnauld – 2018-09-03T10:41:42.660

1@Adám I think a more accurate title would be Are all three integers distinct? – Arnauld – 2018-09-03T10:45:56.040

1@Arnauld Yes, you're right. Fixed. – Adám – 2018-09-03T10:53:48.960

5

My dupe-vote is a hammer, but Possible duplicate of "Determine if all decimal digits are unique" Slightly different, but most answers can still be ported.

– Kevin Cruijssen – 2018-09-03T11:02:13.460

@Adám According to the meta consensus, we should tell the OP to add the winning criteria themself. – user202729 – 2018-09-05T13:02:35.433

1its not a duplicate, the small amount of input yields to different solutions. id wager if you asked this to electrical engineers youd get a whole different approach to the answer (primarily due to the small number of inputs).. i realize the golfing languages all have de-dup but there is still something to be said for the 'normal' languages and what people's backgrounds are. – don bright – 2019-01-01T00:32:18.920

Answers

10

Python 3, 23 21 20 bytes

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

Try it online!

TFeld

Posted 2018-09-03T10:00:53.710

Reputation: 19 246

OP asked for 1 vs. 0, so maybe you need one more byte: lambda*a:len({*a})//3 – tsh – 2018-09-04T02:53:08.083

@tsh in Python 1 == True, I think there's a meta post about it somewhere – Stephen – 2018-09-04T04:14:36.647

1

@tsh - relevant meta "if it quacks like a number, it's a number" - in Python: False * True is 0; False + True is 1; etc...

– Jonathan Allan – 2018-09-04T07:09:30.973

From the relevant meta: "this does not apply to challenges where an exact string output is required", so I'm not sure what really applies here. – G B – 2018-09-06T06:39:24.163

8

Perl 6, 7 bytes

*.Set>2

Try it online!

nwellnhof

Posted 2018-09-03T10:00:53.710

Reputation: 10 037

8

R, 13 bytes

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

mad(scan())>0

Try it online!

J.Doe

Posted 2018-09-03T10:00:53.710

Reputation: 2 379

1Well input is not specified at all, so IMO accepting 3 values as input means we can accept a vector – digEmAll – 2018-09-04T10:14:50.600

2R almost competing with golf languages ! :D – digEmAll – 2018-09-05T15:59:35.247

1I believe Gauss invented mad exactly for this purpose. – ngm – 2018-09-07T14:21:45.053

5

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

Shaggy

Posted 2018-09-03T10:00:53.710

Reputation: 24 623

Assuming that we can take the input as an array and return a Boolean: a=>new Set(a).size>2 – Arnauld – 2018-09-03T10:42:33.030

@Arnauld, yeah I had that too but as it stands the spec won't allow it - will be updating if the spec changes, though. – Shaggy – 2018-09-03T10:46:56.347

Oh, wait. I can just tack on &1 for 22 bytes. – Shaggy – 2018-09-03T10:48:12.133

5

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.

Kirill L.

Posted 2018-09-03T10:00:53.710

Reputation: 6 693

220 bytes porting the R solution to a very similar question – digEmAll – 2018-09-04T13:28:21.947

11 bytes - if you are allowed to have any number > 0 as truthey. Otherwise, append >0 for TRUE/FALSE output in 13 bytes. – J.Doe – 2018-09-05T08:22:39.477

1Wow, didn't even know about this function. I'd suggest you post it separately (edit and revive your deleted answer), but I think you have to stick with 13 bytes - while T/F indeed acts like 1/0, 1.48 doesn't. – Kirill L. – 2018-09-05T08:52:58.790

4

Ruby, 16 bytes

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

Try it online!

G B

Posted 2018-09-03T10:00:53.710

Reputation: 11 099

-3 bytes with uniq! – benj2240 – 2018-09-07T21:11:57.813

Boolean and Integer are different types in Ruby. – G B – 2018-09-10T10:11:21.067

Ah, you're right. I didn't read the challenge closely enough, and assumed a truthy/falsey output would suffice. – benj2240 – 2018-09-10T16:16:11.283

4

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.

Luke

Posted 2018-09-03T10:00:53.710

Reputation: 4 675

26 bytes – Jo King – 2018-09-04T12:23:48.163

Thanks a lot. I managed to shave off 1 more byte to arrive at 25 bytes in total – Luke – 2018-09-04T14:52:58.680

I think you might be missing a @ in place of the . in the 9th spot. Makes it do some funky things for 1 2 2. – MickyT – 2018-09-04T19:02:49.673

3

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

Kevin Cruijssen

Posted 2018-09-03T10:00:53.710

Reputation: 67 575

Using standard truthy/falsy rules for [tag:decision-problem], keeping in mind that 1 is the only truthy value in 05AB1E, ¢P works as well as an alternative 2-byter. – Mr. Xcoder – 2018-09-03T11:13:19.613

1@Mr.Xcoder I'm not sure that's actually currently valid - the question asks for outputs 1 and 0 - 4, for example, is neither 1 nor 0, nor does not act like 1 or 0 (like True and False do in Python). The question should probably ask for Truthy/Falsey but at present it does not. – Jonathan Allan – 2018-09-04T07:24:20.717

3

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).

LegionMammal978

Posted 2018-09-03T10:00:53.710

Reputation: 15 731

3

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
]

Prismo

Posted 2018-09-03T10:00:53.710

Reputation: 121

2

Japt -N, 3 bytes

eUâ

Try it


Explanation

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

Shaggy

Posted 2018-09-03T10:00:53.710

Reputation: 24 623

2

C (gcc), 25 26 bytes

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

Try it online!

gastropner

Posted 2018-09-03T10:00:53.710

Reputation: 3 264

Fails on [4,2,3] – G B – 2018-09-05T08:17:32.883

@GB Quite right! – gastropner – 2018-09-05T13:53:13.347

2

J, 4 bytes

-:~.

Try it online!

Explanation:

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

Galen Ivanov

Posted 2018-09-03T10:00:53.710

Reputation: 13 815

2

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

mazzy

Posted 2018-09-03T10:00:53.710

Reputation: 4 832

126 bytes -- +(($args|group).count-eq3) – AdmBorkBork – 2018-09-10T17:50:52.877

great! and thanks – mazzy – 2018-09-10T17:53:13.610

2

K (oK), 4 bytes

3=#?

Try it online!

Does the count of the distinct elements equal 3?

streetster

Posted 2018-09-03T10:00:53.710

Reputation: 3 635

2

Jelly, 2 bytes

Try it online!

dylnan

Posted 2018-09-03T10:00:53.710

Reputation: 4 993

2

Common Lisp, 25 2 bytes

/=

Try it online!

-23 bytes thanks to @ceilingcat!

Renzo

Posted 2018-09-03T10:00:53.710

Reputation: 2 260

Thanks, @ceilingcat, I've updated the answer! – Renzo – 2018-09-22T13:06:20.483

1

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?

Adám

Posted 2018-09-03T10:00:53.710

Reputation: 37 779

1

Clean, 32 bytes

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

Try it online!

Οurous

Posted 2018-09-03T10:00:53.710

Reputation: 7 916

1

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

Quintec

Posted 2018-09-03T10:00:53.710

Reputation: 2 801

1Why not count it as 43 bytes – ASCII-only – 2018-09-04T02:06:53.077

127 bytes: (a,b,c)->a!=b&b!=c&a!=c?1:0. – Olivier Grégoire – 2018-09-04T09:03:05.010

Also, the first code (100 bytes) doesn't compile and uses == which is not applicable on String without issues which you encounter here (after compilation fix), and in the second code, Set.of method will throw IllegalArgumentException if any duplicate is provided. I'm tempted to -1 for not testing at all.

– Olivier Grégoire – 2018-09-04T09:11:54.127

@olivier Apologies-it was late and I mixed up a few different ideas in my head. As for Set.of, I was just experimenting with Java 9 kinks and don’t have Java 9 myself. I should’ve read the documentation more carefully, sorry about that. I’ll edit once I get on my computer. – Quintec – 2018-09-04T11:38:03.010

1

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)

Conor O'Brien

Posted 2018-09-03T10:00:53.710

Reputation: 36 228

1

><>, 19 17 bytes

-2 bytes by Jo King.

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

Try it online!

PidgeyUsedGust

Posted 2018-09-03T10:00:53.710

Reputation: 631

17 bytes – Jo King – 2018-09-04T12:13:50.757

I should have definitely caught that, thanks! – PidgeyUsedGust – 2018-09-06T12:36:48.863

@RushabhMehta Please do not golf other user's posts using other user's golfing suggestions. – Jonathan Frech – 2018-09-06T16:20:00.267

1

Red, 21 bytes

func[b][b = unique b]

Try it online!

Galen Ivanov

Posted 2018-09-03T10:00:53.710

Reputation: 13 815

1

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.

BradC

Posted 2018-09-03T10:00:53.710

Reputation: 6 099

1

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

Kitten Hugger

Posted 2018-09-03T10:00:53.710

Reputation: 11

1Hello and welcome to PPCG. Does your code also work for 3 integers, or is it only functional for three digits? – Jonathan Frech – 2018-09-07T16:58:51.050

@Jonathan Frech Sadly, it only works for three 1 Digit numbers, it does this by sorting the input by unique characters, then testing if the amount of unique characters is the same length as the input. Maybe there is a way to get it to work with any 3 integers, but I think this is a good attempt for me at least! – Kitten Hugger – 2018-09-20T16:00:39.720

2The challenge specifies You will be given 3 integers as input. which seems to render your answer invalid. – Jonathan Frech – 2018-09-20T16:43:54.580

@JonathanFrech Fixed it now! Was my first time doing this sort of thing so, I'm not the greatest at it. – Kitten Hugger – 2018-09-23T21:25:36.637

1

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.

user48543

Posted 2018-09-03T10:00:53.710

Reputation:

1

SmileBASIC, 25 24 bytes

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

12Me21

Posted 2018-09-03T10:00:53.710

Reputation: 6 110

1

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

Kroppeb

Posted 2018-09-03T10:00:53.710

Reputation: 1 558

1

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!

user58120

Posted 2018-09-03T10:00:53.710

Reputation:

Sorry, but J answer is already here and the code is exactly the same.

– Bubbler – 2018-09-21T06:21:54.700

my bad @Bubbler didn't see that coming. – None – 2018-09-21T06:36:17.267

changed to JS answer – None – 2018-09-21T09:14:25.040

@Bubbler Duplicate entries are not disallowed.

– Jonathan Frech – 2018-09-21T23:51:03.493

1

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]}

Thaufeki

Posted 2018-09-03T10:00:53.710

Reputation: 421

1{1&/0N>':x?x} – ngn – 2018-09-28T01:39:07.640

0

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):

  • Using i and treating the inputs as strings rather than integers – which is quite uncommon, as )IE is frequently used instead, taking input as a list.
  • Instead of checking whether they all are equal to 1 and then taking the product – or equivalently, taking the product and checking whether it is equal to 1 – this takes the sum and compares it with 3. Proving the validity of this method is obviously trivial: [1, 1, 1] is the only valid way to partition 3 into 3 positive integers summing to it and the contents of this list are always positive, as every element of a collection must occur at least once in it :P.

Mr. Xcoder

Posted 2018-09-03T10:00:53.710

Reputation: 39 774

0

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.

Neil

Posted 2018-09-03T10:00:53.710

Reputation: 95 035

0

PHP, 30 bytes

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

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

Titus

Posted 2018-09-03T10:00:53.710

Reputation: 13 814

0

Flobnar, 25 bytes

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

Try it online!

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

Jo King

Posted 2018-09-03T10:00:53.710

Reputation: 38 234

0

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] ...

etene

Posted 2018-09-03T10:00:53.710

Reputation: 448

141 bytes – G B – 2018-09-04T08:46:16.200

Thanks, I had thought about incrementing the pointer but couldn't figure out how to make it as short ! – etene – 2018-09-04T09:24:11.820

0

SWIFT 37 Bytes

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

Leena

Posted 2018-09-03T10:00:53.710

Reputation: 131

Your current answer is a snippet; either put a wrapper around it or call your language Swift REPL. – Jonathan Frech – 2018-09-07T14:31:07.033

0

Julia 1.0, 24 bytes

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

Try it online!

gggg

Posted 2018-09-03T10:00:53.710

Reputation: 1 715

0

Ruby, 11 bytes

->a{a==a|a}

Try it online!

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

G B

Posted 2018-09-03T10:00:53.710

Reputation: 11 099

0

Pari/GP, 12 bytes

a->#Set(a)>2

Try it online!

alephalpha

Posted 2018-09-03T10:00:53.710

Reputation: 23 988

0

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.

Multi

Posted 2018-09-03T10:00:53.710

Reputation: 425

0

Haskell, 26 bytes

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

Matt R

Posted 2018-09-03T10:00:53.710

Reputation: 31

2I don't think this works, can you provide an example on how your function is used? – flawr – 2018-09-22T15:51:11.370

0

Math++, 40 29 bytes

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

SuperJedi224

Posted 2018-09-03T10:00:53.710

Reputation: 11 342

1

I think the non-competing rule is a thing of the past.

– Jonathan Frech – 2018-09-21T23:48:14.303

1Also, could you provide an implementation link for Math++? – Jonathan Frech – 2018-09-21T23:49:55.977

@JonathanFrech OK, I just added a link to the esolang page; the article includes a link to the reference implementation. – SuperJedi224 – 2018-09-22T01:30:42.480

0

Lua, 38 bytes

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

Try it online!

Marcio Medeiros

Posted 2018-09-03T10:00:53.710

Reputation: 51

2

Unfortunately, this doesn't work for the case when y==z (returns true, should be false). You'll need to add a third test to check for that possibility.

– DLosc – 2018-09-21T21:16:19.137

Opposed to equality, inequality is not transitive, so $x\neq y\neq z$ does not imply $x\neq z$. – Jonathan Frech – 2018-09-21T23:45:10.920

Your answer in its current form is invalid. Please either fix or delete it. – Jonathan Frech – 2018-09-23T05:47:27.180

Thank you guys, I really didn't noticed it. – Marcio Medeiros – 2018-09-24T16:15:36.997

0

C (clang), 32 bytes

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

Try it online!

Logern

Posted 2018-09-03T10:00:53.710

Reputation: 845

The integers 0, 1, 2 are distinct, yet 0&... = 0. – Jonathan Frech – 2018-09-22T14:43:28.130

0

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

guest271314

Posted 2018-09-03T10:00:53.710

Reputation: 1

1You can pull the 1^ inside the parentheses, changing == to != and | to & and then remove said parentheses to save four bytes. – Jonathan Frech – 2018-09-23T07:26:12.093

@JonathanFrech Updated – guest271314 – 2018-09-23T14:58:11.203

0

Pepe, 85 77 bytes

rEeEREeErrEEEEEeRrEeErrEEEEEerEEEEEEERerEEEEEerRrEEEEEEeErREEREEEEErEeReeReEE

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

u_ndefined

Posted 2018-09-03T10:00:53.710

Reputation: 1 253

0

Rust, 29 bytes

|a,b,c|(a!=b&&b!=c&&a!=c)as _

as _ means casting to a type determined by type inference. The function result needs to be assigned to a variable declared to store integers.

Try it online!

Konrad Borowski

Posted 2018-09-03T10:00:53.710

Reputation: 11 185

0

MathGolf, 2 bytes

▀=

Try it online!

Explanation

▀    Get unique elements
 =   Check if equal to the input

maxb

Posted 2018-09-03T10:00:53.710

Reputation: 5 754

0

Braingolf, 5 bytes

ul3-n

Try it online!

Edit: fixed from identical -> distinct

FatalError

Posted 2018-09-03T10:00:53.710

Reputation: 119

0

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.

Tryer

Posted 2018-09-03T10:00:53.710

Reputation: 71

0

[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

don bright

Posted 2018-09-03T10:00:53.710

Reputation: 1 189

-1

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

Milbrae

Posted 2018-09-03T10:00:53.710

Reputation: 1

2I'm afraid you misunderstood the task. Your code should check whether all 3 integers are distinct not identical. – manatwork – 2018-09-19T14:08:18.530

what if a==b but a!=c? – Jo King – 2018-09-19T14:15:12.863

1I'm afraid that is not all. Now it says correctly that 1,1,1 is false (not all distinct) and 1,2,3 is true (all distinct), but for 1,2,2 gives also true, though they are not all distinct. – manatwork – 2018-09-19T14:17:43.570

Fixed it with a set. Should be working correctly now. – Milbrae – 2018-09-19T14:24:58.787

@Milbrae I think your ternary if is nigh a no-op. – Jonathan Frech – 2018-09-19T14:25:37.053

if the 3 integers are provided in a list: lambda a:len(set(a))>2 – FatalError – 2018-09-27T04:28:03.010