Wipro NLTH Previous Year All Slot Programming Answers

> [11th Jan 2021 to 17th Jan 2021]

>

 

1) Security Key

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








/>

Text Box: Wipro NLTH Previous Year All Slot Programming Answers [11th Jan 2021 to 17th Jan 2021]

1) Security Key

Description

 


 

 


 

 


 

 


 

 

 

 

#

Input

Expected Output

 

1

578378923

3

 

Programming Language: C (GCC 9.2.0)



Text Box: Explanation

 


 

 

 

 

#

Input

Expected Output

1

572378233 3

3

 

 

 


 

3)

Text Box: Sum of Adjacent Distances
Difficulty: easy Max Points: 10

Description

 


 


Text Box: NA

Text Box: Example

 


 

 


 

 

 

 

#

Input

Expected Output

1

5 10 11 7 12 14

12

 



sum=sum+t;

 

 

 

printf("%d",sum);

 

}

 

 

}

 
4)

Text Box: Odd Even Online Game
Difficulty: easy Max Points: 10

Description

 


 

 


 

 


 

 


 



Text Box: Constraints

Text Box: Print an integer representing the sum of the largest and smallest prime numbers in the range of given numbers.

 


 

 


 

 


 

 

 

 

#

Input

Expected Output

1

-97 50

50

 

Text Box: Programming Language: C (GCC 9.2.0)
#include<stdio.h> int main()
{
 	long long int x,y,t;
 	scanf("%lld %lld",&x,&y);
 	if(x>y)
 	{
t=x; x=y; y=t;
 	}
 	long long int i,maxp,minp;
 	while(1)
 	{
if(x<0)
t=-x;
 	else
 	t=x;
 	for(i=2;i<=t/2;i++)
 	{
 	if(t%i==0)


 

 

 

6)

Text Box: SecretMessage agency
Difficulty: easy Max Points: 10

Description

 

Text Box: 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



Text Box: Difficulty: easy Max Points: 10

Description

 


 

 


 

 


 

 


 

 





Text Box: Constraints

Text Box: choose two cards. To win the game, the product of the values of the two cards must be the maximum value possible for any pair of cards in the display. The winning amount will be the sum of the two cards chosen by the player.
Write an algorithm to find the winning amount as the sum of the values of the two cards whose product value is maximum.
Input
The first line of the input consists of an integer numCards, representing the number of cards (N). The second line consists of N space-separated integers	, val1 , val2…., valN representing
the values on the cards. Output
Print an integer representing the sum of the values of the two cards whose product value is maximum.

 


 

 


 

 


 

 

 

 

#

Input

Expected Output

1

7 9 -3 8 -6 -7 8 10

19

 



 

10)

Text Box: Digital Secure Data Transfer Solutions
Difficulty: easy Max Points: 10

Description

 

Text Box: The company Digital Secure Data Transfer Solutions provides data encryption and data sharing services. Their process uses a key K for encryption when transmitting characters. To encrypt a character, the character is replaced by the following Kth character with the same case in the English alphabet set. The English alphabetical set is considered in a cyclic fashion for the last K characters.
Write an algorithm to find the character used to encrypt the given character. Input
The input consists of a space-separated character and integer - character and key, representing the character to be transmitted, and the key (K), respectively.
Output


Text Box: Print a character representing the encrypted character.

Text Box: Constraints

 


 

 


 

 


 

 

 

 

#

Input

Expected Output

1

D 3

G

 

Text Box: Programming Language: C (GCC 9.2.0)
#include <stdio.h>

int main()
{
 	char ch;
 	int k;
 	scanf("%c",&ch);
 	scanf("%d",&k);
 	k=k%26;
 	if(ch>='a' && ch<='z')
 	{
 	if(ch+k>'z')
 	ch=ch+k-26;
 	else
 	ch=ch+k;
 	}
 	if(ch>='A' && ch<='Z')
 	{
 	if(ch+k>'Z')

 


11)

Text Box: Pooled cab service
Difficulty: easy Max Points: 10

Description

 


 

 


 

 


 

 

Text Box: There are three employees with distances 38, 48 and 39 whose distance from the office lies within the given range.




 

13)

Text Box: Charlie Magic Mirror
Difficulty: easy Max Points: 10

Description

 

Text Box: Charlie has a magic mirror. The mirror shows right rotated versions of given word.To generate different right-rotations of a word. Write the word in a circle in clockwise order, then start reading from any given character in clockwise order till you have covered all the characters. In the word “sample”, if we start with ‘P’, we get the right rotated word as “plesam”. There are six such right rotations of “sample” including itself.


The inputs to the function isSameReflection consists of two string, word1 and word2. The function returns 1 if word1 and word2 are right rotations of the same word and -1 if they are not. Both word1 and word2 will strictly contain characters between ‘a’-‘z’ (lower case letters).

Constraints                                                                                                                 

 

 NA                                                                                                                                        

Example                                                                                                                 

 

Text Box: INPUT:
plesam


OUTPUT: 1

Explanation                                                                                                                 

 

 NA                                                                                                                                        

Public Test Cases                                                                                                                 

 




Text Box: Constraints