Tokopedia interview question

Sorting (Using any sort code) & Counting Number (1234 = 10)