-
-
Notifications
You must be signed in to change notification settings - Fork 248
[Lustellz] WEEK 02 problems #1756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
318db20
59c0d5d
797becf
3b737e1
56c3d9b
a4d9cca
e065a0d
92a3fc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// week2 goal | ||
// not knowing how to express, I googled and referenced a bit | ||
function climbStairs(n: number): number { | ||
let stairArray: number[] = [1,2] | ||
for(let i = 2;i<n; i++){ | ||
stairArray.push(stairArray[i-1]+stairArray[i-2]) | ||
} | ||
return stairArray[n-1] | ||
}; |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @SamTheKorean 이 파일처럼 비었지만 Merge 된 경우가 더 있네요: #1733 (review) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// frequency is k times |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,14 @@ | ||||||||
// week 2's goal | ||||||||
// only focusing on not using for... not a good approach :( | ||||||||
|
||||||||
function isAnagram(s: string, t: string): boolean { | ||||||||
if(s.length !== t.length) return false | ||||||||
let sArray : string[] = s.split('').sort() | ||||||||
s = sArray.join('') | ||||||||
let tArray : string[] = t.split('').sort() | ||||||||
t = tArray.join('') | ||||||||
if(s === t) return true | ||||||||
else return false | ||||||||
Comment on lines
+10
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이렇게 줄여볼 수도 있겠어요:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오! 그렇게 축약하는 건 생각 못했어요. |
||||||||
}; | ||||||||
|
||||||||
// reflection: not to be hurry & have more time for pondering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
로 변경하는 것과 타입 명시를 생략하고 추론하는 것 둘다 가능해 보이는데 어떻게 생각하세요?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그러네요! 좋은 의견 감사합니다.