I know that it is a little bit messy and probably not the most condensed it could be but it works with every single set of numbers that I plugin. I have absolutely no idea why this isn't working. I did it before got it right and then it didn't save.
package com.codegym.task.task05.task0531;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
Improving functionality
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(reader.readLine());
int b = Integer.parseInt(reader.readLine());
int c = Integer.parseInt(reader.readLine());
int d = Integer.parseInt(reader.readLine());
int e = Integer.parseInt(reader.readLine());
int minimum = min(a, b, c, d, e);
System.out.println("Minimum = " + minimum);
}
public static int min(int a, int b, int c, int d, int e) {
if (a < b && a < c && a < d && a < e) {
return a;
}
else if (b < a && b < c && b < d && b < e) {
return b;
}
else if (c < a && c < b && c < d && c < e) {
return c;
}
else if (d < a && d < b && d < c && d < e) {
return d;
}
else if (e<a && e<b && e<c && e<d) {
return e;
}
else if(a==b || a==c || a==d || a==e) {
if(b==c || b==d || b==e && b < a) {
if(c==d || c==e && c < b) {
return c;
}
return b;
}
return a;
}
else if(b==c || b==d || b==e) {
if(c==d || c==e && c < b) {
return c;
}
return b;
}
else if(c==d || c==e) {
return c;
}
else {
return d;
}
}
}