6**2 answer nice one
6**2 answer nice one
I used Python, I opened the file in read mode and iterated through all the lines while increasing the count by 1 when either no. of 0s is divisible by 3 or no. of 1s is even.
I used C++
I used C++
if you got a number as an answer then you should directly write it in
It is not AND, it is OR. SO lines which have no 0's or 1's are checked for the other condition, and included or excluded based on the result
Actually I want to report a bug in the question. In the 10000 lines of 0 and 1, there are: 6660 lines being mixture of 0 and 1 (or only 0 and 1) that fulfill the condition, 3338 lines being mixture of 0 and 1 that DOES NOT fulfill the condition, and 2 lines being "0000000000" (that is 10 zeros). These 2 lines does not fulfill the condition but apparently have to be counted as part of the answer.
These 2 lines probably passed because they do not contain any 1, so if u count the number of ones and mod 0 it u get 0 which still pass in certain codes.
Hopefully this get patched by either removing those 2 lines or changing the answer to 6660 :)
It took me 1 hour to finish it because I thought I needed to separate lines on which the 0 were repeating on each 3rd index and those on which the 1 were repeating on each 2nd index. But then I realized it made no sense because the data returned was gibberish in a sense, and so I thought maybe I just need to count the number of 0s and 1s in each line and based on the modulo operator (%) increment the counter. That worked... Decoding the question alone took 99% of my time.
Lol not sure how to ask that question any easier...
If i read sth. i normally don't think about it like a boolean expression. If i read a or i think about it like "that or that" and not "that or that, but also both". I think you know what i mean.
"I need to know how many lines there are where the number of 0's is a multiple of 3 AND / OR the numbers of 1s is a multiple of 2." Ye but I'm a bit special in that kind of way.
1 month ago
I made use of a simple Python Program to complete this challenge...makes it really quick in a file with that much lines lol