Wave Solution TLE altough for a similar sol time is 0.08 sec

Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

Edit:

While I’m waiting for this, check that your find function takes arr by reference instead of by value.