you give integer array num length n integer limit in replace integer num integer 1 limit inclusivethe array num complementary index 0indexe numsi numsn 1 equal number for example array 1234 complementary index numsi numsn 1 5return minimum number move require num complementary Example 1input num 1243 limit 4output 1explanation in 1 change num 1223 underline element changednums0 nums3 1 3 4nums1 nums2 2 2 4nums2 nums1 2 2 4nums3 nums0 3 1 4therefore numsi numsn1i 4 num complementaryExample 2input num 1221 limit 2output 2explanation in 2 move change num 2222 you change number 3 3 limitExample 3input num 1212 limit 2output 0explanation num complementary Constraintsn numslength2 n 1051 numsi limit 105n