menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Data Science News

>

Mull It Over
source image

Dev

4w

read

252

img
dot

Image Credit: Dev

Mull It Over

  • In Part 1, the author uses regex to find all instances of mul(N,N) and performs the appropriate extraction and math for each match.
  • For Part 2, the author uses regex to match do() and don't() occurrences and then isolates each stretch of valid statements to check for mul statements to parse.
  • The author implements an algorithm to handle various conditions, finds the start and end indices for each substring, and calculates the muls in the substrings.
  • The code generates the correct answer for both the example input and the author's puzzle input.

Read Full Article

like

15 Likes

For uninterrupted reading, download the app