Question: Given an array called myArray, return true if array contains two integer numbers separated by a different integer element. [1, 7, 7] false7 and 7

Given an array called myArray, return true if array contains two integer numbers separated by a different integer element.

[1, 7, 7] false7 and 7 are not separated by any integer

[1, 7, 1, 7] true7 and 7 are separated by 1

[1, 7, 7, 7, 5]) false7 and 7 are not separated by another integer but 7 again

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!