Change-Id: I99d2882ac9ef5ede85032132f6727e7bad8f24eb Reviewed-on: https://cl.tvl.fyi/c/depot/+/2564 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			363 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			363 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| import sys
 | |
| 
 | |
| l = []
 | |
| with open('./input', 'r') as f:
 | |
|     for line in f:
 | |
|         l.append(int(line))
 | |
| 
 | |
| s = set(l)
 | |
| 
 | |
| res=None
 | |
| for el in s:
 | |
|     for el2 in s:
 | |
|         if (2020-(el+el2)) in s:
 | |
|             res=(el, el2, 2020-(el+el2))
 | |
|             break
 | |
| 
 | |
| if res == None:
 | |
|     sys.exit("could not find a number that adds to 2020")
 | |
| 
 | |
| print(res)
 | |
| 
 | |
| print(res[0] * res[1] * res[2])
 |