Triangle Quest 2

Sort by

recency

|

1121 Discussions

|

  • + 0 comments
    for i in range(1,int(input())+1):
        print(*range(1, i), *range(i, 0, -1), sep="")
    

    Asked for one print statment Asked for on for loop

    I'm this close to loosing it with hackerank

  • + 0 comments
    for i in range(1,int(input())+1):
        print(*range(1, i), *range(i, 0, -1), sep="")
    

    Asked for one print statment Asked for on for loop

    I'm this close to loosing it with hackerank

  • + 0 comments

    this is my solution:

    for i in range(1,int(input())+1): print((111111111//10**(9-i))**2)

  • + 0 comments

    for i in range(1, int(input())+1): print((10**i // 9)**2)

  • + 0 comments

    It's a simple math problem:

    First, recognize the palindrome has this format: 1 * 1 = 1 11*11 = 121 111*111 = 12321

    Second, create a formula with a given value of N ((10**N) - 1) // 9

    Now you can square the formula by 2