for '4' digit number, less than 5000
At thousandth place we can use only 2,3,4 so we have only 3 way to fill thousandth place
While hundredth place can be filled by remaining 4 digit, then tenth place by remaining 3 digit and then unit place by remaining 2 digits.
So, Total four digit numbers = 3 × 4 × 3 × 2 = 72
Fr '3' digit number
Hundredth place can be filled by 5 digits, then tenth place by remaining 4 digit and then unit place by remaining 3 digits
So, Total Three digit Numbers = 5 × 4 × 3 = 60
For '2' digit number
Tenth place can be filled by 5 digits, then unit place by remaining 4 digits
So Total Two digit Number = 5 × 4 = 20
For 1 digit number
Total 5 digit available to fill the place
So Total 1 digit number = 5
Total numbers = 72 + 60 + 20 + 5 = 157