Course Info

Lecture

Anagram Checker - Problem Solution

Explore three methods to determine if two strings are anagrams of each other.

Method 1
def solution(s1, s2): return sorted(s1) == sorted(s2)

Usage Example

Input/Output Example
result = solution("listen", "silent") print(result) # Output: True
Previous lessonCoding Quiz - Detecting AnagramsNext lessonCoding Quiz - Remove the Smallest Number
Lessons in this chapter · Python Coding Quiz Practice
  1. 1. Coding Quiz - Palindrome Check
  2. 2. Checking for Palindrome Strings - Problem Solving
  3. 3. Coding Quiz - Find Unique Words
  4. 4. Finding Unique Words - Problem Solving
  5. 5. Coding Quiz - Caesar Cipher
  6. 6. Caesar Cipher - Problem Solving
  7. 7. Coding Quiz - Find Prime Numbers
  8. 8. Finding Primes - Problem Solving
  9. 9. Coding Quiz - Finding Indices for a Target Sum
  10. 10. Creating Target Value with Two-Sum - Problem Solution
  11. 11. Coding Quiz - Maximize Stock Trading Profit
  12. 12. Finding Maximum Profit - Solution Explanation
  13. 13. Coding Quiz - Detecting Anagrams
  14. 14. Anagram Checker - Problem Solution
  15. 15. Coding Quiz - Remove the Smallest Number
  16. 16. Removing the Smallest Number - Problem Solution

Lecture

AI Tutor

Design

Upload

Notes

Favorites

Help