Find a More General Approach
00:00
This seems like something that we can use as a simpler way to test things than what we did with the full any()
combination earlier. And more importantly, this is something that will work equally well if our marker length is fourteen.
00:14
So if I do this, and actually let’s add in here len(set(candidate))
, the length of the set of the candidate.
00:24 So if we run this, we can see that it still works, even with the full-length thing. In this case, there are apparently nine different characters, which is definitely less than fourteen.
00:36 So this seems promising as a more general approach.
00:42 Okay. I like that you are dissecting it a little bit in the sense that you’re not going into the loop right away, but you’re kind of trying out with variable change if you’re going into the right direction, so because now with the second part of the puzzle in place, we kind of know that the marker length is important for our solution and switching back and forth kind of verifies that you’re on the right track for this.
01:07 Exactly. And yeah, you mentioned looping, and that’s now the kind of missing piece of the puzzle that we need to add in here is that we want to do some kind of loop over the full stream until we find a proper marker.
Become a Member to join the conversation.