Find the index of the first occurrence in a string | Leetcode 28 | O(n) time Complexity

preview_player
Показать описание
Find the index of the first occurrence in a string
Leetcode problem number 28
using IndexOf()
Time Complexity: O(n)

JAVA interview programming playlist:

#java #interviewquestions #leetcode
Рекомендации по теме
Комментарии
Автор

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.

balajib
Автор

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

kritikagupta
Автор

Logic kaise develop kare. Mujhe qus nhi hota bina solution dekhe

royalsingh