Triangle Quest 2

Sort by

recency

|

1168 Discussions

|

  • + 0 comments

    It was easy to crack as its all power and its reciprocal to retrace the steps for the solution i.e. if take square root of each number it is a squence of 1. e.g.

    1. sqrt(121)=11.0 = (100-1//9)
    2. sqrt(12321)=111.0=(1000-1)//9
    3. sqrt(1234321)=1111.0=(10000-1)//9

    Hence the solution:

    print ((pow(10,i)//9)**2)

  • + 0 comments

    The logic is: For i=3 the numbers = [1,2,3,2,1] and enumerate([1,2,3,2,1]) = [(0,1), (1,2), (2,3), (3,2), (4,1)]. For each (index, value) : value * 10^(length-1-index) (0,1): 1 * 10^(5-1-0) = 1 * 10^4 = 10000 (1,2): 2 * 10^(5-1-1) = 2 * 10^3 = 2000
    (2,3): 3 * 10^(5-1-2) = 3 * 10^2 = 300 (3,2): 2 * 10^(5-1-3) = 2 * 10^1 = 20 (4,1): 1 * 10^(5-1-4) = 1 * 10^0 = 1 Sum: 10000 + 2000 + 300 + 20 + 1 = 12321 """

  • + 0 comments

    Read input

    n = int(input())

    Apply conditional logic

    if n % 2 != 0: print("Weird") elif 2 <= n <= 5: print("Not Weird") elif 6 <= n <= 20: print("Weird") else: print("Not Weird")

  • + 1 comment

    It's stupid that this platform doesn't accept print(int("1"*i)**2)

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