Skip to main content
deleted 10 characters in body
Source Link
st0le
  • 2.2k
  • 19
  • 23

Python

Used the fact that the length of a valid string will always be a Triangle Number.

t=raw_input()
x=int(((8*lenlen(t)+1t+t)**.5-1)/2)
print t==''.join(t[i:x]for i in range(x))

A Ruby solution might be shorter, will post soon.

Python

Used the fact that the length of a valid string will always be a Triangle Number.

t=raw_input()
x=int(((8*len(t)+1)**.5-1)/2)
print t==''.join(t[i:x]for i in range(x))

A Ruby solution might be shorter, will post soon.

Python

Used the fact that the length of a valid string will always be a Triangle Number.

t=raw_input()
x=int(len(t+t)**.5)
print t==''.join(t[i:x]for i in range(x))

A Ruby solution might be shorter, will post soon.

deleted 1 characters in body
Source Link
st0le
  • 2.2k
  • 19
  • 23

Python

Used the fact that the length of a valid string will always be a Triangle Number.

t=raw_input()
x=int(((8*len(t)+1)**0**.5-1)/2)
print t==''.join(t[i:x]for i in range(x))

A Ruby solution might be shorter, will post soon.

Python

Used the fact that the length of a valid string will always be a Triangle Number.

t=raw_input()
x=int(((8*len(t)+1)**0.5-1)/2)
print t==''.join(t[i:x]for i in range(x))

A Ruby solution might be shorter, will post soon.

Python

Used the fact that the length of a valid string will always be a Triangle Number.

t=raw_input()
x=int(((8*len(t)+1)**.5-1)/2)
print t==''.join(t[i:x]for i in range(x))

A Ruby solution might be shorter, will post soon.

Source Link
st0le
  • 2.2k
  • 19
  • 23

Python

Used the fact that the length of a valid string will always be a Triangle Number.

t=raw_input()
x=int(((8*len(t)+1)**0.5-1)/2)
print t==''.join(t[i:x]for i in range(x))

A Ruby solution might be shorter, will post soon.