3581. The Two Sneaky Numbers of Digitville
My accepted Python solution to LeetCode problem 3581, The Two Sneaky Numbers of Digitville, running in 2ms.
- Difficulty: Easy
- Python
- Runtime 2ms
- Memory 17.3MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 2ms, memory 17.3MB, accepted 2026-01-01.
class Solution:
def getSneakyNumbers(self, nums: List[int]) -> List[int]:
from collections import Counter
freq = Counter(nums)
return [num for num, count in freq.items() if count == 2]