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 | |
for i in xrange(input()): | |
pan=str(raw_input()) | |
if re.search(r'[A-Z]{5}[0-9]{4}[A-Z]',pan): | |
print 'YES' | |
else: | |
print 'NO' | |
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
TEXT='' | |
sum=0 | |
N=int(raw_input()) | |
for i in xrange(N): | |
TEXT+=' '+str(raw_input()) | |
T=int(raw_input()) | |
for i in xrange(T): | |
FIND=str(raw_input()) | |
print TEXT.count(FIND)+TEXT.count(FIND[:-2]+'se') |
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): |
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
#include <cmath> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
string calc(string msg){ | |
int len,row,col,allot,margin; | |
string str=""; | |
len=msg.length(); |
NewerOlder