repl.it
@anonymous/

GrossHeartfeltMaggot

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
import java.util.*;
class Main{
	public static void main(String[]a){f("A-");}
	
	static void f(String s){List<String>l=new ArrayList(Arrays.asList("A+,B+,AB+,O+,A-,B-,AB-,O-".split(","))),m=new ArrayList(l);int i=l.contains(s)?1:0/0;l.removeIf(x->g(s,x)<1);m.removeIf(x->g(x,s)<1);System.out.print(l+","+m);}static int g(String s,String t){for(char c:s.replaceAll("O|-","").toCharArray())if(!t.replaceAll("O|-","").contains(""+c))return 0;return 1;}
}