[Javascript] Create 2d array by using Array.from
// Initialize a 2D array with zeros
const str1 = "Hello"
const str2 = "World"
const dp = Array.from({ length: str1.length }, () =>
Array.from({ length: str2.length }, () => 0)
);
// Initialize a 2D array with zeros
const str1 = "Hello"
const str2 = "World"
const dp = Array.from({ length: str1.length }, () =>
Array.from({ length: str2.length }, () => 0)
);