Comments (1)
/**
* @param {string[]} strs
* @return {string[][]}
*/
var groupAnagrams = function(strs) {
const hashkey = str =>{
return str.split('').sort().join('')
}
const map = new Map()
for(let item of strs){
const key = hashkey(item)
if(map.get(key)){
map.get(key).push(item)
}else{
map.set(key,[item])
}
}
return Array.from(map.values())
};
from arithmeticquestions.
Related Issues (20)
- 括号生成
- 两数相除 HOT 1
- Pow(x, n) HOT 1
- Z 字形变换 HOT 2
- 整数转罗马数字 HOT 1
- 考试(入门) HOT 5
- 无重复字符的连续子串的个数 HOT 1
- 几个常用的正则表达式
- sort()
- 最近时刻
- 怎样找最小公倍数和最大公约数 HOT 2
- 字符串大小写字母转换
- 树的操作 HOT 4
- 链表的增删改查
- 经典数学题
- 数列
- 字符串操作 HOT 1
- 排名 HOT 1
- 左程云算法入门 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arithmeticquestions.