Created
August 23, 2013 07:01
-
-
Save djadmin/6316316 to your computer and use it in GitHub Desktop.
hackerrank-Find Hackerrank Problem
https://www.hackerrank.com/challenges/find-hackerrank
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
N = int(raw_input()) | |
for i in xrange(N): | |
T=str(raw_input()) | |
if re.search(r'^hackerrank',T) and re.search(r'hackerrank$',T): | |
print 0 | |
elif re.search(r'^hackerrank',T): | |
print 1 | |
elif re.search(r'hackerrank$',T): | |
print 2 | |
else: | |
print -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment