Skip to content

Commit 72d7b75

Browse files
committed
85
1 parent 21a5413 commit 72d7b75

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

Day85/index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* @param {string} s
3+
* @return {boolean}
4+
*/
5+
var canPermutePalindrome = function (s) {
6+
7+
8+
let map = {};
9+
10+
for (let i = 0; i < s.length; i++) {
11+
let key = s[i];
12+
13+
if (!(key in map)) {
14+
map[key] = 1
15+
} else {
16+
delete map[key]
17+
}
18+
}
19+
20+
let hasPalindrome = Object.keys(map).length > 1 ? false : true
21+
return hasPalindrome
22+
23+
};

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,6 @@ If you are loving solving problems in leetcode, please contact me to enjoy it to
188188

189189
|Day 83| [84. Largest Rectangle in Histogram](https://leetcode.com/problems/largest-rectangle-in-histogram/) | [javascript]()|[:memo:](https://leetcode.com/problems/largest-rectangle-in-histogram/)|Medium|
190190

191-
|Day 84| [1640. Check Array Formation Through Concatenation](https://leetcode.com/problems/check-array-formation-through-concatenation/) | [javascript]()|[:memo:](https://leetcode.com/problems/check-array-formation-through-concatenation/)|Easy|
191+
|Day 84| [1640. Check Array Formation Through Concatenation](https://leetcode.com/problems/check-array-formation-through-concatenation/) | [javascript]()|[:memo:](https://leetcode.com/problems/check-array-formation-through-concatenation/)|Easy|
192+
193+
|Day 85| [1640. Check Array Formation Through Concatenation](https://leetcode.com/problems/palindrome-permutation/) | [javascript]()|[:memo:](https://leetcode.com/problems/palindrome-permutation/)|Easy|

0 commit comments

Comments
 (0)