leetcode 2366 [Daily Challenge]. Minimum Replacements to Sort the Array - optimization correct sol

Published --