var singleNumber = function(nums) {
var ans = 0;
for (var i = 0; i < nums.length; i++) {
ans = ans ^ nums[i];
}
return ans;
};
example1:
Input: nums = [4,1,2,1,2]
Output: 4
var singleNumber = function(nums) {
var ans = 0;
for (var i = 0; i < nums.length; i++) {
ans = ans ^ nums[i];
}
return ans;
};
example1:
Input: nums = [4,1,2,1,2]
Output: 4
var containsDuplicate = function(nums) {
const arr=[]
for(let i=0;i<nums.length;i++) {
if(arr[nums[i]]) {
return true
}else {
arr[nums[i]]= true
}
}
return false
};
Example 1:
Input: nums = [1,2,3,1]
Output: true
Example 2:
Input: nums = [1,2,3,4]
Output: false
https://bobbyhadz.com/blog/javascript-compare-two-time-strings
const time1 = '07:30:24';
const time2 = '10:45:33';
if (time1 > time2) {
console.log('time1 is greater than time2');
} else if (time2 > time1) {
// ✅ this runs
console.log('time2 is greater than time1');
} else {
console.log('time1 is equal to time2');
}
https://stackoverflow.com/questions/30627250/why-is-my-css3-transition-delaying-before-it-starts
可試試這個文章 https://css-tricks.com/using-css-transitions-auto-dimensions/ 看能不能解