Tap here to switch tabs
Problem
Submissions

Problem: Maximum Hamming Distances

Try to solve the Maximum Hamming Distances problem.

Statement

Given an integer array nums and an integer m, where each element in nums is represented as an mm bit binary string.

The Hamming distance between two binary representations of length mm is defined as the number of bit positions in which they differ.

Return an array ans of the same length as nums, where ans[i] is the maximum Hamming distance between nums[i] and any element in nums.

Constraints:

  • 1≤1 \leq m ≤17\leq 17

  • 2≤2 \leq nums.length ≤2‘m‘\leq 2^{ {`m`}}

  • 0≤0 \leq nums[i] <2‘m‘< 2^{ {`m`}}

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Hamming Distances

Try to solve the Maximum Hamming Distances problem.

Statement

Given an integer array nums and an integer m, where each element in nums is represented as an mm bit binary string.

The Hamming distance between two binary representations of length mm is defined as the number of bit positions in which they differ.

Return an array ans of the same length as nums, where ans[i] is the maximum Hamming distance between nums[i] and any element in nums.

Constraints:

  • 1≤1 \leq m ≤17\leq 17

  • 2≤2 \leq nums.length ≤2‘m‘\leq 2^{ {`m`}}

  • 0≤0 \leq nums[i] <2‘m‘< 2^{ {`m`}}