you give 0indexed integer array num integer key k A kdistant index index num exist index j j k numsj keyReturn list kdistant index sort increase order Example 1input num 3491395 key 9 k 1output 123456explanation here nums2 key nums5 key for index 0 0 2 k 0 5 k j 0 j k numsj key thus 0 kdistant index for index 1 1 2 k nums2 key 1 kdistant index for index 2 2 2 k nums2 key 2 kdistant index for index 3 3 2 k nums2 key 3 kdistant index for index 4 4 5 k nums5 key 4 kdistant index for index 5 5 5 k nums5 key 5 kdistant index for index 6 6 5 k nums5 key 6 kdistant indexthu return 123456 sort increase order Example 2input num 22222 key 2 k 2output 01234explanation for index num exist index j j k numsj key index kdistant index hence return 01234 Constraints1 numslength 10001 numsi 1000key integer array nums1 k numslength