This might be misleading. n real interviews they wont accept this indexOf() predefined things, they wanted implementation from ground to check our knowledge, I won't say this is wrong but it will be better if you explain the other non pre defined approaches like Knuth-morris-pratt algorithm so it may help your subscribers who preparing for interviews.
you have used an inbuilt function 'indexOf' in JAVA. i don't think this is the expectation, the expectation of this question is to implement the said 'indexOf' function. Your solution and title solving in O(n) are misleading
IndexOf() also runs in linear time..internally it iterates through each element one by one,so time complexity of this operation is always O(n).. So we can definitely use indexOf() function to solve this problem...There is no need to implement to solve this Problem..
Very nice, keep posting new videos
This might be misleading. n real interviews they wont accept this indexOf() predefined things, they wanted implementation from ground to check our knowledge, I won't say this is wrong but it will be better if you explain the other non pre defined approaches like Knuth-morris-pratt algorithm so it may help your subscribers who preparing for interviews.
There is one more video for another approach..
you have used an inbuilt function 'indexOf' in JAVA. i don't think this is the expectation, the expectation of this question is to implement the said 'indexOf' function. Your solution and title solving in O(n) are misleading
IndexOf() also runs in linear time..internally it iterates through each element one by one,so time complexity of this operation is always O(n).. So we can definitely use indexOf() function to solve this problem...There is no need to implement to solve this Problem..
Nice explanation
Thank you! 😃
Logic kaise develop kare. Mujhe qus nhi hota bina solution dekhe
Its ok agar aap initially solution dekh rhe ho. Apke ek solution dekhne se same logic ya type k baki questions khud se krne mai help milegi.
S U P E R B☀️💗✨