you give 0indexed string num length n consist digitsreturn true index range 0 n digit occur numi time num return false Example 1input num 1210output trueexplanationnum0 1 the digit 0 occur numnum1 2 the digit 1 occur twice numnum2 1 the digit 2 occur numnum3 0 the digit 3 occur zero time numthe condition hold true index 1210 return trueexample 2input num 030output falseExplanationnum0 0 the digit 0 occur zero time actually occur twice numnum1 3 the digit 1 occur time actually occur zero time numnum2 0 the digit 2 occur zero time numthe index 0 1 violate condition return false Constraintsn numlength1 n 10num consist digit