Valid Anagram - Leetcode 242 - Python Problem #3

Given two strings s and t, return true if t is an anagram of s, and false otherwise.
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.
Example 1:
Input: s = "anagram", t = "nagaram"
Output: true
Example 2:
Input: s = "rat", t = "car"
Output: false
Code: github.com/abhishekmshr956/Le...
LinkedIn: / abhishekmishraiitkgp
Twitter: / abhishek_iitkgp
0:00 Valid anagrams definition
1:33 Solution1 O(n) using two hash maps
5:18 Code for solution1
9:33 Code for solution2 O(n) using one hash map
14:36 Solution3 O(nlogn) using sorting
16:52 Code for solution3

Пікірлер: 2

  • @harshitsherawat1869
    @harshitsherawat18699 ай бұрын

    Where were you sir from so many time ?

  • @AbhishekMishraiitkgp

    @AbhishekMishraiitkgp

    9 ай бұрын

    finishing up my PhD