[Community puzzle] Bulk Email Generator

Why can’t I split the input with .splilines() in Python3? It returns a number of lists instead of one for each line.

I don’t know Python, so I won’t answer that part of your question, but keep in mind this puzzle is not line-based.

See for example the last choice of test 3 “Edge Cases”, that spans three lines.

in test 3 the lies after unwrap gives 2 identical choices linesInput[4] = “(Multi”;
linesInput[5] = “line|Multi”;
linesInput[6] = “line)”;
unwraped Multiline|Multiline
and the solution must be Multi ??? what am I missing

Based on the input you provided, the solution would appear to be:

Multi
line

thanks :open_mouth: :heart:

Hi. I passed all tests but got only 80%. I think I covered all possible cases. I use java. May I ask for any advice?

Which validator do you fail at ?

Last one, #5 More Edge Cases

Have you considered this case:

(|)

?

2 Likes

Nope, you got me! :flushed: I applied this one and got 100%. Thanks a lot!

Really nice riddle… and I take it as a nice exercise for regex.

Still struggling why my nice regex in Python fails in the multiline case. (Works find for single lines and results ins nicely compact code.j)
pattern = re.compile(r’(([^)]*))’,re.MULTILINE)

It still fails for testcase03
(Multi
line|Multi
line)

Tinkering… :nerd_face:

1 Like