-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path1.js
More file actions
27 lines (24 loc) · 814 Bytes
/
1.js
File metadata and controls
27 lines (24 loc) · 814 Bytes
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
/**
* @param {string} s1 the first line of the page, composed of uppercase letters only
* @param {string} s2 the second line, composed of uppercase letters and of the same length as s1
* @return {string} the decrypted message, created by alternating the letters of s1 and s2
*/
function decrypt(s1, s2) {
// Write your code here
let str = ''
for (let i = 0; i < s1.length; i++) {
str += s1.charAt(i)
str += s2.charAt(i)
}
return str
}
/* Ignore and do not change the code below */
/**
* Try a solution
* @param message the decrypted message, created by alternating the letters of s1 and s2
*/
function trySolution(message) {
console.log('' + JSON.stringify(message))
}
trySolution(decrypt(JSON.parse(readline()), JSON.parse(readline())))
/* Ignore and do not change the code above */