Check Permutation Problem Statement

Given two strings 'STR1' and 'STR2', determine if they are anagrams of each other.

Explanation:

Two strings are considered to be anagrams if they contain the same characters, regardless of the order.

Input:

The first line contains an integer 'T' denoting the number of test cases.
The first and only line of each test case contains two space-separated strings 'STR1' and 'STR2'.

Output:

For each test case, return true if the two strings are anagrams, otherwise return false.
Output each result on a new line.

Example:

Input:
T = 1
STR1 = "listen" STR2 = "silent"
Output:
true

Constraints:

  • 1 <= T <= 100
  • 1 <= |STR1|, |STR2| <= 103

Where |STR1| and |STR2| are the lengths of the strings 'STR1' and 'STR2' respectively.

Time limit: 1 sec

AnswerBot
4mo

Check if two strings are anagrams of each other by comparing their characters.

  • Create a character frequency map for both strings and compare them.

  • Sort both strings and compare if they are equal.

  • Use a h...read more

Help your peers!
Select
Add answer anonymously...

Top Member Technical Staff Interview Questions Asked at VMware Software

Q. Convert Array to Min Heap Task Given an array 'ARR' of integers with 'N' element...read more
Q. Tower of Hanoi Problem Statement You have three rods numbered from 1 to 3, and '...read more
Q. What is a page fault?
Member Technical Staff Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits