SackCastellon / tmog-007

The Mirror of Galadriel - Episode #007

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The Mirror of Galadriel!

Episode #007 - Valid Anagram

Welcome to The Mirror of Galadriel, one of the activities that will follow in the The Fellowship of Code. If you haven't been here before, this is a place where programming problems of different types will be proposed to be solved as fast as possible.

Without further ado, we leave you with the next problem.

Good luck adventurers!

Statement

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.

Constraints

1 <= s.length, t.length <= 5 * 10^4
s and t consist of lowercase English letters.

Examples

Example 1

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

Example 2

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

Extra

Here you can find the spice if you want to show off, with a slightly more difficult challenge.

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

Credits

This exercise has been extracted from the LeetCode website. Don't hesitate, join and practice in this great community.

About

The Mirror of Galadriel - Episode #007

License:MIT License


Languages

Language:Java 100.0%