Wipro Elite Coding Problem #5 | Missing Data

Today we are going to discuss some Wipro Elite Coding Questions that has been asked in previous years in Wipro for Project Engineer role for Freshers.

So, If you are appearing in Wipro Elite, then there are fair chances that you can get same difficulty level of questions in your actual exam.

Wipro elite coding problem 5

Hi all, Welcome to Jobs Adda. Here you would get all fresher jobs updates and placement material for engineering graduates related to IT/Core sector.

To get all job updates on time, Don’t forget to join our whatsapp group. Click below to join.


A company provides network encryption for secure data transfer. The data string is encrypted prior to transmission and gets decrypted at the receiving end. But due to some technical error, the encrypted data is lost and the received string is different from the original string by 1 character. Arnold, a network administrator, is tasked with finding the character that got lost in the network so that the bug does not harm other data that is being transferred through the network. Write an algorithm to help Arnold find the character that was missing at the receiving end but present at the sending end.

Input
The input consists of two space-separated strings – stringSentand stringRec, representing the string that was sent through the network, and the string that was received at the receiving end of the network, respectively.

Output
Print a character representing the character that was lost in the network during transmission and if there is no data loss during transmission then print “NA”.

Constraints
NA

Example

Input:
abcdfjgerj abcdfijger

Output:
j

Explanation:
The character ‘j’ at the end of the sent string was lost in the network during transmission.

Solution: In C

#include <stdio.h>
int main()
{
    char s[1000],r[1000];
    scanf("%s %s", s,r);
    int i;
    for(i=0;s[i]!='\0';i++)
    {
        if(s[i]!=r[i])
        {
            printf("%c",s[i]);
            break;
        }
    }
    if(s[i]=='\0')
        printf("NA");
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Discover more from Jobs Addaa

Subscribe now to keep reading and get access to the full archive.

Continue reading