using System; namespace Solution { public class BlockBuilder { public static int[][] BuildATower(int[] bag) { return new int[][] {new int[] {1}}; // Code goes here ... } } }
- using System;
- namespace Solution
- {
- public class BlockBuilder
- {
public static int[,] BuildATower(int[] bag)- public static int[][] BuildATower(int[] bag)
- {
return new int[,] { { 1 } }; // Code goes here ...- return new int[][] {new int[] {1}}; // Code goes here ...
- }
- }
- }
using System; using NUnit.Framework; namespace Solution { [TestFixture] public class SolutionTest { [Test] public void ExampleTest() { Assert.AreEqual(new int[][] {new int[] {1}}, BlockBuilder.BuildATower(new int[] {1})); Assert.AreEqual(new int[][] {new int[] {1}}, BlockBuilder.BuildATower(new int[] {1, 1})); Assert.AreEqual(new int[][] {new int[] {1}, new int[] {1, 1}}, BlockBuilder.BuildATower(new int[] {1, 1, 1})); Assert.AreEqual(new int[][] {new int[] {1}, new int[] {2}, new int[] {3}}, BlockBuilder.BuildATower(new int[] {1, 2, 3})); } } }
- using System;
- using NUnit.Framework;
- namespace Solution
- {
- [TestFixture]
- public class SolutionTest
- {
- [Test]
- public void ExampleTest()
- {
int[,] expectedArray = { { 1 } };int[,] actualResult = BlockBuilder.BuildATower(new int[] { 1 });Assert.AreEqual(expectedArray, actualResult);- Assert.AreEqual(new int[][] {new int[] {1}}, BlockBuilder.BuildATower(new int[] {1}));
- Assert.AreEqual(new int[][] {new int[] {1}}, BlockBuilder.BuildATower(new int[] {1, 1}));
- Assert.AreEqual(new int[][] {new int[] {1}, new int[] {1, 1}}, BlockBuilder.BuildATower(new int[] {1, 1, 1}));
- Assert.AreEqual(new int[][] {new int[] {1}, new int[] {2}, new int[] {3}}, BlockBuilder.BuildATower(new int[] {1, 2, 3}));
- }
- }
- }