Solution using extra space with JS
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```javascript []
/**
 * @param {string} s
 * @return {boolean}
 */
var hasSameDigits = function(s) {
    let digits = s.split("").map(Number);
    let temp = [];
    while(digits.length>2){
        for(let i=0;i<digits.length-1;i++){
            const mod = (digits[i] + digits[i+1])%10;
            temp.push(mod);
        }
        digits = temp;
        temp = [];
    }
 return digits[0] ==digits[1];
};
```
['JavaScript']