give integer array nums partition contiguous subarray leave right thatevery element leave equal element rightleft right nonemptyleft small possible sizereturn length leave partitioningt case generate partitioning exist Example 1input num 50386output 3explanation leave 503 right 86example 2input num 1110612output 4explanation leave 1110 right 612 constraints2 numslength 1050 numsi 106there valid answer give input