Question
Language is in Java, please explain the answer using comments, Thank you. I always rate!!! PLEASE DO NOT import any packages to solve the problem.
Language is in Java, please explain the answer using comments, Thank you. I always rate!!!
PLEASE DO NOT import any packages to solve the problem. PLEASE use classes and methods from java.lang.*, since they are automatically imported without import statement.
build a method called;
public static boolean decreasing3(int[] elems)
This method takes in an integer array and returns true if the array somewhere contains three continuously decreasing numbers.
Example:
Input: [10, 11, 12, 7, 6, 5]
Output: true
//Explanation: 7, 6, 5 are decreasing.
Input: [100, 5, 30, 18, 19, 40]
Output: false
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started