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.
for i in range(1,int(input())+1): #More than 2 lines will result in 0 score. Do not leave a blank line also
s ="".join((list(map(str,list(range(1,i))))))
print (int("".join((list(map(str,list(range(1,i+1))))))+s[::-1]))
for this its throwing error saying str not allowed
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Triangle Quest 2
You are viewing a single comment's thread. Return to all comments →
for i in range(1,int(input())+1): #More than 2 lines will result in 0 score. Do not leave a blank line also s ="".join((list(map(str,list(range(1,i)))))) print (int("".join((list(map(str,list(range(1,i+1))))))+s[::-1]))