CHEFRAIL :: My Two same solution one using Clean code got TLE other bad one got AC :: I am surprised

first code good design :
Good design gets TLE

Second one Bad Design :
This one got accepted

If one goes through my submitted solution history i submitted around 20 versions of similar solution only to get the one with no function call and bad code accepted ,there is no difference in both in terms of logic ,implementation or any other overhead

If anyone can tell why it happens it will be great

1 Like

Function calls take time

@everule1 but do they take that much time ,like for all code in main function it got accepted in 1.7 second , and tle due to just function calls

Also all of the variables I am passing by reference