Skip to main content

Featured

Advent of Code 2020 | Day 4 | List<String>.contains()

Difficulty is increasing as the challenge is continuing and a bit more of thinking will be needed, it's time to start! Im pretty sure theres no way to compare the passports with validity requirements without using List String or array - we need to change the spaces to newlines or any other way as well, because there's no chance of splitting() we could use.  As usual for first ' splitting ' of the String, we use our line scanner , reformatting the passport file is necessary in order to get all the values correctly, there was no order or rule of sorting, now we have it. So if the line is blank we know that the passport we were checking right now is over and we can proceed to another one. Next we check if the  list has all the required values and if it has, valids will increase, don't forget to clear() the array for next passport. At the end we can print out the result, also keep in mind that the scanner must be closed to avoid memory leaks! I actually hadn'

Info

Hello, welcome to my blog, I'll try to answer all FAQ that will come into my mind.
1) What can I expect from this blog? Some free tools, releases and coding/ethical hacking tutorials.
2) How often are you going to upload this stuff? Every week, if I find time.

3) Ok, how can I learn to understand these things? Every time you can ask in comments, but remember to use Google first.

Comments

Popular Posts

RSS FEED

Crypto prices