#!/usr/bin/env python
NUM_RECIPES='170641'defrun(check_success,grab_info):recipes='37'elf_one=0elf_two=1whileTrue:elf_one_score=int(recipes[elf_one])elf_two_score=int(recipes[elf_two])recipes+=str(elf_one_score+elf_two_score)num_recipes=len(recipes)elf_one+=1+elf_one_scoreelf_one%=num_recipeself_two+=1+elf_two_scoreelf_two%=num_recipesifcheck_success(recipes):print(grab_info(recipes))breakif__name__=='__main__':# Part 1
run(lambdarecipes:len(recipes)>=10+int(NUM_RECIPES),lambdarecipes:recipes[int(NUM_RECIPES):int(NUM_RECIPES)+10],)# Part 2
run(lambdarecipes:NUM_RECIPESinrecipes[-len(NUM_RECIPES)-10:],lambdarecipes:recipes.index(NUM_RECIPES),)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I liked this one quite a bit too!