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.
- Prepare
- Python
- Math
- Triangle Quest 2
- Discussions
Triangle Quest 2
Triangle Quest 2
Sort by
recency
|
1160 Discussions
|
Please Login in order to post a comment
Here is HackerRank Triangle Quest 2 in python solution - https://programmingoneonone.com/hackerrank-triangle-quest-2-solution-in-python.html
for i in range(1, int(input()) + 1): print(int(10 ** i / 9) ** 2)
for i in range(1, int(input()) + 1): print(((10**i - 1)//9)**2)
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([1,121,12321,1234321,123454321,12345654321,1234567654321,123456787654321,12345678987654321][i-1])
This might help😅😅
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]))