You are viewing a single comment's thread. Return to all comments →
could you please explain me the logic?
Most of the peope solved this problem but time complexity of your solution is O(n*m) (due to two nested for loops)which can not be used to solve this problem for given time constraint, so you need better approach which beats O(n*m)
I have created a video tutorial for you and uploaded the same on youtube.
Here is the video tutorial for my solution O(n+m) complexity passed all test cases.
Would really appreciate your feedback like, dislike , comment etc. on my video.