problem0242

package
v0.0.0-...-db5e768 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2019 License: MIT Imports: 0 Imported by: 0

README

242. Valid Anagram

题目

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

For example,

s = "anagram", t = "nagaram", return true.
s = "rat", t = "car", return false.

Note: You may assume the string contains only lowercase alphabets.

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

解题思路

易位构词游戏的英文词汇是 anagram,这个词来源于有“反向”或“再次”的含义的希腊语字根ana-和有“书写”、“写下”的意思的词根grahpein。易位构词是一类文字游戏(更准确地说是一类“词语游戏”),是将组成一个词或短句的字母重新排列顺序,原文中所有字母的每次出现都被使用一次,这样构造出另外一些新的词或短句。

见程序注释

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL