ENGLISH long challenge function giving TLE but inline code passes

Something bizzare happing it costed me during contest
i’m considering only first subtask
in 1 subtask task no. 4,5 giving TLE in first code(using function to find matching prefix)
while it passes using second code(inline code of same fucntion);
code 1:

code 1 TLE
code 2:

code 2 :passing


but bro it is costing a hell lot

please look code i updated link

Looks like you might be making the same mistake as this guy :

long long fun(long long i,long long j,vector<string>ok) 

You’re passing ok by value: depending on the size of ok, and the number of times you’re calling fun, this could easily cause a TLE.


Thanks a lot you saved my day :stuck_out_tongue:

1 Like

Chalta phirta google.

English - Person who provides information like Google.

1 Like