addDaysToDate('2021-10-2', 10) (residing in +5:30 timezone) gives output '2021-10-11'.
timezone offset should be considered since the ISO time string converts to UTC time, which may cause issues.
Merges two or more arrays and removes any duplicate values i.e. [1,2,3] & [2,3,4] & [4,5,6] = [1,2,3,4,5,6]
Can use Map or Set for implementing the solution in O(N) time complexity
Why use Set here when we can use includes
The solution that is provided is
const difference = (a, b) => { const s = new Set(b); return a.filter(x => !s.has(x)); }; difference([1, 2, 3], [1, 2, 4]); // [3]
But I think there is a better solution available though the time complexity will be exact...
Hi there,
I couldn't find a SECURITY.md in your repository and am not sure how to best contact you privately to disclose a security issue.
Can you add a SECURITY.md file with an e-mail to your repository, so that our system can send you the vulnerability details? GitHub suggests that a security poli...
In case a doubled digit equals to 0, the sum is miscalculated and the result is wrong.
For example, the following valid number returns false instead of true:
luhnCheck('4024007174941954');
Or a shorter version:
luhnCheck('406'); // false, but should be true
A possible solution would be to replace th...