You are viewing a single comment's thread. Return to all comments →
s = 'hackerrank' for _ in range(int(input())): line = input() starts = line.startswith(s) ends = line.endswith(s) if starts and ends: print(0) elif starts: print(1) elif ends: print(2) else: print(-1)
Seems like cookies are disabled on this browser, please enable them to open this website
Find HackerRank
You are viewing a single comment's thread. Return to all comments →