FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Leetcode/algorithms/ImplementStrStr.js at master · superman06/Leetcode · GitHub
superman06
/
Leetcode
Public
forked from
dnshi/Leetcode
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Leetcode
/
algorithms
/
ImplementStrStr.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (19 loc) · 591 Bytes
Breadcrumbs
Leetcode
/
algorithms
/
ImplementStrStr.js
Copy path
File metadata and controls
21 lines (19 loc) · 591 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Source : https://leetcode.com/problems/implement-strstr
// Author : Dean Shi
// Date : 2017-07-10
/***************************************************************************************
*
* Implement strStr().
*
* Returns the index of the first occurrence of needle in haystack, or -1 if needle is
* not part of haystack.
*
***************************************************************************************/
/**
*
@param
{
string
} haystack
*
@param
{
string
} needle
*
@return
{
number
}
*/
var
strStr
=
function
(
haystack
,
needle
)
{
return
haystack
.
indexOf
(
needle
)
}
;
Back
|
FazBrowse Home
|
New Git URL