We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. Prepare
  2. Security
  3. Functions
  4. Security Functions II

Security Functions II

Problem
Submissions
Leaderboard
Discussions
  1. Prepare
  2. Security
  3. Functions
  4. Security Functions II
Exit Full Screen View
  • Problem
  • Submissions
  • Leaderboard
  • Discussions

We now understand the definition of functions.

If , where and then is called an image of , and is called the preimage of .

Given and ,

and

We call the function as (one-to-one) if:

Let us define a particular one-to-one function as , such that

where .

The function defined in the previous challenge is not one-to-one because:

Your task is to complete the function that takes as the input and return .

Constraints

  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy