All practice tasks

Coding (Algo)

Combine a Batch of Status Masks

Bit manipulation · Easy

A compact diagnostic checksum combines a batch of 32-bit status masks using XOR. The input already contains the final masks: no filtering or reinterpretation of signed inputs is required. Equal masks at different positions must still participate.

Combine every input mask with XOR and return the result as one unsigned 32-bit integer.

Input

Call

  • Implement solve(input) and return the result. The provided adapter handles JSON input and output.

Input shape

{ nums: unsigned32[] }

Fields

  • nums contains unsigned 32-bit integers from 0 through 4294967295. Values with bit 31 set are positive JSON integers.

Output

Return value

  • Return one unsigned integer, not a binary string. Every occurrence is included.
  • An empty batch returns zero. Repeated equal masks cancel in pairs.

Constraints

  • 0 <= nums.length <= 100000.

Examples

Example 1

{
  "nums": [
    5,
    3,
    5
  ]
}

Returns

3

Example 2

{
  "nums": [
    2147483648
  ]
}

Returns

2147483648

Required complexity

O(n) time and O(1) auxiliary space

What this task practices

Combine a Batch of Status Masks is a coding (algo) interview exercise that trains prompt interpretation, explicit assumptions, a concrete response, and a clear explanation of tradeoffs. The catalog marks it as easy difficulty. It focuses on Technical Reasoning, Testing, Validation. The signed-in workspace provides the tools for the round and evaluates the attempt against task-specific criteria. Reference solutions, hidden checks, evaluator instructions, and candidate work remain private.

Sign in to startThe workspace and evaluation open after sign in.