Company: IDFC_27july

Difficulty: medium

Problem Statement

Convert String to Binary Problem Description You are given a string Str made up only of lowercase letters. Write a program that converts it to a binary string by mapping each character according to the table below: Character | Value ----------|------ a, b, c, g, e | 0 f, g, h, u | 0 i, j, k, l, o | 0 p, q, r, s, t | 0 u, v, w, x, y | 1 Then print the resulting binary string as the output. Read the input from STDIN and write the output to STDOUT. Do not print any extra text while reading the input or producing the output, since anything extra becomes part of the graded output. Input Format The single line of input is a string made up only of lowercase letters. Output Format Print the binary string obtained after the conversion. Constraints The input string Str consists only of lowercase letters; no other characters are permitted. Examples Example 1: Input: helloworld Output: 1000000100 Explanation: Converting the string "helloworld" character by character according to the mapping above

More IDFC_27july OA questionsInterview experiences