OnepayFrontend Engineer · Online AssessmentCodemia practiceValidate a Card Number and Detect Its Card Network
Write a function that takes a raw card number string, strips spaces and dashes, verifies it with the Luhn checksum, and returns VISA, MASTERCARD, AMEX, DISCOVER, or INVALID based on prefix and length rules.