From b22c99de54528e9bdccd79c60d1c8ce8f1898ce8 Mon Sep 17 00:00:00 2001 From: chayan das <110921638+Chayandas07@users.noreply.github.com> Date: Sun, 1 Sep 2024 19:25:01 +0530 Subject: [PATCH] Create 2022. Convert 1D Array Into 2D Array --- 2022. Convert 1D Array Into 2D Array | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 2022. Convert 1D Array Into 2D Array diff --git a/2022. Convert 1D Array Into 2D Array b/2022. Convert 1D Array Into 2D Array new file mode 100644 index 0000000..924ec1a --- /dev/null +++ b/2022. Convert 1D Array Into 2D Array @@ -0,0 +1,18 @@ +class Solution { +public: + vector> construct2DArray(vector& original, int m, int n) { + vector>ans(m, vector(n)); + int x=0; + if(m*n!=original.size()){ + + return {}; + } + for(int i=0; i