Skip to content

Practice Maximum Possible Number by Binary Concatenation

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#3309
LeetCode Problem

Maximum Possible Number by Binary Concatenation

Problem Statement

You are given an array of integers nums of size 3. Return the maximum possible number whose binary representation can be formed by concatenating the binary representation of all elements in nums in some order. Note that the binary representation of any number does not contain leading zeros.

Source: Maximum Possible Number by Binary Concatenation on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
nums = [1,2,3]
Output
30

# Example 2

Input
nums = [2,8,16]
Output
1296

Constraints

nums.length == 3
1 <= nums[i] <= 127

Related LeetCode Problems

Practice more problems similar to Maximum Possible Number by Binary Concatenation.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.