insidcode
ProblemsDuelLeaderboardStats
Sign In
  1. Home
  2. Problems
  3. Check if the kth bit of a number is set (1) or unset (0).

Check if the kth bit of a number is set (1) or unset (0).

Difficulty: Medium

Phase: 6 · Mixed Logical Challenges

XP Reward: 20 XP

Topics: Mixed Logical Challenges, Medium

Supported Languages: Python, JavaScript, C, C++, Java

Problem Description

Given number N on line 1 and bit position K (0-indexed) on line 2, check if K-th bit is set. Print 'Set' or 'Unset'. Input Format: Read input from standard input (stdin). Output Format: Print the result to standard output (stdout).

Constraints

  • -10^9 <= N <= 10^9

Examples

Example 1

Input: 5 0

Output: Set

Explanation: Sample execution for input 5 0