โ† Publicis Sapient questions
CodingHard

K-Smallest Permutations and Average Grouping

Filed under Publicis Sapient

The question

Given an integer, find all possible permutations of its digits. Identify the first k smallest permutations and calculate their average. Divide these k integers into two groups based on whether they are larger or smaller than the average, then return the largest value from the smaller group and the smallest value from the larger group.

No write-up yet. Related questions below have one.

Related Publicis Sapient questions

Collected from public candidate posts and coding forums. Updated Nov 2026.