First and Last Digit

CodeChef - FLOW004