In this **HackerRank Triangle Quest 2 problem solution** 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.

## HackerRank Triangle Quest 2 in python problem solution

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 (pow(int(pow(10,i)/9),2))

### Second solution in python 2 programming.

for i in range(1,int(raw_input())+1): print reduce(lambda x, y:x*10+y, range(1, i+1)+range(i-1, 0, -1))

## 0 Comments