you give 0indexed array nonnegative integer num for integer num find respective second great integerthe second great integer numsi numsj thatj inumsj numsiThere exist exactly index k numsk numsi k jIf numsj second great integer consider 1for example array 1 2 4 3 second great integer 1 4 2 3 3 4 1return integer array answer answeri second great integer numsi Example 1input num 24096output 96611explanation0th index 4 integer great 2 9 second integer great 2 right 21st index 9 6 second integer great 4 right 42nd index 9 6 second integer great 0 right 03rd index there integer great 9 right second great integer consider 14th index there integer great 6 right second great integer consider 1Thus return 96611example 2input num 33output 11explanationwe return 11 integer integer great Constraints1 numslength 1050 numsi 109