and welcome to the 54th edition of the Screenshot of the Week!
To start with, congratulations to the winner of the previous contest! arghtype's evening ride in days-gone, won with a handy 16 votes:
To submit a screenshot, simply post it as an answer to this question, but please take note of the...
I'm tracking the count of each polymer pair, and then at the end I add up each polymer based on the pairs and divide it by two to account for the fact that the pairs overlap
But that doesn't properly account for the fact that either end of the string doesn't overlap
And I'm not sure how to figure out which polymer is the one that's going to be off by one
@SaintWacko I'd count the characters as you go, instead of calculating it all at the end. so I had a dictionary which tracked the pairs, and another which tracked individual characters.
@SaintWacko I originally thought of trying to count it at the end, but then I thought that accounting for the overlapping would be a huge pain in the ass, so I just counted it as I went. Plus it is more efficient.
@Wipqozn Yeah, I knew I was going to have a problem with the overlapping, but I figured I'd solve it when I got to it. Then I couldn't figure out how to solve it lol
@SaintWacko Same. First attempt at part 2, out of memory exception after like 5 minutes. Second attempt, 9 milliseconds
@SaintWacko If you did it anything remotely like how I did it, you probably forgot to add in the last character of the string
@Wipqozn I had a dictionary which tracked pairs. Final count could be calculated by just looking at the first character of each pair (because the 2nd character would be covered by another pair). But then you have to make sure you add in the very last character of the whole thing.
(since the last char of the whole thing isn't counted in the first char of any pairs)