Practice Concatenated Divisibility
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given an array of positive integers nums and a positive integer k. A permutation of nums is said to form a divisible concatenation if, when you concatenate the decimal representations of the numbers in the order specified by the permutation, the resulting number is divisible by k. Return the lexicographically smallest permutation (when considered as a list of integers) that forms a divisible concatenation. If no such permutation exists, return an empty list.
Source: Concatenated Divisibility on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
nums = [3,12,45], k = 5
[3,12,45]
# Example 2
nums = [10,5], k = 10
[5,10]
# Example 3
nums = [1,2,3], k = 5
[]
Constraints
Related LeetCode Problems
Practice more problems similar to Concatenated Divisibility.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.