Skip to content

Anagram #63

@Harsh76200

Description

@Harsh76200

❗Write Code in Only One Language ( CPP , C , Java , Python )

Give File Name : Anagram ✅ In respective language folder

📑 DESCRIPTION

Anagram

Difficulty: Easy

Given two strings a and b consisting of lowercase characters. The task is to check whether two given strings are an anagram of each other or not. An anagram of a string is another string that contains the same characters, only the order of characters can be different. For example, act and tac are an anagram of each other.

Note:-

If the strings are anagrams you have to return True or else return False

|s| represents the length of string s.

Example 1:

Input:a = geeksforgeeks, b = forgeeksgeeks
Output: YES
Explanation: Both the string have same characters with
        same frequency. So, both are anagrams.

Example 2:

Input:a = allergy, b = allergic
Output: NO
Explanation: Characters in both the strings are 
        not same, so they are not anagrams.

Follow-up: Can you come up with an algorithm that is less than O(n^2) time complexity?

Metadata

Metadata

Labels

CC Programming LanguageassignedAssigned Issuec++C++ Programming Languagegood first issueGood for newcomershacktoberfestHacktoberfest Issuehacktoberfest-2023Hacktoberfest 2023 Issuehacktoberfest-acceptedAccepted for HacktoberfestjavaJava Programming LanguagepythonPython Programming LanguagestringQuestion related to string

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions