LeetCode題目: 151. Reverse Words in a String My solution: /** * @param {string} s * @return {string} */ let reverseWords = s => s.replace(/\s+/g,'...
LeetCode題目: 345. Reverse Vowels of a String My solution: /** * @param {string} s * @return {string} */ let reverseVowels = s => { if(s.length <...
LeetCode題目: 605. Can Place Flowers My solution: /** * @param {number[]} flowerbed * @param {number} n * @return {boolean} */ let canPlaceFlowers = (flo...
LeetCode題目: 1431. Kids With the Greatest Number of Candies My solution: /** * @param {number[]} candies * @param {number} extraCandies * @return {boolea...
LeetCode題目: 1768. Merge Strings Alternately My solution: /** * @param {string} word1 * @param {string} word2 * @return {string} */ let mergeAlternately...