You are viewing a single comment's thread. Return to all comments →
import re s1 = "C:CPP:JAVA:PYTHON:PERL:PHP:RUBY:CSHARP:HASKELL:CLOJURE:BASH:SCALA: ERLANG:CLISP:LUA:BRAINFUCK:JAVASCRIPT:GO:D:OCAML:R:PASCAL:SBCL:DART: GROOVY:OBJECTIVEC" sl = re.split(r'\W',s1) sl = [i for i in sl if i!=""] for _ in range(int(input())): if any(map(lambda x : x in sl, input().split())) : print("VALID") else : print("INVALID")
Seems like cookies are disabled on this browser, please enable them to open this website
HackerRank Language
You are viewing a single comment's thread. Return to all comments →