KCE / Java

Java Programming Language
0 stars 3 forks source link

CoreTask#1: BeanArray - Submit Your Code in Comment Section #26

Open ErSKS opened 5 years ago

ErSKS commented 5 years ago

CoreTask#1: BeanArray - An array is defined to be a Bean array if it meets the following conditions a. If it contains a 9 then it also contains a 13. b. If it contains a 7 then it does not contain a 16. So {1, 2, 3, 9, 6, 13} and {3, 4, 6, 7, 13, 15}, {1, 2, 3, 4, 10, 11, 12} and {3, 6, 9, 5, 7, 13, 6, 17} are Bean arrays. The following arrays are not Bean arrays: a. { 9, 6, 18} (contains a 9 but no 13) b. {4, 7, 16} (contains both a 7 and a 16) Write a function named isBean that returns 1 if its array argument is a Bean array, otherwise it returns 0. Function signature is int isBean (int[ ] a)

Niranjan2054 commented 5 years ago

package beanarray;

/**