nodejs template

Revision en1, by turz0ahsan, 2021-12-21 08:43:31
/*
** 271a - Beautiful Year
*/

// Common Template Starts //
//*
process.stdin.resume();
process.stdin.setEncoding("utf-8");

let inputString = "";
let currentLine = 0;

process.stdin.on("data", (inputStdin) => {
    inputString += inputStdin;
});

process.stdin.on("end", (_) => {
    inputString = inputString
        .trim()
        .split("\n")
        .map((string) => {
            return string.trim();
        });

    main();
});

function readline() {
    return inputString[currentLine++];
}
// Common Template Ends //


// LIBRARY START //

const isOdd = (x) => { return x & 1 }
const isEven = (x) => { return !(x & 1) }

const reverseText = (s) => { return s.split('').reverse().join('') }
const hasDuplicates = (str) => (/([a-z])\1/i).test(str)

const hasDuplicateChar = (str, char) => str.indexOf(char) !== str.lastIndexOf(char)

const isSorted = arr => arr.every((v, i, a) => !i || a[i - 1] <= v);

const findAllIndicesOfChar = (str, char) => {
    str = str.split('')
    let indices = [];
    for (let i = 0; i < str.length; i++) {
        if (str[i] === char) indices.push(i);
    }
    return indices
}

const splitAt = index => x => [x.slice(0, index), x.slice(index)]

const isUpper = str => !/[a-z]/.test(str) && /[A-Z]/.test(str)

const escapeRegExp = (string) => string.replace(/[.*+\-?^$$${}()|[\]\\]/g, '\\$$$&')

const replaceAll = (str, find, replace) => str.replace(new RegExp(escapeRegExp(find), 'g'), replace)

const findUnique = (str) => {
    return [...str].reduce((acc, curr) => {
        return acc.includes(curr) ? acc : acc + curr;
    }, "")
}


const unique = (str) => {
    const cleanStr = str.replace(/ /gi, '');
    const set = [...new Set(cleanStr)];
    return set;
}

// LIBRARY END


function main() {
    let input = readline()
    let inputs = readline().split(' ').map(Number)
    
    let result = 0
    console.log( result  )
}
//*/

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English turz0ahsan 2022-09-11 15:00:51 51
en2 English turz0ahsan 2021-12-22 08:25:00 312
en1 English turz0ahsan 2021-12-21 08:43:31 2002 Initial revision (published)