We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Regex
- Applications
- HackerRank Tweets
- Discussions
HackerRank Tweets
HackerRank Tweets
Sort by
recency
|
99 Discussions
|
Please Login in order to post a comment
python 3
import re pattern = re.compile(r'\w*[#@]?(hackerrank)\w*',re.IGNORECASE)
n =int(input()) count = 0
for _ in range(n): text = input() if re.search(pattern, text): count = count + 1 print(count)
Javascript one liner
Showoff your array knowledge
console.log(input.split("\n").slice(1).reduce((sum, val) => (/hackerrank/i.test(val) ? sum + 1 : sum), 0))
Showoff your flags knowledge
console.log(input.match(/hackerrank/gi).length);
Java 15
Python 3
Javascript: