Problem Statement
There were some complaints made that there are cars around with obscene words in Russian as their plate numbers. Because of this, the Division of Motor Vehicles needs to check customized plate applications, to see whether or not they might be in Russian.
Your task is, given a String[], check each String to see whether it can be viewed as written in Russian. A String might be written in Russian if all of its characters belong to the set described above. Return the indices of suspected Strings (counting starts from 1) in ascending order.
For your convenience, here are the suspicious characters again: ABCEHKMOPTXY034
Definition
- Class:
- Russian
- Method:
- suspected
- Parameters:
- String[]
- Returns:
- int[]
- Method signature:
- int[] suspected(String[] plates)
- (be sure your method is public)
Constraints
- plates has between 0 and 50 elements inclusive
- each element of plates consists only of capital letters [A-Z] and digits [0-9]
- each element of plates has between 3 and 8 characters inclusive
Examples
{"MAMA","PAPA"}
Returns: { 1, 2 }
{"ZAMA","TA4KA","KOMAP"}
Returns: { 2, 3 }
{}
Returns: { }
{"CCCP","USSR","AAA","LLL","333","555"}
Returns: { 1, 3, 5 }
{"AAA","BBB","CCC","DDD","EEE","FFF","GGG","HHH","III","JJJ","KKK","LLL","MMM","NNN","OOO","PPP","QQQ","RRR","SSS","TTT","UUU","VVV","WWW","XXX","YYY","ZZZ","000","111","222","333","444","555","666","777","888","999"}
Returns: { 1, 2, 3, 5, 8, 11, 13, 15, 16, 20, 24, 25, 27, 30, 31 }
{"3O43AC0X","03XHOB3P","3A4X03O0","PXYCTOKY","PCCBXEOP","3CHETE3O","PXA34EB3","PH0KBCT4","MECXXXT3","EO0THCTB","A0PMAEK4","C4BYE4O0","ACBTECXB","KMHTBHXT","CPC4MXA0","0YPYHP44","TTKPB4YB","MXEMM3PB","KPK00TEH","KAHKMYOT","EB3BX0TK","AKBMCEAY","HCHTXKAM","PKCC4TYY","BPTYPPKO","ACYPCX4P","THHTX4PO","XEPKMPTX","34MT0KPB","BAPA04YA","XMMHMOBE","OXO0TK3O","MPCBHBBT","KB3M3XA4","YPP0CEOC","HO4MCEMO","PXXOTM4Y","BMXBP404","XTHBOTHY","OEPEPOOK","ABOHBAH4","OYMX4APX","H4APOPOX","T4EYEKO0","P4OKX30K","33YYYOHP","YHHBCKYC","4CTXM0HY","PTXTBTCP","OMAHKACX"}
Returns: { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 }
Suspicious looking random fluff.
{"KDMCGN0M","LO20FUMB","JTMY0YSX","DI72NTLA","5TQ7TJY1","V3PEHKYI","AN7ZDWJZ","Z0OWSFL4","OCAPYDCN","K2DDVLAY","EAQAUUJF","0W7Q1B7V","7S18J837","LNJLOOOC","3HA2A43J","IK7ICOYO","GGSYT2N8","Q08NTP46","B9V4Y5UP","P29P7STB","V7ZYSXEP","0SEJMFX9","BJ5NOR9E","WAVHJBU5","BJ5EGAZO","Q6INHOI0","5NY8PJ3H","XCSIB1K5","YXJOGRDA","6OAMDMPE","PRU26321","ZQJ4YC5P","17IS0PXI","XTQMEJLS","R45NS4KA","UOPQDX2R","Y4IKDC9E","Q96J9VTA","NB2HQNL2","GC9UQKZF","YWIYCSZ2","B6MHPI82","Q7EFF2MM","X8PJW0S2","89VCBI71","HV6EVGD1","LX5YJ2WK","VCAZONZU","Q464HQ5H","0ITYMVYQ"}
Returns: { }
Perfectly innocent random fluff (with supicious letters in it).
{"9W0","1RX","K0P","WM7","5V1","PKF","7XC","3UW","13V","TLG","WAJ","30L","EAA","JR5","UL2","KDB","D8F","HR1","QG3","QHZ","NM5","F4Y","LK0","RV2","8PU","E2V","S35","P0B","QEL","EUQ","6AW","LBP","JU1","SQX","SWJ","2MV","UZU","9M2","I4L","Z8M","T0U","7Q2","GP2","JL0","B7Y","ZXX","P1P","B1T","9VG","82Q"}
Returns: { 3, 13, 28 }
{"YIV","NCK","G5N","I84","I16","JMC","HU8","VB6","CQN","X11","P7K","WUP","SX5","XBN","713","JVJ","HZJ","6FP","AG7","DCE","8EW","QX8","3Q4","6VQ","RCN","XOF","UQQ","KKC","2QC","75P","TJI","D7F","IUT","JHW","2UG","5IZ","XXL","B3A","7ZI","SD9","PJW","S9M","MVM","KCV","LIO","ANQ","C97","FND","0RX","HHR"}
Returns: { 28, 38 }
{"0BE","4YB","0XC","CEB","X0O","ACO","X4Y","MBA","O3P","XM3","M4Y","P4P","OPK","ABK","APT","MAP","KCP","0HK","03X","PBX","3HM","AM4","ACC","03M","3BH","AOK","YH4","0MP","EMY","C34","KMO","KPH","KTP","P0T","3B3","44T","B4K","OTT","3Y4","PPY","03H","EPT","YH0","M3M","EHH","BMT","TMT","OEB","0CM","0HP"}
Returns: { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 }
{"ZAA","OHO","4XO","0BB","ZHK","TK0","YTY","P3Z","X33","YBA","OXK","BOK","O4C","CPY","AT3","TZ4","4CT","X4A","4CB","4XT","AE0","PYC","K4M","H33","AHZ","XAC","XM3","MMA","ETE","X4M","OPB","XYK","ACM","P0Y","ZO4","MO4","X3K","3KC","H4O","MB0","ET0","KET","0EB","MOK","4C0","P3K","OAT","MBY","MOE","A4Z"}
Returns: { 2, 3, 4, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49 }
Very suspicious, except for the Z
{ "MMM" }
Returns: { 1 }
{ "MAMA", "PAPA" }
Returns: { 1, 2 }
{ "AAA", "AAA", "AAA", "AAA", "AAA", "AAA", "AAA", "AAA", "AAA", "AAA", "AAA", "AAA", "AAA", "AAA", "AAA", "AAA" }
Returns: { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }
{ "CCCP", "USSR", "AAA", "LLL", "333", "555" }
Returns: { 1, 3, 5 }