The output is correct but it doesn't pass the last verification statement (The min(a, b, c, d) method must return the minimum of the numbers a, b, c, and d.)
Any help appreciate (and apologies for not presenting the code in my first attempt to ask for help:))
package com.codegym.task.task02.task0217;
/*
Minimum of four numbers
*/
public class Solution {
public static int min(int a, int b, int c, int d) {
//write your code here
int result= (min(a,b));
if(min(a,b)>c) result = c;
if(c>d) result = d;
return result;
}
public static int min(int a, int b) {
//write your code here
int result = a;
if (result>b) result = b;
return result;
}
public static void main(String[] args) throws Exception {
System.out.println(min(-20, -10));
System.out.println(min(-20, -10, -30, -40));
System.out.println(min(-20, -10, -30, 40));
System.out.println(min(-40, -10, -30, 40));
}
}