Skip to content

Commit 284f372

Browse files
solves needle in haystack problem
1 parent 6378d09 commit 284f372

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https://github.com/anishLearnsToCode/leetcode-algorithms)
44
![made-with-java](https://img.shields.io/badge/Made%20with-Java-1f425f.svg)
55
![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)
6-
![problems-solved](https://img.shields.io/badge/Problems%20Solved-6/424-1abc9c.svg)
6+
![problems-solved](https://img.shields.io/badge/Problems%20Solved-9/424-1abc9c.svg)
7+
![problems-solved-java](https://img.shields.io/badge/Java-9/424-1abc9c.svg)
8+
![problems-solved-python](https://img.shields.io/badge/Python-1/424-1abc9c.svg)
79
[![license](https://img.shields.io/badge/LICENSE-MIT-<COLOR>.svg)](LICENSE)
810
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](CONTRIBUTING.md)
911

python/needle_in_haystack.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Solution:
2+
def strStr(self, haystack: str, needle: str) -> int:
3+
return haystack.find(needle)

src/NeedleInHaystack.java

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class NeedleInHaystack {
2+
public int strStr(String haystack, String needle) {
3+
return haystack.indexOf(needle);
4+
}
5+
}

0 commit comments

Comments
 (0)