Itsy's Triangles

Itsy went for a walk and found several sticks in the park. She is wondering how many of these sticks…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

what am I wrong here?

def count_sticks(sticks):
    numberOfSticks=len(sticks)
    isUsedTheStick=[False]*numberOfSticks
    for i in range(len(sticks)):
        for j in range(i + 1, numberOfSticks):
            for k in range(j + 1, numberOfSticks):
                if sticks[i]**2 + sticks[j]**2 == sticks[k]**2:
                    isUsedTheStick[i]=True
                    isUsedTheStick[j]=True
                    isUsedTheStick[k]=True
    count = 0
    for i in range(numberOfSticks):
        if(isUsedTheStick[i]):
            count += 1
    return count

# Read the input
numberOfSticks = int(input())
sticks = [int(x) for x in input().split()]

# Solve the problem
result = count_sticks(sticks)

# Print the output
print(result)