give array arr integer check exist index j j0 j arrlengtharri 2 arrj Example 1input arr 10253output trueexplanation for 0 j 2 arri 10 2 5 2 arrjexample 2input arr 31711output falseexplanation there j satisfy condition constraints2 arrlength 500103 arri 103