• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
September 15, 2023 |430 Views
SDE Sheet - Anagrams
  Share   Like
Description
Discussion

This video is part of the Strings section in the GFG SDE Sheet.

Given a String S, reverse the string without reversing its individual words. Words are separated by dots.

Example :

In this video, we are 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 :

Input: a = geeksforgeeks, b = forgeeksgeeks
Output: YES

Explanation: Both the string have same characters with same frequency. So, both are anagrams.

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-

Article: https://www.geeksforgeeks.org/check-whether-two-strings-are-anagram-of-each-other/
Problem: https://practice.geeksforgeeks.org/problems/anagram-1587115620/1
SDE Sheet: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/

Read More