首页
话题
动态
专家
文章
作者
公告
更多
积分规则
登录 或 注册
首页
话题
动态
专家
文章
作者
公告
积分规则
发表新帖
发表新帖
Checking if two strings are permutations of each other
前端
未结
关注
30
1051
感情败类
2020-12-05 08:19
How to determine if two strings are permutations of each other
30条回答
鱼传尺愫
(楼主)
2020-12-05 08:52
Sort the 2 strings by characters and compare if they're the same (O(n log n) time, O(n) space),
or
Tally the character frequency of the 2 strings and compare if they're the same (O(n) time, O(n) space).
0
讨论(0)
查看其它30个回答
发布评论:
提交评论
加载中...
验证码
看不清?
提交回复
热议问题