Skip to content

Commit 8b957b5

Browse files
authored
[ PS ] : Encode and Decode Strings
1 parent 04a1960 commit 8b957b5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const encode = function (strs) {
2+
const separator = '\\';
3+
return strs.join(separator);
4+
}
5+
6+
7+
const decode = function (str) {
8+
const separator = '\\';
9+
return str.split(separator);
10+
}
11+
12+
// ๋ฌธ์ œ๊ฐ€ ๋„ˆ๋ฌด ๋ณ„๋กœ๋‹ค
13+
// ๋ฌธ์ œ์—์„œ ์ œ์‹œํ•˜๊ณ  ์žˆ๋Š” ํ•ด๋‹ต๋„ ๋ณ„๋กœ๋‹ค
14+
// ์ด๋ชจ์ง€๊ฐ™์€ ๊ฑธ ๊ตฌ๋ถ„์ž๋กœ ์“ฐ๊ฑฐ๋‚˜, length๋ฅผ ์•ž์— ๋„ฃ์–ด์„œ ๊ตฌ๋ณ„ํ•˜๊ฑฐ๋‚˜ ํ•ด๋„ ์‚ฌ์‹ค ์ œ๋Œ€๋กœ ์•”ํ˜ธํ™”ํ–ˆ๋‹ค๊ณ  ๋งํ•  ์ˆ˜ ์—†์Œ
15+
// ๊ทธ๋Ÿฐ ๊ฑธ ์ •๋‹ต์œผ๋กœ ์ œ๊ณตํ•  ๊ฑฐ๋ฉด ์ด๋Ÿฐ ๋ฌธ์ œ๋ฅผ ์™œ ๋‚ด๋Š” ๊ฑฐ์—ฌ
16+
// ์ด ๋ฌธ์ œ๊ฐ€ Blind 75์— ์†ํ•ด ์žˆ๋Š” ์ด์œ ๊ฐ€ ๋ญ˜๊นŒ...?!

0 commit comments

Comments
ย (0)