You are viewing a single comment's thread. Return to all comments →
Python 3 solution. I was lazy to format the string into a regex :-))
s = 'COPY THE FULL STRING FROM THE TEXT HERE, like: C:CPP...' valid_langs = set(lang.strip() for lang in s.split(':')) n = int(input()) for _ in range(n): api_id, lang = input().split(' ') if pow(10, 4) <= int(api_id) < pow(10, 5) and lang in valid_langs: 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 →
Python 3 solution. I was lazy to format the string into a regex :-))