Array filtering: [1,1,2,3,3,4] → [1,1,3,3]
Asked in the Round 2: Technical + System Design (Tech Manager) stage. Coding challenge: keep only elements that appear more than once.
Implement filter_repeated(nums) to return all occurrences of values whose total frequency is greater than one. Preserve the original order and do not modify nums.
nums.def filter_repeated(nums):