• Solution works & takes a long time, but fails

Question related to mission Count Consecutive Summers

 

The solution I've written works and passes when I run it, but fails when I run the check. I think this is because the code takes a long time to run the bigger the number entered as the parameter. I've attached my code for review. Can I be marked as passing this one?