Skip to main content
4 of 4
added 73 characters in body
scpchicken
  • 783
  • 5
  • 12

Pyth, 32 31 bytes

Not a very optimal solution because I couldn't get the short function defintion using the L command. Feel free to help me out here

Code

DtZJrZ0R.ehSmadksmxdcJ1"aeiou"J

Big-Pyth Version

def
  tail
  zero-var

  implicit-assign
    auto-var
    lower
      zero-var
      0

  return
    enumerate-map
      head
        sorted
          map
            absolute-difference
              map-var
              enumerate-map-ind
            flatten-once
              map
                ind-all-occurrences
                  map-var
                  chop-into-size-n
                    auto-var
                    1
                str-start aeiou str-end
      auto-var

Try it online!

Translation Link

scpchicken
  • 783
  • 5
  • 12