Springworks interview question

I failed the coding round