{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "

242. Valid Anagram

\n", "
\n", "\n", "\n", "

Given two strings s and , write a function to determine if t is an anagram of s.

\n", "\n", "

Example 1:

\n", "\n", "
Input: s = \"anagram\", t = \"nagaram\"\n",
    "Output: true\n",
    "
\n", "\n", "

Example 2:

\n", "\n", "
Input: s = \"rat\", t = \"car\"\n",
    "Output: false\n",
    "
\n", "\n", "

Note:
\n", "You may assume the string contains only lowercase alphabets.

\n", "\n", "\n", "

 

\n", "Source \n", "
\n", "\n", "

Code

" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "def is_anagram(s, t):\n", " pass" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "

Follow up:

\n", "

What if the inputs contain unicode characters? How would you adapt your solution to such case?

\n", "\n", "

Code

" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "def is_anagram(s, t):\n", " pass" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.2" } }, "nbformat": 4, "nbformat_minor": 1 }