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 |
Tags
- codewar
- react
- descendingOrder
- codewars
- java api
- useEffect
- manifest.json
- JDBC
- react hook
- isSquare
- DB2
- TypeScript
- type
- TABLESPACE
- Debug
- custom hook
- IBM
Archives
- Today
- Total
taesik
Sum of numbers from 0 to N 본문
class SequenceSum {
static showSequence(n) {
return n < 0
? `${n}<0`
: `${Array.from({length: n+1}, (v, k) => k).join('+')}${n?' = ':'='}${n*(n+1)/2}`;
}
}
'functions and trick > typescript_javascript' 카테고리의 다른 글
| isValidIP (0) | 2022.01.26 |
|---|---|
| makes this string uppercasegives it sorted in alphabetical order by last name. (0) | 2022.01.25 |
| how many times father see kid's falling and bouncing ball (0) | 2022.01.25 |
| Write Number in Expanded Form (0) | 2022.01.25 |
| alpabet war (0) | 2022.01.25 |