Problem setter: panik
Prerequisites: Implementations, usage of maps/dictionary(if in python).
I this question for statements to not contradict, all the statement arrays of the selected people should be similar. We can do this by taking the count of each distinct array with the help of maps and then Iterating all of them and finding the maximum count with the correct Statements.
Note: A statement array will only be considered correct if the count of True in it is equal to the count of that type of substring. This could be seen in sample Test case 2. Although the count of T T T was 2, the final answer was 1 because according to them all of them were true speaking by according to the 3rd person, he only considered himself to be a true speaking person.
Time complexity: O(nlog(n)) -> log(n) factor occurs due to usage of maps.
Author’s Solution: click here
Tester’s Solution: click here