Valid PAN format

  • + 0 comments

    Javascript:

    const lines = input.split("\n");
    lines.shift();
    
    lines.forEach((line) => {
       if (!line) {
          return;
       }
    
       const status = line.match(/^[A-Z]{5}\d{4}[A-Z]$/) ? 'YES' : 'NO';
       console.log(status);
    })