Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const readline = require('readline');
- const rl = readline.createInterface({
- input: process.stdin
- });
- let lines = [];
- rl.on('line', (line) => {
- lines.push(line);
- }).on('close', () => {
- const [jewels, stones] = lines
- let result = 0;
- for (let i = 0; i < stones.length; i++) {
- if (jewels.includes(stones.charAt(i))) {
- ++result;
- }
- }
- process.stdout.write(result.toString());
- });
Advertisement
Comments
-
- вв
-
- const readline = require('readline');
- const rl = readline.createInterface({
- input: process.stdin
- });
- let lines = [];
- rl.on('line', (line) => {
- lines.push(line);
- }).on('close', () => {
- const [jewels, stones] = lines
- let result = 0;
- for (let i = 0; i < stones.length; i++) {
- if (jewels.includes(stones.charAt(i))) {
- ++result;
- }
- }
- process.stdout.write(result.toString());
- });
-
Comment was deleted
Add Comment
Please, Sign In to add comment
Advertisement