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

Security Functions

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

Before we jump into security concepts, let us familiarize ourselves with the mathematical background required for it.

Set is a collection of elements. Here, is one such example. A collection of integers is also a set.

Given two sets, and , we define a function that maps every element in to precisely element in .

If and , the function will return:

, and .

Let us define a function , where and .
Here, is defined as the remainder of when divided by .

Your task is to complete the function that takes the input and returns

Constraints

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