finitefunc
Time limit2sMemory limit1024 MB
Given a dictionary D, return the set of its values as a Python set.
- Level
Easy1 of 10
- Topics
- Hash map
- Solved
- No attempts yet
Problem
A function whose domain is a finite set can be implemented using a Python dictionary. Let D be such a Python dictionary corresponding to the mathematical function , where is a finite set. The value of at x is D[x], and the domain is the set of all keys of D. Return the range as a Python set.
Write a function finitefunc.
- Input parameter: a
dictobjectDDhas at most 1000 keys.- Every key and value of
Dis anintobject whose absolute value is at most .
- Return value: a
setobjectSrepresenting the range of the function- Every element of
Sis anintobject.
- Every element of