3 ms·
Me too. I had to look it up. This page has pretty good breakdown: https://itnext.io/a-wild-way-to-check-if-a-number-is-prime-using-a-regular-expression-4edfb
by rprenger 5y ago
Me too. I had to look it up. This page has pretty good breakdown:
https://itnext.io/a-wild-way-to-check-if-a-number-is-prime-using-a-regular-expression-4edfb725f895 https://itnext.io/a-wild-way-to-check-if-a-number-is-prime-u...
The main trick for me was you first have to convert the number to unary, which was done outside of the regex.