Beats 99.84% Easy JS Solution with comments to understand
Approach\n Describe your approach to solving the problem. \nFirst I\'ve mapped the array and I\'m separating the digits in an array which will return an array o
# Approach\n<!-- Describe your approach to solving the problem. -->\nFirst I\'ve mapped the array and I\'m separating the digits in an array which will return an array of separated digits array.\nAnd then we\'ll flatten the array using concat method and return the result.\n\n# Code\n```\n/**\n * @param {number[]} nums\n * @return {number[]}\n */\nvar separateDigits = function(nums) {\n// Here we will map through numbers to get separate digits in array\n  const arr = nums.map((el) => {\n  let arr = [];\n  while(el!==0) {\n    arr.push(el%10);\n    el = Math.trunc(el/10)\n  }\n  return arr.reverse()\n  });\n// here we will flatten the array which consist of array of\n// seperated digits\n  return [].concat(...arr)\n};\n```
['JavaScript']