I'm doing this assignment:
A new fighting game has become popular. There are N number of villains with each having some strength. There are N players in the game with each having some energy. The energy is used to kill the villains. The villain can be killed only if the energy of the player is greater than the strength of the villain.
Input:
1 6 112 243 512 343 90 478 500 789 234 400 452 150
Output:
WIN
This is my code:
def main():
T = int(input(''))
for i in range(T):
N = int(input(''))
strength = []
energy = []
for i in range(N):
strength.append(int(input()))
for i in range(N):
energy.append(int(input()))
strength.sort()
energy.sort()
for j in range(len(energy)):
if strength[i] < energy[i]:
continue
else:
return print('LOSE')
return print('WIN')
main()
But I'm getting this error:
Traceback (most recent call last):
File "CandidateCode.py", line 23, in
main()
File "CandidateCode.py", line 11, in main
strength.append(int(input('')))
ValueError: invalid literal for int() with base 10: '112 243 512 343 90 478 '
How can I solve this problem?