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.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Python
  3. Math
  4. Triangle Quest 2

Triangle Quest 2

Problem
Submissions
Leaderboard
Discussions
Editorial

You are given a positive integer .
Your task is to print a palindromic triangle of size .

For example, a palindromic triangle of size 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 .
Using more than one for-statement will give a score of .

Input Format

A single line of input containing the integer .

Constraints

Output Format

Print the palindromic triangle of size as explained above.

Sample Input

5

Sample Output

1
121
12321
1234321
123454321

Author

[deleted]

Difficulty

Medium

Cutoff Score

10.00

Max Score

20

Submitted By

99607

Need Help?


View discussions
View editorial
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy