Clear
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var res = new Solution().MatrixReshape(new int[][] { new int[] { 1,2 }, new int[] { 4, 5 } }, 2, 4);
|
||||
foreach(var row in res)
|
||||
var res = new Solution().MatrixReshape(new int[][] { new int[] { 1, 2 }, new int[] { 4, 5 } }, 2, 4);
|
||||
foreach (var row in res)
|
||||
Console.WriteLine(String.Join(" ", row));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public class Solution
|
||||
int size = r * c;
|
||||
if (size != height * width)
|
||||
return mat;
|
||||
for(int i = 0; i < size; i++)
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
int ySource = i / width;
|
||||
int xSource = i % width;
|
||||
|
||||
Reference in New Issue
Block a user