文章 评论 浏览 29
@kingstone3 yes
` function colorSort(str) {
if(!str) return null; const match = { 黄:0, 红:1, 蓝:2 }; const arr = str.split(''); arr.sort((a,b) => match[a]-match[b]); console.log(arr.join(''));
}`
文章 0 评论 0
接受
@kingstone3 yes
第 77 题:旋转数组算法题