Posts

SecretMessage agency Difficulty: easy Max Points: 10 Description SecretMessage agency provides message encoding and decoding services for secure data transfer. The first step in decoding includes removal of special characters and the whitespaces from the message, as special characters and whitespaces do not hold any meaning. Write an algorithm to help the agency find the number of special characters and whitespaces in a given message. Input The input consists of a string message, representing the message that need to be decoded by the agency. Output

One Time Password Difficulty: easy Max Points: 10 Description An e-commerce site wishes to enhance its ordering process. They plan to implement a new scheme of OTP (One Time Password) generation for order confirmations. The OTP can be any number of digits. For OTP generation, the user will be asked to enter two random numbers. The first number entered should always be smaller than the second number. The OTP is calculated as the sum of the maximum and the minimum prime values in the range of the user-entered numbers. Write an algorithm to find the OTP Input The input consists of two space-separated integers – firstNumber and secondNumber, representing the two numbers entered by the user. Both numbers are considered in the range. Output

Odd Even Online Game Difficulty: easy Max Points: 10 Description You are playing an online game. In the game, a list of N numbers is given. The player has to arrange the numbers so that all the odd numbers of the list come after the even numbers. Write an algorithm to arrange the given list such that all the odd numbers of the list come after the even numbers. Input The first line of the input consists of an integer num, representing the size of the list (N). The second line of the input consists of N space-separated integers representing the values of the list. Output Print N space-separated integers such that all the odd numbers of the list come after the even numbers. Constraints NA Example Input : 8 10 98 3 33 12 22 21 11 Output: 10 98 12 22 3 33 21 11

Sum of Adjacent Distances Difficulty: easy Max Points: 10 Description Write a program to calculate and return the sum of distances between the adjacent numbers In an array of positive integers. Note: You are expected to write code in the find Total distance function only which receive the first parameter as the number of items in the array, and second parameter as the array itself. You are not requested to take input from the console. Constraints

Encode as Number Description A company wishes to encodes its data. The data is in the form of a number. They wish to encode the data with respect to a specific digit. They wish to count the number of times the specific digit reoccurs in the given data so that they can encode the data accordingly. Write an algorithm to find the count of the specific digit in the given data. Input The input consists of two space-separated integers- data and digit, representing the data to be encoded and the digit to be counted in the data. Output Print an integer representing the count of the specific digit. Constraints NA Example Input: 572378233 3 Output:

Security Key Description A company is transmitting data to another server. The data is in the form of numbers. To secure the data during transmission, they plan to obtain a security key that will be sent along with the data. The security key is identified as the count of the repeating digits in the data. Write an algorithm to find the security key for the data. Input The input consists of an integer data, representing the data to be transmitted. Output Print an integer representing the security key for the given data. If no data is repeated it should display -1 Constraints NA Example Input: 578378923 Output: 3 Explanation The repeated digits in the data are 7, 8 and 3. So, the security key is 3. Public Test Cases # Input Expected Output 1 578378923 3 Programming Language: C (GCC 9.2.0)