Exemple #1
0
        public void IsPalindrome()
        {
            var sut    = new Solutions.Solution();
            var result = sut.IsPalindrome(1551);

            Assert.True(result);
        }
Exemple #2
0
        public void FindRepeatNumber()
        {
            var sut    = new Solutions.Solution();
            var result = sut.FindRepeatNumber(new int[] { 2, 3, 1, 0, 2, 5, 3 });

            Assert.Equal(2, result);
        }
Exemple #3
0
        public void ReverseWords557()
        {
            var sut    = new Solutions.Solution();
            var result = sut.ReverseWords557("the sky is blue");

            Assert.Equal("eht yks si eulb", result);
        }
Exemple #4
0
        public void CountOdds()
        {
            var sut    = new Solutions.Solution();
            var result = sut.CountOdds(8, 10);

            Assert.Equal(1, result);
        }
Exemple #5
0
        public void HammingWeight()
        {
            var sut    = new Solutions.Solution();
            var result = sut.HammingWeight(0b0000001111);

            Assert.Equal(4, result);
        }
Exemple #6
0
        public void TwoSum()
        {
            var sut    = new Solutions.Solution();
            var result = sut.TwoSum(new int[] { 2, 7, 3, 8 }, 9);

            Assert.Equal(new int[] { 0, 1 }, result);
        }
Exemple #7
0
        public void ReverseWords()
        {
            var sut    = new Solutions.Solution();
            var result = sut.ReverseWords("the sky is blue");

            Assert.Equal("blue is sky the", result);
        }
Exemple #8
0
        public void BusyStudent()
        {
            var sut    = new Solutions.Solution();
            var result = sut.BusyStudent(new int[] { 1, 2, 3 }, new int[] { 3, 2, 7 }, 4);

            Assert.Equal(1, result);
        }
Exemple #9
0
        public void ArrangeCoins()
        {
            var sut    = new Solutions.Solution();
            var result = sut.ArrangeCoins(21);

            Assert.Equal(6, result);
        }
Exemple #10
0
        public void RunningSum()
        {
            var sut    = new Solutions.Solution();
            var result = sut.RunningSum(new int[] { 3, 1, 2, 10, 1 });

            Assert.Equal(new int[] { 3, 4, 6, 16, 17 }, result);
        }
Exemple #11
0
        public void CheckRecord()
        {
            var sut    = new Solutions.Solution();
            var result = sut.CheckRecord("PPALALLLP");

            Assert.Equal(false, result);
        }
Exemple #12
0
        public void IsPalindrome()
        {
            var sut = new Solutions.Solution();

            var result = sut.
        }
 private int Reverse(int x)
 {
     Solutions.Solution sol = new Solutions.Solution();
     return(sol.Reverse(x));
 }
Exemple #14
0
 private string Convert(string s, int numRows)
 {
     Solutions.Solution sol = new Solutions.Solution();
     return(sol.Convert(s, numRows));
 }
 private int MyAtoi(string str)
 {
     Solutions.Solution sol = new Solutions.Solution();
     return(sol.MyAtoi(str));
 }
 private double FindMedianSortedArrays(int[] nums1, int[] nums2)
 {
     Solutions.Solution sol = new Solutions.Solution();
     return(sol.FindMedianSortedArrays(nums1, nums2));
 }
Exemple #17
0
 private string LongestPalindrome(string s)
 {
     Solutions.Solution sol = new Solutions.Solution();
     return(sol.LongestPalindrome(s));
 }