From 5c7486e29bcc6aecf44212caa3b2178d791574b8 Mon Sep 17 00:00:00 2001 From: sushree007 <69665499+sushree007@users.noreply.github.com> Date: Sat, 31 Oct 2020 18:43:26 +0530 Subject: [PATCH] Anagrams The code checks if two given strings are "anagrams". --- anagram | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 anagram diff --git a/anagram b/anagram new file mode 100644 index 0000000..087810c --- /dev/null +++ b/anagram @@ -0,0 +1,48 @@ +import java.util.Scanner; + +public class MyClass { + + static boolean isAnagram(String a, String b) { + // Complete the function + int p[]=new int[256]; + int q[]=new int[256]; + + if(a.length()==b.length()) { + a=a.toUpperCase(); + b=b.toUpperCase(); + for(int i=0;i