Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Check if two strings are anagrams

Easy

Problem Statement

Check if two strings are anagrams

Sample Input

listen, "silent"

Sample Output

true

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
import java.util.*; public class Main { public static boolean areAnagrams() { String s1 = "listen"; String s2 = "silent"; // Your code here return false; } }
Log in or sign up to run or submit your code.Log inSign up
Input
listen, "silent"
Expected Output
true