🔥 Simple Javascript Solution
Approach\n- creating an array of 10 lengths for recording\n- reverse loop to ensure that the number is at the top of stack for easy access\n- iterate the target
# Approach\n- creating an array of 10 lengths for recording\n- reverse loop to ensure that the number is at the top of stack for easy access\n- iterate the target string, if the corresponding stack is empty and the number cant be found, return `false`\n- then thinking about the question, the numbers on the right side need to be lifted to the left by sorting them in ascending order. it meens, if there is a smaller number on the left side, the number can not be extracted from the right to satisfy the question\n- so, using the current number as the boundary, iterate through the numbers smaller than it, and if the number at the top of the stack is further ahead than the current number, the question is not satisfied, then return `false`\n\n# Code\n```\n/**\n * @param {string} s\n * @param {string} t\n * @return {boolean}\n */\nfunction isTransformable (s, t, n = s.length) {\n    const indices = Array.from({ length: 10 }, () => [])\n\n    for (let i = n - 1; i >= 0; i--) {\n        indices[s[i] | 0].push(i)\n    }\n\n    for (let i = 0; i < n; i++) {\n        const num = t[i] | 0\n\n        if (!indices[num].length) {\n            return false\n        }\n\n        const index = indices[num].pop()\n\n        for (let i = 0; i < num; i++) {\n            if (indices[i].length && indices[i][indices[i].length-1] < index) return false\n        }\n    }\n\n    return true\n}\n```
['JavaScript']