Light Mode
Dark Mode
My solution should not pass the check

My solution is:

between_markers = lambda a, b, c: a[a.find(b)+1: a.find(c)].lstrip(b) if c in a else a[a.find(b)+1:].lstrip(b)

It is an interminable solution and lack of readability, but I thought it is at least correct. However, after it showed "Task solved" I realized it is not. For example,

between_markers("<head><title>titleMy new site</title></head>",
                                         "<title>", "</title>")

will get the result 'My new site' rather than the expected 'titleMy new site'.

Hope you can add some extra checks in order to block such solutions. Thx

Created: Jan. 10, 2020, 12:05 a.m.
Updated: Jan. 10, 2020, 10:55 a.m.
0
10
User avatar
delapi