online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
import java.util.Scanner; public class Main { static boolean isAnagram(String a, String b) { // Convert strings to lowercase for case-insensitive comparison a = a.toLowerCase(); b = b.toLowerCase(); if (a.length() != b.length()) { return false; } int[] count = new int[26]; // Assuming only lowercase letters for (int i = 0; i < a.length(); i++) { count[a.charAt(i) - 'a']++; count[b.charAt(i) - 'a']--; } for (int i = 0; i < 26; i++) { if (count[i] != 0) { return false; } } return true; } public static void main(String[] args) { Scanner scan = new Scanner(System.in); String a = scan.next(); String b = scan.next(); scan.close(); boolean ret = isAnagram(a, b); System.out.println(ret ? "Anagrams" : "Not Anagrams"); } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue