In this post, we will solve HackerRank Language HackerRank Solution. This problem (HackerRank Language) is a part of HackerRank Regex series.
Solution – HackerRank Language – HackerRank Solution
Python
import re p = re.compile('^\d+\s+(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)$') n = int(input()) for i in range(n): x = str(input()) if(len(re.findall(p, x)) > 0): print("VALID") else: print("INVALID")
Note: This problem (HackerRank Language) is generated by HackerRank but the solution is provided by CodingBroz. This tutorial is only for Educational and Learning purpose.