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.
Ah, this was some good advice on increasing readability. It was always fun to solve the problem with least lines of code, but not so fun when you try to work with it again after 3 months.
In your solution, the lookahead in the 2nd and 3rd filter could be removed to further simplify things. They were present in the original solution to prevent "consuming" the string when matched, but in your case the matchings are seperated so lookahead is not required.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Validating UID
You are viewing a single comment's thread. Return to all comments →
Ah, this was some good advice on increasing readability. It was always fun to solve the problem with least lines of code, but not so fun when you try to work with it again after 3 months.
In your solution, the lookahead in the 2nd and 3rd filter could be removed to further simplify things. They were present in the original solution to prevent "consuming" the string when matched, but in your case the matchings are seperated so lookahead is not required.