Question: Toggle Sidebar New Agent Hotel Double Cross Akshay words for the Socret Intelligent Servics His role involves decoding cryptic information Recently he has received 3
Toggle Sidebar
New
Agent
Hotel Double Cross Akshay words for the Socret Intelligent Servics His role involves decoding cryptic information Recently he has received sets of numbers arrays of numbers The number of elements in vach set in each array is the same. These numbers have to be decoded to find the room number of a person staying in Hotel Double Cross. The below example demonstrates the steps to be performed while decoding the given numbers
Example Let us assume that the set of numbers are as below
input
input
input
Step : Generate a new set of elements by adding numbers present at the same index in the three
armays. So we get, Step The array generated in step represents the position of the elements in the three arrays
Le
the first number represents the number in th position in the FIRST array
the second number represents the number in th position in the SECOND array. the third number represents the number in th position in the THIRD array.
the fourth number represents the number in th position in the FIRST array.
In STEP our task is to pick the numbers from these specified positions from the respective
arrays. Le
Number at th position in the FIRST array is
Number at th position in the SECOND array is Note that the array contains only elements, so the th position can be found by counting the positions in cyclic manner, ie after reaching last element of the array, continue counting from the first element of the array. This way the number in the th position in the second array is
Number at th position in the THIRD array is apply same counting logic as above Number at th position in the FIRST array is apply same counting logic as above
So we get the positional numbers as
Step : Add ALL the positional numbers generated in step to get the FINAL Result which represents the room number in Hotel Double Cross. ie Room number
Note:
There will always be THREE input arrays
All arrays will have the same number of elements
The number of array elements is specified by input
The array elements will always be positive numbers greater than Note:
There will always be THREE input arrays
All arrays will have the same number of elements
The number of array elements is specified by input
The array elements will always be positive numbers greater than
input input
Example : Let us now assume the input arrays are as given below:
input inputthe number of elements in each of the input arrays
Step: The new set of elements by adding numbers present at the same index in the three arrays will be
number present at position in input
Step: Picking up numbers from input input and input based on the output of Step we get:
number present at position in input
number present at position in input
number present at position in input
number present at position in input
number present at position in input
number present at position in input
Step: Sum of these numbers gives the Room Number:
Author: Pranam Kaushik
Here is the incomplete Java code please give total code:
import java.io;
import java.util.;
Read only region start
class UserMainCode
public int findRoomNoint input int input int input int input
Read only region end
Write code here...
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
