Last thread introduced a lot of bickering and anger, let's see if we can replicate that.
Rules
Commit your solution to the challenge in this thread. (Solutions written by women and solutions written in Rust receive a 10% bonus when being rated)
Challenge
The major element in a sequence with the length of L is the element which appears in a sequence more than L/2 times. The challenge is to find that element in a sequence.
Input sample:
92,19,19,76,19,21,19,85,19,19,19,94,19,19,22,67,83,19,19,54,59,1,19,1992,11,30,92,1,11,92,38,92,92,43,92,92,51,92,36,97,92,92,92,43,22,84,92,924,79,89,98,48,42,39,79,55,70,21,39,98,16,96,2,10,24,14,47,0,50,95,20,95,48,50,12,42
Your program should accept as its first argument a path to a filename. Each line of the file contains a sequence of integers N separated by comma. E.g.
Output sample:
1992None
For each sequence print out the major element or print "None" in case there is no such element. E.g.
Constraints:
N is in range [0, 100]
L is in range [10000, 30000]
The number of test cases