Contains Duplicate

LeetCode題目: 217. Contains Duplicate My solution: /** * @param {number[]} nums * @return {boolean} */ let containsDuplicate = nums => { let map = ...

Binary Number with Alternating Bits

LeetCode題目: 693. Binary Number with Alternating Bits My solution: /** * @param {number} n * @return {boolean} */ let hasAlternatingBits = n => { ...

Baseball Game

LeetCode題目: 682. Baseball Game My solution: /** * @param {string[]} operations * @return {number} */ let calPoints = operations => { let stack = ...

Robot Return to Origin

LeetCode題目: 657. Robot Return to Origin My solution: /** * @param {string} moves * @return {boolean} */ let judgeCircle = moves => { let originPo...

Find the Difference

LeetCode題目: 389. Find the Difference My solution: /** * @param {string} s * @param {string} t * @return {character} */ let findTheDifference = (s, t) =...