you give integer n a 0indexed integer array num length n 1 generate follow waynums0 0nums1 1nums2 numsi 2 2 nnums2 1 numsi numsi 1 2 2 1 nReturn maximum integer array num Example 1input n 7output 3explanation according give rule nums0 0 nums1 1 nums1 2 2 nums1 1 nums1 2 1 3 nums1 nums2 1 1 2 nums2 2 4 nums2 1 nums2 2 1 5 nums2 nums3 1 2 3 nums3 2 6 nums3 2 nums3 2 1 7 nums3 nums4 2 1 3hence num 01121323 maximum max01121323 3example 2input n 2output 1explanation according give rule num 011 the maximum max011 1Example 3input n 3output 2explanation according give rule num 0112 the maximum max0112 2 Constraints0 n 100