Implement strStr() function | Leetcode 28 Solution in Java | Crack FAANG | Crack Coding Interview

Published: 19 April 2022
on channel: SoftWiz Circle
402
8

Implement strStr() function | Leetcode 28 Solution in Java | Crack FAANG | Crack Coding Interview

Implement strStr().

Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

Clarification:

What should we return when needle is an empty string? This is a great question to ask during an interview.

For the purpose of this problem, we will return 0 when needle is an empty string. This is consistent to C's strstr() and Java's indexOf().



Please follow and ask any question to our linkedin profile and twitter or our web site and we will try to help you with answer.
Linkedin
  / softwizcircle  
twitter
  / soft_wiz  
website

FB
  / softwiz-circle-113226280507946  

Here Group of People are sharing their Knowledge about Software Development. They are from different Top MNC. We are doing this for community. It will help student and experience IT Pro to prepare and know about Google, Facebook, Amazon, Microsoft, Apple, Netflix etc and how these company works and what their engineer do.
They will share knowledge about Azure, AWS , Cloud, Python, Java,.Net and other important aspect of Software Development.


On this page of the site you can watch the video online Implement strStr() function | Leetcode 28 Solution in Java | Crack FAANG | Crack Coding Interview with a duration of hours minute second in good quality, which was uploaded by the user SoftWiz Circle 19 April 2022, share the link with friends and acquaintances, this video has already been watched 402 times on youtube and it was liked by 8 viewers. Enjoy your viewing!