Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- IBM
- Debug
- java api
- descendingOrder
- TABLESPACE
- react
- useEffect
- codewar
- JDBC
- manifest.json
- codewars
- type
- custom hook
- TypeScript
- react hook
- DB2
- isSquare
Archives
- Today
- Total
taesik
Backspaces in string 본문
Assume "#" is like a backspace in string. This means that string "a#bc#d" actually is "bd"
Your task is to process a string with "#" symbols.
export function cleanString(s: string) {
return Array.from(s).reduce((a, b) => b == '#'? a.slice(0,-1) : a.concat(b), '')
}
'functions and trick > typescript_javascript' 카테고리의 다른 글
retrun true if every value in the array has its corresponding value squared in the secone array. (0) | 2022.04.29 |
---|---|
Counting Duplicates (0) | 2022.01.29 |
Consecutive strings (0) | 2022.01.29 |
digitRoot (0) | 2022.01.29 |
Coordinates Validator (0) | 2022.01.28 |