Search
⌘K

Leetcode 3267. Count Almost Equal Pairs II

Count pairs (i<j) of integers that can be made equal using at most two swaps of digits (each swap picks one number and swaps two digits within it), with leading zeros allowed. The core challenge is to determine when two digit-strings are within two internal-swap operations of each other and count such pairs efficiently for up to 5000 numbers.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.