Question: USE JAVA LANGUAGE TO IMPLEMENT The craziness of an integer X is defined as follows: . If X is even the craziness of X is

USE JAVA LANGUAGE TO IMPLEMENT

The craziness of an integer X is defined as follows:

. If X is even the craziness of X is X/2.

. Else the craziness of X is X.

You are given an array A with N elements A, A2, AN. You create a new array B, which is initially empty.

Then for each 1

1. You add A at the end of B.

2. You add the craziness of A, at the end of B.

After that, a monster takes both the arrays from you and randomly shuffles the array B. and returns only array B to you. You attempt to find array A from array B.

Your task is to find the product of all elements of array A mod 109+7. You will return 0 if no such array exists.

Note:

 USE JAVA LANGUAGE TO IMPLEMENT The craziness of an integer X

Constraints 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!