C# one liner


  • 0
    D
    public class Solution {
        public int HammingDistance(int x, int y) {
            return Convert.ToString(x ^ y, 2).Count(c => c == '1');
        }
    }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.