there type personsthe good person the person tell truththe bad person the person tell truth lieYou give 0indexed 2d integer array statement size n x n represent statement n people more specifically statementsij following0 represent statement person person j bad person1 represent statement person person j good person2 represent statement person person jAdditionally person make statement Formally statementsii 2 0 nreturn maximum number people good base statement n people example 1input statement 212122202output 2explanation each person make single statement person 0 state person 1 good Person 1 state person 0 good Person 2 state person 1 badlet person 2 key assume person 2 good person base statement person 2 person 1 bad person now know sure person 1 bad person 2 good base statement person 1 person 1 bad tell truth there contradiction case assumption invalid lie in case person 0 bad person lie statement follow person 2 good person good person group assume person 2 bad person base statement person 2 person 2 bad tell truth follow scenario person 0 1 bad explain follow person 2 bad tell truth good person group lie in case person 1 good person since person 1 good person person 0 good person follow person 2 bad lie good person groupWe 2 person good good case return 2note way arrive conclusionexample 2input statement 2002output 1explanation each person make single statement person 0 state person 1 bad Person 1 state person 0 badlet person 0 key assume person 0 good person base statement person 0 person 1 bad person lie follow person 0 good person good person group assume person 0 bad person base statement person 0 person 0 bad tell truth follow scenario person 0 1 bad follow person 0 bad tell truth good person group lie in case person 1 good person follow person 0 bad lie good person groupWe person good good case return 1note way arrive conclusion Constraintsn statementslength statementsilength2 n 15statementsij 0 1 2statementsii 2