Mastercard interview question

Leetcode question regarding organizing roman numerals.