Search⌘ K
AI Features

Largest Number After Digit Swaps by Parity

Largest Number After Digit Swaps by Parity gives you a positive integer. Swap digits only when both are odd or both are even, then return the greatest value possible.

Statement

You are given a positive integer num. You can swap any two digits of num ...