Numbers should be between 1 to 1000. It mean we shoud have to pay attention on arrangement of three digits as 1 itself is 001 and maximum number is 999.
lets we start our journey by thinking about single 8 so the cases may be
1. 8?? 2. ?8? 3. ??8 it mean for other two places we have (0,1,2,3,4,5,6,7,9) nine digits to arrange so total arrangments are ( 1 * 9 * 9) repeatitions are allowed. so total arrangements = 3 * ( 1*9*9) = 243 numbers
same way for repating 8 two times we have options 88? ?88 8?8 which yield the arrangemnts = 3 * (1*1*9) = 27 numbers
for three 888 we have only one number. Total numbers are 243+27+1=271
so right answer should be 271