Skip to main content
added 15 characters in body
Source Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661

Haskell, 113 107107 102 92 bytes

import Data.List
a!(b:c)|b<last a=a!c|1>0=a++[b]!c
a!b=a
a#(b:c)|b<a!!0=b:a#c|1>0=(b:a)#c
a#b=b
g x@(b:c)=[b]|i<-[b]!cc=i:g([b]#cx\\i)
g x=[]

Try it online!Try it online!

This feels really long.

Explanation

! performs the drop sort on a list, while # collects the trimmings. g then repeatedly applies # until the list is empty recording the results in a list.

Haskell, 113 107 bytes

a!(b:c)|b<last a=a!c|1>0=a++[b]!c
a!b=a
a#(b:c)|b<a!!0=b:a#c|1>0=(b:a)#c
a#b=b
g(b:c)=[b]!c:g([b]#c)
g x=[]

Try it online!

This feels really long.

Explanation

! performs the drop sort on a list, while # collects the trimmings. g then repeatedly applies # until the list is empty recording the results in a list.

Haskell, 113 107 102 92 bytes

import Data.List
a!(b:c)|b<last a=a!c|1>0=a++[b]!c
a!b=a
g x@(b:c)|i<-[b]!c=i:g(x\\i)
g x=[]

Try it online!

This feels really long.

Explanation

! performs the drop sort on a list, while # collects the trimmings. g then repeatedly applies # until the list is empty recording the results in a list.

deleted 2 characters in body
Source Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661

Haskell, 113 109107 bytes

a!(b:c)|b<last a=a!c|1>0=a++[b]!c
a!b=a
a#(b:c)|b<head a=b|b<a!!0=b:a#c|1>0=(b:a)#c
a#b=b
g(b:c)=[b]!c:g([b]#c)
g x=[]

Try it online!

This feels really long.

Explanation

! performs the drop sort on a list, while # collects the trimmings. g then repeatedly applies # until the list is empty recording the results in a list.

Haskell, 113 109 bytes

a!(b:c)|b<last a=a!c|1>0=a++[b]!c
a!b=a
a#(b:c)|b<head a=b:a#c|1>0=(b:a)#c
a#b=b
g(b:c)=[b]!c:g([b]#c)
g x=[]

Try it online!

This feels really long.

Explanation

! performs the drop sort on a list, while # collects the trimmings. g then repeatedly applies # until the list is empty recording the results in a list.

Haskell, 113 107 bytes

a!(b:c)|b<last a=a!c|1>0=a++[b]!c
a!b=a
a#(b:c)|b<a!!0=b:a#c|1>0=(b:a)#c
a#b=b
g(b:c)=[b]!c:g([b]#c)
g x=[]

Try it online!

This feels really long.

Explanation

! performs the drop sort on a list, while # collects the trimmings. g then repeatedly applies # until the list is empty recording the results in a list.

added 182 characters in body
Source Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661

Haskell, 113 109 bytes

a!(b:c)|b<last a=a!c|1>0=a++[b]!c
a!b=a
a#(b:c)|b<head a=b:a#c|1>0=(b:a)#c
a#b=b
g(b:c)=[b]!c:g([b]#c)
g x=[]

Try it online!

This feels really long.

Explanation

! performs the drop sort on a list, while # collects the trimmings. g then repeatedly applies # until the list is empty recording the results in a list.

Haskell, 113 109 bytes

a!(b:c)|b<last a=a!c|1>0=a++[b]!c
a!b=a
a#(b:c)|b<head a=b:a#c|1>0=(b:a)#c
a#b=b
g(b:c)=[b]!c:g([b]#c)
g x=[]

Try it online!

This feels really long.

Haskell, 113 109 bytes

a!(b:c)|b<last a=a!c|1>0=a++[b]!c
a!b=a
a#(b:c)|b<head a=b:a#c|1>0=(b:a)#c
a#b=b
g(b:c)=[b]!c:g([b]#c)
g x=[]

Try it online!

This feels really long.

Explanation

! performs the drop sort on a list, while # collects the trimmings. g then repeatedly applies # until the list is empty recording the results in a list.

Source Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661
Loading