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
frequency of char
Sort an array of 0's 1's 2's 3 pointer approach
f
To check whether a given number is smith number or not
Find merge point of two linkedlists - solution 1
Кошачья бойня
assignment 3
vsecodertest2
Two Sum in Sorted input array
preincrement