We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e858f6 commit 98c34a2Copy full SHA for 98c34a2
Regex and Parsing/Regex Substitution.py
@@ -0,0 +1,7 @@
1
+# Regex Substitution
2
+# https://www.hackerrank.com/challenges/re-sub-regex-substitution/problem
3
+
4
+import re
5
6
+for i in range(int(input().strip())):
7
+ print(re.sub(r'(?<= )\|\|(?= )', 'or', re.sub(r'(?<= )&&(?= )', 'and', input())))
0 commit comments