This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Example Usage (assuming engine.py is in the same folder as the Python file you're working in): | |
| import engine | |
| regex = engine.RegEx("aa.*b") | |
| assert regex.test("aaLETTERSb") == True | |
| assert regex.test("bLETTERSb") == False | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from string import ascii_lowercase | |
| from typing import Dict, Set | |
| import requests | |
| ascii_set = set(ascii_lowercase) | |
| words = list(filter(lambda x: len(x) == 5 and len(set(x)) == 5 and len(set(x).intersection(set('aeiou'))) < 2, requests.get('https://raw.githubusercontent.com/dwyl/english-words/master/words_alpha.txt').text.split())) | |
| adj_list: Dict[str, Set[str]] = dict() | |
| letters_dict: Dict[str, Set[str]] = dict() | |
| for letter in ascii_lowercase: |