Missing First

Same as Missing Last but first character is removed

Print “not missing” if the first letter is not missing.

Print “missing” if it is.

Judge

(async function*(context: Context): Challenge {
  yield (await context.run()).assertEquals('not missing');
  yield (await context.runCode(context.code.slice(1))).assertEquals('missing');
  // only run the luck tests if you pass
  if(context.testCases.every((i) => i.pass !== 'Fail')) {
    for(let i = 0; i < 23; i++) {
      if (Math.random() > 0.5) {
        yield (await context.run()).assertEquals('not missing');
      }
      else {
        yield (await context.runCode(context.code.slice(1))).assertEquals('missing');
      }
    }
  }
  return context.noFailures();
  
})

Example Code

aa=1;
try {
 aa;
 console.log('not missing');
} catch {
 console.log('missing');
}

Comments