Created
July 14, 2023 13:21
-
-
Save ZaakirHussain5/ffcf70b731a6c50d6c59a893bdf12c6c to your computer and use it in GitHub Desktop.
HENNGE Admission Challenge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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