HackerRank Triangle Quest 2 solution in Python YASH PAL, 31 July 202417 January 2026 HackerRank Triangle Quest 2 solution in Python – In this Triangle Quest 2 problem, we need to develop a python program that can read an integer input and then print a triangle equal to the size of that input on the output screen.You are given a positive integer N.Your task is to print a palindromic triangle of size N. For example, a palindromic triangle of size 5 is:1 121 12321 1234321 123454321 You can’t take more than two lines. The first line (a for-statement) is already written for you.You have to complete the code using exactly one print statement.Note:Using anything related to strings will give a score of 0.Using more than one for-statement will give a score of 0. HackerRank Triangle Quest 2 solution in Python in Python 2.for i in range(1,int(raw_input())+1): #More than 2 lines will result in 0 score. Do not leave a blank line also print sum(map(sum, map(lambda y: map(lambda x: 10 ** x, xrange(y)), xrange(1, i + 1)))) * (10 ** (i-1))+sum(map(sum, map(lambda y: map(lambda x: 10 ** (i - x - 2), xrange(y)), xrange(1, i))))Triangle Quest 2 solution in Python 3.for i in range(1,int(input())+1): #More than 2 lines will result in 0 score. Do not leave a blank line also print (((10**i - 1)//9)**2)Problem solution in pypy programming.for x in range(1,int(input())+1): print(((10**x - 1)//9)**2)Problem solution in pypy3 programming.for x in range(1,int(input())+1):# Enter your code here. Read input from STDIN. Print output to STDOUT print(((111111111)%(10**x))**2) coding problems solutions Hackerrank Problems Solutions Python Solutions HackerRankPython