Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

ow, don't degrade your submission, show its true nature...
Source Link
Erik the Outgolfer
  • 40.8k
  • 5
  • 46
  • 125

Jelly, (削除) 12 (削除ここまで) 11(削除) 11 (削除ここまで) 10 bytes

-1 thanks to Erik the Outgolfer (replace the atom œ& with f)

9fÐfȯFμÐLQ

A dyadic link accepting E on the left (as a list of length-two-lists) and S on the right (as an integer) returning a [de-duplicated] list.

Try it online! or see a test-suite.

How?

9fÐfȯFμÐLQ - Link: list of lists, E; integer S
 μÐL - repeat the monadic chain to the left until a fixed point is reached:
 Ðf - (for each pair in E) filter keep if:
 f - filter discard if in
9 - chain's right argument
 - (originally [S], thereafter the previous result as monadic)
 ȯ - logical OR with implicit right
 - (force first pass to become S if nothing was kept)
 F - flatten to a single list
 - (S -> [S] / [[1,4],[1,0]]->[1,4,1,0] / etc...)
 Q - de-duplicate

Jelly, (削除) 12 (削除ここまで) 11 bytes

-1 thanks to Erik the Outgolfer (replace the atom œ& with f)

9fÐfȯFμÐLQ

A dyadic link accepting E on the left (as a list of length-two-lists) and S on the right (as an integer) returning a [de-duplicated] list.

Try it online! or see a test-suite.

How?

9fÐfȯFμÐLQ - Link: list of lists, E; integer S
 μÐL - repeat the monadic chain to the left until a fixed point is reached:
 Ðf - (for each pair in E) filter keep if:
 f - filter discard if in
9 - chain's right argument
 - (originally [S], thereafter the previous result as monadic)
 ȯ - logical OR with implicit right
 - (force first pass to become S if nothing was kept)
 F - flatten to a single list
 - (S -> [S] / [[1,4],[1,0]]->[1,4,1,0] / etc...)
 Q - de-duplicate

Jelly, (削除) 12 (削除ここまで) (削除) 11 (削除ここまで) 10 bytes

-1 thanks to Erik the Outgolfer (replace the atom œ& with f)

9fÐfȯFμÐLQ

A dyadic link accepting E on the left (as a list of length-two-lists) and S on the right (as an integer) returning a [de-duplicated] list.

Try it online! or see a test-suite.

How?

9fÐfȯFμÐLQ - Link: list of lists, E; integer S
 μÐL - repeat the monadic chain to the left until a fixed point is reached:
 Ðf - (for each pair in E) filter keep if:
 f - filter discard if in
9 - chain's right argument
 - (originally [S], thereafter the previous result as monadic)
 ȯ - logical OR with implicit right
 - (force first pass to become S if nothing was kept)
 F - flatten to a single list
 - (S -> [S] / [[1,4],[1,0]]->[1,4,1,0] / etc...)
 Q - de-duplicate
added 649 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293

Jelly, (削除) 12 (削除ここまで) 11 bytes

-1 thanks to Erik the Outgolfer (replace the atom œ& with f)

9fÐfȯFμÐLQ

A dyadic link accepting E on the left (as a list of length-two-lists) and S on the right (as an integer) returning a [de-duplicated] list.

Try it online! or see a test-suite.

How?

9fÐfȯFμÐLQ - Link: list of lists, E; integer S
 μÐL - repeat the monadic chain to the left until a fixed point is reached:
 Ðf - (for each pair in E) filter keep if:
 f - filter discard if in
9 - chain's right argument
 - (originally [S], thereafter the previous result as monadic)
 ȯ - logical OR with implicit right
 - (force first pass to become S if nothing was kept)
 F - flatten to a single list
 - (S -> [S] / [[1,4],[1,0]]->[1,4,1,0] / etc...)
 Q - de-duplicate

Jelly, (削除) 12 (削除ここまで) 11 bytes

-1 thanks to Erik the Outgolfer (replace the atom œ& with f)

9fÐfȯFμÐLQ

A dyadic link accepting E on the left (as a list of length-two-lists) and S on the right (as an integer) returning a [de-duplicated] list.

Try it online! or see a test-suite.

Jelly, (削除) 12 (削除ここまで) 11 bytes

-1 thanks to Erik the Outgolfer (replace the atom œ& with f)

9fÐfȯFμÐLQ

A dyadic link accepting E on the left (as a list of length-two-lists) and S on the right (as an integer) returning a [de-duplicated] list.

Try it online! or see a test-suite.

How?

9fÐfȯFμÐLQ - Link: list of lists, E; integer S
 μÐL - repeat the monadic chain to the left until a fixed point is reached:
 Ðf - (for each pair in E) filter keep if:
 f - filter discard if in
9 - chain's right argument
 - (originally [S], thereafter the previous result as monadic)
 ȯ - logical OR with implicit right
 - (force first pass to become S if nothing was kept)
 F - flatten to a single list
 - (S -> [S] / [[1,4],[1,0]]->[1,4,1,0] / etc...)
 Q - de-duplicate
added 347 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293

Jelly, (削除) 12 (削除ここまで) 11 bytes

-1 thanks to Erik the Outgolfer (replace the atom œ& with f)

9œ&ÐfȯFμÐLQ9fÐfȯFμÐLQ

A dyadic link accepting E on the left (as a list of length-two-lists) and S on the right (as an integer) returning a [de-duplicated] list.

Try it online! Try it online! or see a test-suite .

Jelly, (削除) 12 (削除ここまで) 11 bytes

9œ&ÐfȯFμÐLQ

A dyadic link accepting E on the left (as a list of length-two-lists) and S on the right (as an integer) returning a [de-duplicated] list.

Try it online!

Jelly, (削除) 12 (削除ここまで) 11 bytes

-1 thanks to Erik the Outgolfer (replace the atom œ& with f)

9fÐfȯFμÐLQ

A dyadic link accepting E on the left (as a list of length-two-lists) and S on the right (as an integer) returning a [de-duplicated] list.

Try it online! or see a test-suite .

deleted 175 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
Loading
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
Loading

AltStyle によって変換されたページ (->オリジナル) /