This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function nth_most_rate_signature(list, n) | |
{ | |
list.sort(); | |
let min_count = n+1, res = -1; | |
let curr_count = 1; | |
for (let i = 1; i < n; i++) | |
{ | |
if (list[i] == list[i - 1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict" | |
const prompt = require("prompt-sync")({sigint: true}) | |
// This Regular Expression matches for a valid Mastercard number. Mastercard numbers start with a 51-55 and have a total of 16 digits. | |
const RegEx = /^5[1-5]\d{14}$/ | |
// This Function prompts for a Mastercard number and begins validation. | |
const validate = (cardNo) => { |