This page is still under construction.

Parts of this page are still being built. What you see may change.

finitefunc

Time limit2sMemory limit1024 MB

Summary
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 f ⁣:X→Yf\colon X\to Y, where XX is a finite set. The value of ff at x is D[x], and the domain XX is the set of all keys of D. Return the range {f(x):x∈X}\{f(x):x\in X\} as a Python set.

Write a function finitefunc.

  • Input parameter: a dict object D
    • D has at most 1000 keys.
    • Every key and value of D is an int object whose absolute value is at most 10001000.
  • Return value: a set object S representing the range of the function
    • Every element of S is an int object.

Examples1

  1. Example 1

    Input
    1
    0 0
    
    Expected output
    0