Skip to main content
Commonmark migration
Source Link

#Pyth, 33 22 bytes#

Pyth, 33 22 bytes

#Pyth, 33 22 bytes#

Pyth, 33 22 bytes

added 536 characters in body
Source Link
Leaky Nun
  • 50.1k
  • 6
  • 110
  • 284

#Pyth, 3333 22 bytes#

This is my second attempt on Pyth :)

qz_jk.__<z/t@+1*8lz2 2
                       print(
q                       is_equal(
 z                       input(),
  _                       reverse(
   jk                      concat(
     ._                     all_prefixes(
       _                     reverse(
        <z                    input()[:
          /t@h*8lz2 2          divide(decrement(root(increment(multiply(8,len(z))),2)),2)
                                ])))))

Previous attempt:

#Pyth, 33 bytes#

This is my second attempt on Pyth :)

#Pyth, 33 22 bytes#

This is my second attempt on Pyth :)

qz_jk.__<z/t@+1*8lz2 2
                       print(
q                       is_equal(
 z                       input(),
  _                       reverse(
   jk                      concat(
     ._                     all_prefixes(
       _                     reverse(
        <z                    input()[:
          /t@h*8lz2 2          divide(decrement(root(increment(multiply(8,len(z))),2)),2)
                                ])))))

Previous attempt:

Source Link
Leaky Nun
  • 50.1k
  • 6
  • 110
  • 284

#Pyth, 33 bytes#

This is my second attempt on Pyth :)

KJ<z/t@+1*8lz2 2;WnkJ=K+K=JtJ;qKz

Try it online!

How it works:

KJ<z/t@+1*8lz2 2;WnkJ=K+K=JtJ;qKz
                                    z=input()
KJ<z/t@+1*8lz2 2                    K=J=z[:(root(1+8*len(z),2)-1)/2]
  <z                                    z[:
       +1*8lz                                    1+8*len(z)
      @      2                              root(          ,2)
     t                                                        -1
                 WnKJ               while not_equal(k,J):
                     =K+K=JtJ        K=plus(K,J=tail(J))
                              qKz   equal(K,z)