コード例 #1
0
        static void Main(string[] args)
        {
            var inputArray = new int[] { 3, 0, 0, 2, 0, 4 };

            Console.WriteLine(TrappingRainWater.GetTrappedRainWaterOptimized(inputArray));
            Console.ReadLine();
        }
        public static void ArrayBased_TrappingWaterInBlocks_SpaceOptimized_ValidateTheResult(int[] inputArray, int expectedValue)
        {
            var actualValue = TrappingRainWater.GetTrappedRainWaterOptimized(inputArray);

            Assert.Equal(expectedValue, actualValue);
        }