export default function passwordCheck(p1, p2) {
  const specialChars = [
    "@",
    "#",
    "$",
    "%",
    "!",
    "0",
    "1",
    "2",
    "3",
    "4",
    "5",
    "6",
    "7",
    "8",
    "9",
  ];

  const containsLetter = /[a-zA-Z]/.test(p1);
  const containsDigit = /[0-9]/.test(p1);
  const containsSpecialChar = specialChars.some((char) => p1.includes(char));

  return (
    p1 === p2 &&
    p1.length >= 8 &&
    containsLetter &&
    containsDigit &&
    containsSpecialChar
  );
}
