Skip to content

Commit 24e7e83

Browse files
committed
Add week 2 solutions: encode-and-decode-strings
1 parent 71307c3 commit 24e7e83

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* https://www.lintcode.com/problem/659/
3+
* time complexity : O(n)
4+
* space complexity : O(n)
5+
* ! emoji는 입력에서 제외한다.
6+
*/
7+
8+
function encode(input: Array<string>): string {
9+
return input.join("😀");
10+
}
11+
12+
function decode(input: string): Array<string> {
13+
return input.split("😀");
14+
}

0 commit comments

Comments
 (0)