-
Notifications
You must be signed in to change notification settings - Fork 0
/
q3.js
37 lines (28 loc) · 793 Bytes
/
q3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* Write a code to get the input in the given format and print the output in the given format.
Input Description:
First-line indicates two integers which are the size of array and 'K' value. Second-line indicates an integer contains elements of an array.
Output Description:
Print the taken input in the same format.
Sample Input :
5 3
1 2 3 4 5
Sample Output :
5 3
1 2 3 4 5 */
//solution
// Getting input via STDIN
const readline = require("readline");
const inp = readline.createInterface({
input: process.stdin
});
const userInput = [];
inp.on("line", (data) => {
userInput.push(data);
});
inp.on("close", () => {
//start-here
//Your code goes here … replace the below line with your code logic
console.log(userInput[0]);
console.log(userInput[1]);
//end-here
});