Given an array nums where each integer is between 1 and 100, return a sorted array containing only duplicate numbers from the given nums array.
duplicateNums([1, 2, 3, 4, 3, 5, 6]) ➞ [3]
duplicateNums([81, 72, 43, 72, 81, 99, 99, 100, 12, 54]) ➞ [72, 81, 99]
duplicateNums([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) ➞ null
The given array won't contain the same number three times.