public void ShortestToCharTests()
        {
            ShortestDistanceToACharacter obj = new ShortestDistanceToACharacter();

            var x = obj.ShortestToChar("loveleetcode", 'e');

            x = obj.ShortestToChar("aaba", 'b');
        }
Esempio n. 2
0
        public void GetShortestToChar1(string s, char c, int[] expected)
        {
            var shortestDistanceToACharacter = new ShortestDistanceToACharacter();
            var actual = shortestDistanceToACharacter.ShortestToChar(s, c);

            Assert.That(actual, Is.EqualTo(expected));
        }
        public void ShortestToChar(string input, char character, int[] expected)
        {
            var sut    = new ShortestDistanceToACharacter();
            var actual = sut.ShortestToChar(input, character);

            Assert.AreEqual(expected, actual);
        }