Given 2 strings, remove only one digit to make 1 string lexicographically smaller

I am trying to work through a coding problem of string manipulation in Java. The question is that Given two strings S and T consisting of digits and lowercase letters, you are allowed to remove …