Skip to main content
added 16 characters in body
Source Link
Unrelated String
  • 23k
  • 3
  • 32
  • 55

Brachylog, 7 6 5 bytes

ℕ₁≜¬∈

Try it online!

-1 stealing Fatalize's solution to the dupe target--note that my acceptedaccepted reverted golf suggestion fails on the empty list. Whoops

Reversed I/O.

ℕ₁       The output is a positive integer.
  ≜      Try every value for it until one
   ¬∈    isn't in the input.

Brachylog, 7 6 5 bytes

ℕ₁≜¬∈

Try it online!

-1 stealing Fatalize's solution to the dupe target--note that my accepted golf suggestion fails on the empty list. Whoops

Reversed I/O.

ℕ₁       The output is a positive integer.
  ≜      Try every value for it until one
   ¬∈    isn't in the input.

Brachylog, 7 6 5 bytes

ℕ₁≜¬∈

Try it online!

-1 stealing Fatalize's solution to the dupe target--note that my accepted reverted golf suggestion fails on the empty list. Whoops

Reversed I/O.

ℕ₁       The output is a positive integer.
  ≜      Try every value for it until one
   ¬∈    isn't in the input.
added 35 characters in body
Source Link
Unrelated String
  • 23k
  • 3
  • 32
  • 55

Brachylog, 7 66 5 bytes

,0≡ⁿℕ₁ℕ₁≜¬∈

Try it online!Try it online!

Seems not to need an explicit label. ~k≠tℕ₁ ties (see history for explanation), but only assuming the input contains no duplicates-1 stealing Fatalize's solution to the dupe target--note that my accepted golf suggestion fails on the empty list. Whoops

Reversed I/O.

ℕ₁    ℕ₁    The output is a positive integer.
  ≡ⁿ      which isTry notevery anvalue elementfor ofit theuntil inputone
,0        (with 0¬∈ appended, because  doesn'tisn't likein emptythe lists)input.

Brachylog, 7 6 bytes

,0≡ⁿℕ₁

Try it online!

Seems not to need an explicit label. ~k≠tℕ₁ ties (see history for explanation), but only assuming the input contains no duplicates.

    ℕ₁    The output is a positive integer
  ≡ⁿ      which is not an element of the input
,0        (with 0 appended, because  doesn't like empty lists).

Brachylog, 7 6 5 bytes

ℕ₁≜¬∈

Try it online!

-1 stealing Fatalize's solution to the dupe target--note that my accepted golf suggestion fails on the empty list. Whoops

Reversed I/O.

ℕ₁       The output is a positive integer.
        Try every value for it until one
   ¬∈    isn't in the input.
added 34 characters in body
Source Link
Unrelated String
  • 23k
  • 3
  • 32
  • 55

Brachylog, 77 6 bytes

d~k≠tℕ₁,0≡ⁿℕ₁

Try it online!Try it online!

SeemsSeems not to need an explicit label to function properly. ~k≠tℕ₁ ties (see history for explanation), but only assuming the input contains no duplicates.

 ~k        Append something to
d   ℕ₁    The output is thea deduplicatedpositive inputinteger
   ≠       such that all elements are≡ⁿ distinct
    t which is not an element andof the new last elementinput
     ℕ₁    is,0 a positive integer
     (with 0 appended, because  doesn't whichlike isempty outputlists).

Brachylog, 7 bytes

d~k≠tℕ₁

Try it online!

Seems not to need an explicit label to function properly.

 ~k        Append something to
d          the deduplicated input
   ≠       such that all elements are distinct
    t      and the new last element
     ℕ₁    is a positive integer
           which is output.

Brachylog, 7 6 bytes

,0≡ⁿℕ₁

Try it online!

Seems not to need an explicit label. ~k≠tℕ₁ ties (see history for explanation), but only assuming the input contains no duplicates.

    ℕ₁    The output is a positive integer
  ≡ⁿ      which is not an element of the input
,0        (with 0 appended, because  doesn't like empty lists).
Source Link
Unrelated String
  • 23k
  • 3
  • 32
  • 55
Loading