Advertisement
Guest User

Untitled

a guest
Aug 29th, 2018
32,898
0
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const readline = require('readline');
  2.  
  3. const rl = readline.createInterface({
  4.     input: process.stdin
  5. });
  6.  
  7. let lines = [];
  8. rl.on('line', (line) => {
  9.     lines.push(line);
  10. }).on('close', () => {
  11.     const [jewels, stones] = lines
  12.     let result = 0;
  13.     for (let i = 0; i < stones.length; i++) {
  14.         if (jewels.includes(stones.charAt(i))) {
  15.             ++result;
  16.         }
  17.     }
  18.     process.stdout.write(result.toString());
  19. });
Advertisement
Comments
  • xarukibuu
    280 days
    1. вв
  • xarukibuu
    280 days
    1. const readline = require('readline');
    2.  
    3. const rl = readline.createInterface({
    4.     input: process.stdin
    5. });
    6.  
    7. let lines = [];
    8. rl.on('line', (line) => {
    9.     lines.push(line);
    10. }).on('close', () => {
    11.     const [jewels, stones] = lines
    12.     let result = 0;
    13.     for (let i = 0; i < stones.length; i++) {
    14.         if (jewels.includes(stones.charAt(i))) {
    15.             ++result;
    16.         }
    17.     }
    18.     process.stdout.write(result.toString());
    19. });
  • xarukibuu
    280 days
    Comment was deleted
Add Comment
Please, Sign In to add comment
Advertisement