-
Notifications
You must be signed in to change notification settings - Fork 4
[JustDevRae] 25.01.16 #26
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
58dae09
remove smallest number / ไปฅ๎๏ฟฝ
JustDevRae d1ddf64
divisible numbers array / ไปฅ๎๏ฟฝ
JustDevRae 8d7fe56
duplicate number count / ๆนฒ๊ณ๏ฟฝ
JustDevRae d7f63b0
matrix addition / ไปฅ๎๏ฟฝ
JustDevRae 36b4d80
array element length / ๆนฒ๊ณ๏ฟฝ
JustDevRae bab0b85
rotate array / ๆนฒ๊ณ๏ฟฝ
JustDevRae c8b3d17
slice array / ๆนฒ๊ณ๏ฟฝ
JustDevRae 45ce6e5
array algorithm md file
JustDevRae 38a1f64
reverse string / ๊ธฐ์ด
JustDevRae 8219e21
control Z / ๊ธฐ์ด
JustDevRae 3654602
dart game / ์ค๊ธ
JustDevRae 1e2f2b0
valid parentheses / ์ค๊ธ
JustDevRae a4143c9
crane claw game / ์ค๊ธ
JustDevRae ea29442
pull origin JustDevRae branch
JustDevRae 77e2e30
pair count / ๆนฒ๊ณ๏ฟฝ
JustDevRae c0967b7
find point position / ๆนฒ๊ณ๏ฟฝ
JustDevRae d2dc9af
login success / ๆนฒ๊ณ๏ฟฝ
JustDevRae 5928dbd
card bundle / ไปฅ๎๏ฟฝ
JustDevRae 0d2f982
make hamburger / ไปฅ๎๏ฟฝ
JustDevRae df8ffd4
process / ๏ฟฝั๏ฟฝ
JustDevRae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| function solution(cards1, cards2, goal) { | ||
| var answer = ""; | ||
| for (let word of goal) { | ||
| if (word == cards1[0]) { | ||
| cards1.shift(); | ||
| } else if (word == cards2[0]) { | ||
| cards2.shift(); | ||
| } else { | ||
| answer = "No"; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| return (answer = "Yes"); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| function solution(dot) { | ||
| var answer = 0; | ||
|
|
||
| if (dot[0] > 0 && dot[1] > 0) answer = 1; | ||
| if (dot[0] < 0 && dot[1] > 0) answer = 2; | ||
| if (dot[0] < 0 && dot[1] < 0) answer = 3; | ||
| if (dot[0] > 0 && dot[1] < 0) answer = 4; | ||
|
|
||
| return answer; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| function solution(id_pw, db) { | ||
| var answer = ""; | ||
| for (let i = 0; i < db.length; i++) { | ||
| if (id_pw[0] === db[i][0]) { | ||
| if (id_pw[1] === db[i][1]) { | ||
| answer = "login"; | ||
| break; | ||
| } | ||
| answer = "wrong pw"; | ||
| break; | ||
| } else { | ||
| answer = "fail"; | ||
| } | ||
| } | ||
| return answer; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| function solution(ingredient) { | ||
| const burger = []; | ||
| let answer = 0; | ||
| for (let i of ingredient) { | ||
| burger.push(i); | ||
|
|
||
| if ( | ||
| burger.length >= 4 && | ||
| burger[burger.length - 4] === 1 && | ||
| burger[burger.length - 3] === 2 && | ||
| burger[burger.length - 2] === 3 && | ||
| burger[burger.length - 1] === 1 | ||
| ) { | ||
| burger.splice(burger.length - 4, 4); | ||
| answer++; | ||
| } | ||
| } | ||
|
|
||
| return answer; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| function solution(n) { | ||
| var answer = 0; | ||
|
|
||
| // 1๋ถํฐ n๊น์ง ์ซ์๋ฅผ ํ์ธ | ||
| for (let i = 1; i <= n; i++) { | ||
| // i๊ฐ n์ ์ฝ์์ธ์ง ํ์ธ | ||
| if (n % i === 0) { | ||
| // i๊ฐ n์ ์ฝ์์ธ์ง ํ์ธ | ||
| answer++; | ||
| } | ||
| } | ||
| return answer; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| function solution(priorities, location) { | ||
| var answer = 0; | ||
| const queue = priorities.map((priority, index) => ({ priority, index })); | ||
|
|
||
| while (queue.length > 0) { | ||
| const current = queue.shift(); | ||
|
|
||
| const highPriority = queue.some((item) => item.priority > current.priority); | ||
|
|
||
| if (highPriority) { | ||
| queue.push(current); | ||
| } else { | ||
| answer++; | ||
|
|
||
| if (current.index === location) { | ||
| return answer; | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| function solution(s) { | ||
| var answer = 0; | ||
| let Z = 0; | ||
| const controlArray = s.split(" "); | ||
| for (let i = 0; i < controlArray.length; i++) { | ||
| if (controlArray[i] == "Z") { | ||
| answer -= Z; | ||
| continue; | ||
| } | ||
| answer += Number(controlArray[i]); | ||
| Z = Number(controlArray[i]); | ||
| } | ||
|
|
||
| return answer; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| function solution(board, moves) { | ||
| let answer = 0; | ||
| const stack = []; | ||
|
|
||
| for (let move of moves) { | ||
| for (let i = 0; i < board.length; i++) { | ||
| if (board[i][move - 1] !== 0) { | ||
| let doll = board[i][move - 1]; | ||
| board[i][move - 1] = 0; | ||
|
|
||
| if (stack.length > 0 && stack[stack.length - 1] === doll) { | ||
| stack.pop(); | ||
| answer += 2; | ||
| } else { | ||
| stack.push(doll); | ||
| } | ||
| break; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return answer; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| function solution(dartResult) { | ||
| var answer = 0; | ||
| const dartResultArray = dartResult.match(/\d+|[SDT]|\#|\*/g); | ||
| const stack = []; | ||
| let value; | ||
|
|
||
| for (str of dartResultArray) { | ||
| if (str === "S") { | ||
| value = stack.pop(); | ||
| stack.push(value); | ||
| } else if (str === "D") { | ||
| value = stack.pop(); | ||
| stack.push(value * value); | ||
| } else if (str === "T") { | ||
| value = stack.pop(); | ||
| stack.push(value * value * value); | ||
| } else if (str === "*") { | ||
| let firtPopValue = stack.pop(); | ||
| firtPopValue *= 2; | ||
| let secondPopValue = stack.pop(); | ||
| if (secondPopValue === undefined) { | ||
| stack.push(firtPopValue); | ||
| } else { | ||
| secondPopValue *= 2; | ||
| stack.push(secondPopValue); | ||
| stack.push(firtPopValue); | ||
| } | ||
| } else if (str === "#") { | ||
| value = stack.pop(); | ||
| stack.push(value * -1); | ||
| } else { | ||
| stack.push(Number(str)); | ||
| } | ||
| } | ||
|
|
||
| for (element of stack) { | ||
| answer += element; | ||
| } | ||
|
|
||
| return answer; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| function solution(my_string) { | ||
| var answer = ""; | ||
| const string = [...my_string]; | ||
|
|
||
| for (let i = 0; i < my_string.length; i++) { | ||
| answer += string.pop(); | ||
| } | ||
|
|
||
| return answer; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| function solution(s) { | ||
| const stack = []; | ||
| for (const c of s) { | ||
| if (c === "(") { | ||
| stack.push(c); | ||
| } else if (c === ")") { | ||
| if (stack.length === 0) { | ||
| continue; | ||
| } else { | ||
| stack.pop(); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return stack.length === 0; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
์ฌํ๋ฌธ์ ๋ ํ์ง ๋ชปํด์ ๋ฆฌ๋ทฐํ๋ฉด์ ๋ฌธ์ ๋ ์ฒ์๋ณด๊ฒ ๋์๋๋ฐ, ๋ฌธ์ ์ดํดํ๋ ๋ฐ๋ ์ค๋๊ฑธ๋ ธ๋๋ฐ ์ฝ๋๋ฆฌ๋ทฐํ๋ฉด์
some๋ฉ์๋ ํ์ฉํ๋ฉด์ ๊ฐ๋จํ ๊ตฌํํ๋ ๋ถ๋ถ ๋ฑ ๋ง์ด ๋ฐฐ์ฐ๊ณ ๊ฐ๋๋ค๐