Doubt in my implementation

Hello, I have submitted my code and passed all the test cases but I want you to help me out in finding the optimized Solution if Possible so that I can make improvements in my code. Here is my code :

Hello @yashsharma4304 yes you can optimise it by using it the sort function with the custom comparator in it.
do you want me to share the code if that approach ?

Ok yeah I can use a comparator with STL sort.

No, Now I can write it :slightly_smiling_face: and Thank you for your help and support :heavy_heart_exclamation: :heart:

@yashsharma4304 if you feel you can mark this doubt as resolved.

1 Like