We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Enter your code here. Read input from STDIN. Print output to STDOUT
n=int(input())
p=str(input())
lst=p.split()
num=('').join(p.split())
d=lst[0]
e=lst[0]
for l in lst[1:]:
d+='0'+l
e+='9'+l
a=int(d)**0.5
b=int(e)**0.5
for z in range(int(a),int(b)+1):
k=(z**2)
k=str(k)
if k[::2]==num:
print(z)
break
break
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #206: Concealed Square
You are viewing a single comment's thread. Return to all comments →
Enter your code here. Read input from STDIN. Print output to STDOUT
n=int(input()) p=str(input()) lst=p.split() num=('').join(p.split()) d=lst[0] e=lst[0] for l in lst[1:]: d+='0'+l e+='9'+l a=int(d)**0.5 b=int(e)**0.5 for z in range(int(a),int(b)+1): k=(z**2) k=str(k) if k[::2]==num: print(z) break break