Ad

'1' and '2' are technically of the same case + it seems more intuitive TBH

Code
Diff
  • using System;
    
    public static class Kata
    {
        public static int SameCase(char a, char b)
        {
            if (!char.IsLetter(a) && !char.IsLetter(b))
                  return 1;  
            if (!char.IsLetter(a) || !char.IsLetter(b))
                  return -1;
    
            return (char.IsUpper(a) == char.IsUpper(b)) ? 1 : 0;
        }
    }
    • using System;
    • public static class Kata
    • {
    • public static int SameCase(char a, char b)
    • {
    • if (!char.IsLetter(a) && !char.IsLetter(b))
    • return 1;
    • if (!char.IsLetter(a) || !char.IsLetter(b))
    • return -1;
    • return -1;
    • return (char.IsUpper(a) == char.IsUpper(b)) ? 1 : 0;
    • }
    • }