Greetings. I need some help with a programming problem I'm solving. The problem sounds like this:
Gyazo - c42a2235b5aa7285a94d8eb7748831a6.png
I know how to solve it in my head but I don't know how to translate it into Java language due to lack of experience (2 weeks). My solution I've formed in my head is: create a new array for the numbers that are in improvement and then declare a "max" variable. Check which array's length is higher and print that length. What I don't know to do is: I don't know how to create a new array for each numbers that are passing through the condition.
Note: I couldn't find anything on internet about my problem so that's why I'm here.
My code is this one:
class MyClass { static int progresie=0; public static void longest_improvement(Integer[] grades) { for(int i=0;i<grades.length-1;i++){ if(grades[i]<=grades[i+1]){ progresie ++; } } System.out.println(progresie); } }