Skip to main content

Timeline for Is this word in standard order?

Current License: CC BY-SA 4.0

14 events
when toggle format what by license comment
Feb 18, 2022 at 19:24 history edited 12944qwerty CC BY-SA 4.0
-4 bytes
Feb 18, 2022 at 18:57 comment added pxeger 50 bytes on the second one: lambda a,i=0:any(k^(i:=i+1)for k in{}.fromkeys(a)) (input \$ [1, 26] \$)
Jan 21, 2022 at 13:56 history edited 12944qwerty CC BY-SA 4.0
wow
Jan 21, 2022 at 13:52 comment added 12944qwerty @pxeger Wow.... i thought it couldn't get any smaller :O
Jan 20, 2022 at 20:49 comment added pxeger down to 47 bytes by combining both answers
Jan 20, 2022 at 20:42 comment added pxeger Another -1 on @m90's version (outputs inverted): lambda a:0in map(int.__eq__,{}.fromkeys(a),range(len(a)))
Jan 20, 2022 at 20:11 history edited 12944qwerty CC BY-SA 4.0
deleted 60 characters in body
Jan 20, 2022 at 20:07 comment added pxeger I just realised you can remove both sets of [] from your original answer, which makes it shorter overall: lambda a:any(i^j for i,j in enumerate({}.fromkeys(a)))
Jan 20, 2022 at 20:02 history edited 12944qwerty CC BY-SA 4.0
better solution
Jan 20, 2022 at 19:54 comment added m90 Improvement to 58: lambda a:all(map(int.__eq__,{}.fromkeys(a),range(len(a))))
Jan 20, 2022 at 19:50 comment added pxeger If you change i==j to i^j and change all to any, you can save a byte (output becomes inverted, but that's allowed)
Jan 20, 2022 at 19:48 history edited 12944qwerty CC BY-SA 4.0
added 34 characters in body
Jan 20, 2022 at 19:45 comment added pxeger dict.fromkeys can be {}.fromkeys: see this tip of mine
Jan 20, 2022 at 19:19 history answered 12944qwerty CC BY-SA 4.0