Question: I am using JAVA. and Bob each have an array of integers, namely A and B. A and B have the same size, say n.

 I am using JAVA. and Bob each have an array ofintegers, namely A and B. A and B have the same size,

I am using JAVA.

and Bob each have an array of integers, namely A and B. A and B have the same size, say n. Alice and ce Bob have come up with a new definition called "weird equality":two arrays A and B are weirdly equal to each other if at least one of the following four conditions is met 1) A- B, meaning that the elements in the corresponding indices are the same If n is divisible by 2, we divide each of the arrays to 2 parts of equal size. So. A will be divided to Ai and A2 (from left to right). Similarly, B is divided to B and B2. Now, the following conditions are checked and if any of them is statisfied we can still say that the arrays are weirdly equal to each other 2) (Ai is weird equal to Bi) AND (A2 is weird equal to B2) 3) LAy is weird equal to Bi) AND (A1 is weird equal to B2) 4) (A2 is weird equal to B2) AND (A2 is weird equal to Bi) Note: if n is not divisble by 2 then conditions 2, 3, and 4 are NOT satisfied At the moment, Alice and Bob are thinking day ahd night to see whether their arrays satisfy the weird equality or not. Write a code for them to determine this and end their pain! Input Format ine has integer 1 3 n 101 Second ine has n integers a t of array A. and the third line has n integers bo, bi,.. . ,n-1 of array B Constraints 0Sa s10 Output Format ENCe iftheir aceinot. This output is cas

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!