Skip to main content
deleted 12 characters in body
Source Link
Oliver Ni
  • 10.6k
  • 3
  • 38
  • 107

Dip, 98 bytes

HC½+'0ÏEIH{C'0ÏEI

Explanation:

            # Implicit input
 H          # Push length of input
  C {        # Divide byAdd 21
   ½+C       # AddDivide 0.5
by 2
    '      # Convert to int
      0Ï    # Get string back
        E   # Push prefixes of string
         I  # Push prefixes[int(len/2+0.5)]prefixes[a]
            # Implicit print

This could probably be much improved.

Dip, 9 bytes

HC½+'0ÏEI

Explanation:

            # Implicit input
 H          # Push length of input
  C         # Divide by 2
   ½+       # Add 0.5
     '      # Convert to int
      0Ï    # Get string back
        E   # Push prefixes of string
         I  # Push prefixes[int(len/2+0.5)]
            # Implicit print

This could probably be much improved.

Dip, 8 bytes

H{C'0ÏEI

Explanation:

           # Implicit input
 H         # Push length of input
  {        # Add 1
   C       # Divide by 2
    '      # Convert to int
     0Ï    # Get string back
       E   # Push prefixes of string
        I  # Push prefixes[a]
           # Implicit print

This could probably be much improved.

Source Link
Oliver Ni
  • 10.6k
  • 3
  • 38
  • 107

Dip, 9 bytes

HC½+'0ÏEI

Explanation:

            # Implicit input
 H          # Push length of input
  C         # Divide by 2
   ½+       # Add 0.5
     '      # Convert to int
      0Ï    # Get string back
        E   # Push prefixes of string
         I  # Push prefixes[int(len/2+0.5)]
            # Implicit print

This could probably be much improved.