Skip to content

Instantly share code, notes, and snippets.

@ZaakirHussain5
Created July 14, 2023 13:21
Show Gist options
  • Save ZaakirHussain5/ffcf70b731a6c50d6c59a893bdf12c6c to your computer and use it in GitHub Desktop.
Save ZaakirHussain5/ffcf70b731a6c50d6c59a893bdf12c6c to your computer and use it in GitHub Desktop.
HENNGE Admission Challenge
def get_inputs():
input()
inputs = list(map(int, input().split()))
return inputs
def print_outputs(inputs):
output = sum(map(lambda i: i**2 if i>0 else 0 , inputs))
print(output)
def repeat(fn,times,inputs):
inputs.append(fn())
times -= 1
if times > 0:
repeat(fn,times,inputs)
return inputs
def main():
test_cases = int(input())
inputs = repeat(get_inputs,test_cases,[])
list(map(lambda i: print_outputs(i) , inputs))
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment