Yahoo India Web Search

Search results

  1. Hello coders, today we are going to solve Triangle Quest 2 HackerRank Solution in Python. Table of Contents. Task. 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: 121. 12321. 1234321. 123454321. You can’t take more than two lines.

  2. Jun 6, 2020 · Hackerrank - Triangle Quest 2 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.

  3. Jan 11, 2023 · As you can see, we were able to find out the required triangle using Python and our solution is also in two lines. Let us now understand how the formula is working and how it is able to print out the triangle as required in the question. python. ( 10 ** i - 1) ** 2 // 81. If i == 1, we get:

  4. Saved searches Use saved searches to filter your results more quickly

  5. We would like to show you a description here but the site won’t allow us.

  6. 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.

  7. HackerRank concepts & solutions. Contribute to BlakeBrown/HackerRank-Solutions development by creating an account on GitHub.

  8. for i in range (1,int (input ())): #More than 2 lines will result in 0 score. Do not leave a blank line also print ( int ( (i* (pow (10, i) - 1)) / 9 )) Annotated solutions to HackerRank's Python challenges. - Python-HackerRank/Math/Triangle Quest.py at master · raleighlittles/Python-HackerRank.

  9. Mar 26, 2020 · The following shows how to solve the HackerRank Triangle Quest 2 Python Math problem. Code: for i in range(1,int(input())+1): print(pow( ((pow(10,i)-1)//9), 2))

  10. Triangle Quest 2 HackerRank Solution. GitHub Gist: instantly share code, notes, and snippets.

  1. People also search for