give array arr represent permutation number 1 nyou binary string size n initially bit set zero at step assume binary string arr 1indexed 1 n bit position arri set 1you give integer m find late step exist group one length m a group one contiguous substre 1s extend directionReturn late step exist group one length exactly m if group exist return 1 Example 1input arr 35124 m 1output 4Explanation Step 1 00100 group 1step 2 00101 group 1 1step 3 10101 group 1 1 1step 4 11101 group 111 1step 5 11111 group 11111the late step exist group size 1 step 4example 2Input arr 31542 m 2output 1explanation Step 1 00100 group 1step 2 10100 group 1 1step 3 10101 group 1 1 1step 4 10111 group 1 111step 5 11111 group 11111no group size 2 exist step Constraintsn arrlength1 m n 1051 arri nAll integer arr distinct