Skip to content

Commit ad67cce

Browse files
authored
Create HackerRank_in_a_String!.py
1 parent c9b0d9f commit ad67cce

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/python
2+
3+
def issubstr(substr,mystr,start_index):
4+
for i in substr:
5+
start_index=mystr.find(i,start_index)+1
6+
if start_index==0:
7+
return False
8+
return True
9+
10+
q = int(raw_input().strip())
11+
for a0 in xrange(q):
12+
s = raw_input().strip()
13+
start_index=0
14+
# your code goes here
15+
substr="hackerrank"
16+
if issubstr(substr,s,start_index):
17+
print "YES"
18+
else:
19+
print "NO"
20+

0 commit comments

Comments
 (0)