Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Words with same letters
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { Scanner sc=new Scanner(System.in); char[] first=sc.nextLine().toCharArray(); char[] second=sc.nextLine().toCharArray(); HashSet<Character> f=new HashSet<>(); HashSet<Character> s=new HashSet<>(); for(char c:first){ if(!f.contains(c)) f.add(c); } for(char c:second){ if(!s.contains(c)) s.add(c); } if(s.equals(f)){ System.out.println("Same"); }else System.out.println("Not Same"); } }
run
|
edit
|
history
|
help
0
getListVehicules
1
Fibonacci numbers 0 - 94
jb6.6 str rec
Java For Each Loop
java
1.6
Roberto02
break
j