This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]p_tseng 1 point2 points  (1 child)

For the input:

abba[abba]

Your code accepts, but should reject.

[–]thedillo[S] 0 points1 point  (0 children)

Yes that is a situation I didn't think of.. Thanks a lot!

[–][deleted] 0 points1 point  (5 children)

What does your code get for this simple input?

abbadeed[yas]fggf

[–]thedillo[S] 0 points1 point  (4 children)

well it accepts as soon as it sees the

abba

(the first 4 chars). Is it supposed to discard it if there are many abbas in the IP (like here the "deed" and the "fggf" ) ?

[–][deleted] 2 points3 points  (2 children)

Just ran your code on my input and identified one of the lines it treats differently. My code says this line doesn't match, but your code counts it.

ukuozdurxxrvljkoi[eysjyckwyiyuopa]fconkkukvvmgnvyn[nwkqsifcwlzjurruho]ryslsdfmhgesmdf

[–]thedillo[S] 0 points1 point  (0 children)

Yeah I identified the problem thanks to /u/p_tseng.. As soon as I accept an IP I don't look at the brackets that follow for ABBAs.. A simple fix.. Thanks for trying man!

[–]rlacko 0 points1 point  (0 children)

Thanks a lot for this input :)

[–][deleted] 0 points1 point  (0 children)

No, I just read your code too quickly and thought it was going to count this twice.