Timeline for Single swaps of an array
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 5, 2018 at 22:01 | history | edited | totallyhuman | CC BY-SA 3.0 |
added 23 characters in body
|
Jan 5, 2018 at 19:50 | comment | added | Unihedron |
As for your code, 1. you could assign 1..n to a one-char variable and reuse it (separate statements with newline or semicolons), 2. do without brackets in the termary statements: i==x ?y:i==y ?x:i (note where I have the spaces to seperate the potential shebang) and 3. uniq[1,n] instead of uniq[1..-1] .
|
|
Jan 5, 2018 at 19:43 | comment | added | totallyhuman | No need to apologize! I think I speak for most PPCG users when I say that the competition is what makes PPCG cool. | |
Jan 5, 2018 at 19:41 | comment | added | Unihedron | I outgolfed this: codegolf.stackexchange.com/a/152652/21830. Sorry! | |
Jan 2, 2018 at 0:06 | history | edited | totallyhuman | CC BY-SA 3.0 |
deleted 5 characters in body
|
Jan 1, 2018 at 23:25 | history | answered | totallyhuman | CC BY-SA 3.0 |