you give 0indexed integer array num you give integer key present numsfor unique integer target num count number time target immediately follow occurrence key num in word count number index that0 numslength 2numsi key andnumsi 1 targetreturn target maximum count the test case generate target maximum count unique Example 1input num 11002001100 key 1output 100explanation for target 100 2 occurrence index 1 4 follow occurrence keyNo integer follow occurrence key return 100example 2input num 22223 key 2output 2explanation for target 2 3 occurrence index 1 2 3 follow occurrence keyFor target 3 occurrence index 4 follow occurrence keytarget 2 maximum number occurrence follow occurrence key return 2 constraints2 numslength 10001 numsi 1000The test case generate answer unique