โ† Bank of America questions
CodingBeginner

Lexicographically smallest permutation and direction distance

Filed under Bank of America

The question

Given a number n, find its lexicographically smallest permutation. Also, given a sequence of directions ('E', 'W', 'N', 'S') starting from point O, find the minimum distance between the origin and the finish point.

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

Related Bank of America questions

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