this easy version problem the difference easy hard version constraint k m version k2 m3 also version problem dont need output answer moduloyou give sequence length n consist integer 1 n the sequence contain duplicate ie element equalfind number tuple m 3 element maximum number tuple differ minimum k 2 formally need find number triple index j z thatmaxa_i a_j a_z mina_i a_j a_z le 2for example n4 a1243 triple i1 j2 z4 i2 j3 z4 if n4 a1111 possible triple suitable