1๏ธโฃ ๋ค์ ํฐ ์ซ์ (https://school.programmers.co.kr/learn/courses/30/lessons/12911)
[level 2] Title: ์ด์ง ๋ณํ ๋ฐ๋ณตํ๊ธฐ, Time: 8.39 ms, Memory: 79.3 MB -BaekjoonHub · Young998904/Practice_Algorithm_Auto@
Show file tree Showing 2 changed files with 18 additions and 7 deletions.
github.com
โ ์ด์ง์์์ 0 ๋๋ 1์ ์ ๋
// ๊ธฐ์กด์ ์ฐ๋ ๋ฐฉ์ (1์ ๊ฐ์๋ฅผ ๊ตฌํ๋ ๋ฒ)
int n = 78;
String tmpBefore = Integer.toBinaryString(n); // 1001110
String tmpAfter = tmpBefore.replace("1", ""); // 000
int tmpCount = tmpBefore.length() - tmpAfter.length(); // ๊ฒฐ๊ณผ : 4
// Integer.bitCount(n) ํ์ฉ
int n = 78;
int count = Integer.bitCount(n); // ๊ฒฐ๊ณผ : 4
2๏ธโฃ ์นดํซ (https://school.programmers.co.kr/learn/courses/30/lessons/42842)
[level 2] Title: ์นดํซ, Time: 0.02 ms, Memory: 78.1 MB -BaekjoonHub · Young998904/Practice_Algorithm_Auto@a7999b9
Show file tree Showing 2 changed files with 87 additions and 0 deletions.
github.com
3๏ธโฃ ์ง์ง์ด ์ ๊ฑฐํ๊ธฐ (https://school.programmers.co.kr/learn/courses/30/lessons/12973)
[level 2] Title: ์ง์ง์ด ์ ๊ฑฐํ๊ธฐ, Time: 55.44 ms, Memory: 59.5 MB -BaekjoonHub · Young998904/Practice_Algorithm_Auto@8de
Show file tree Showing 2 changed files with 128 additions and 0 deletions.
github.com
โ ์คํ์ ํ์ฉ
// ์ ์ธ : Stack<์๋ฃํ> ๋ณ์๋ช
= new Stack<>();
import java.util.Stack;
Stack<String> stack = new Stack(); // ๋์ ์๋ฃํ

โก ๋ฌธ์์ด์ Character ๋ฐฐ์ด๋ก ๋ฐ๊พธ๋ ๋ฐฉ๋ฒ
char[] charArr = s.toCharArray();
4๏ธโฃ ์์ด ๋๋ง์๊ธฐ (https://school.programmers.co.kr/learn/courses/30/lessons/12981)
[level 2] Title: ์์ด ๋๋ง์๊ธฐ, Time: 0.52 ms, Memory: 77.2 MB -BaekjoonHub · Young998904/Practice_Algorithm_Auto@ce282b2
Show file tree Showing 2 changed files with 184 additions and 0 deletions.
github.com
// ๋ฐฐ์ด์ ๊ฐ์ ๊ฐ์ผ๋ก ์ฑ์ฐ๋ ๋ฐฉ๋ฒ
int[] numArr = new int[100];
// ๋ฐฉ๋ฒ (1) : ๋ฐ๋ณต๋ฌธ ์ฌ์ฉ
for (int i=0; i<100; i++) {
numArr[i] = 0;
}
// ๋ฐฉ๋ฒ (2) : Arrays.fill(๋ฐฐ์ด, ์ฑ์ธ ๋ด์ฉ);
import java.util.Arrays;
Arrays.fill(numArr, 0);
๐ค HashSet ์ฌ์ฉํด๋ณด๊ธฐ!
5๏ธโฃ ๊ตฌ๋ช ๋ณดํธ (https://school.programmers.co.kr/learn/courses/30/lessons/42885)
[level 2] Title: ๊ตฌ๋ช ๋ณดํธ, Time: 13.09 ms, Memory: 69.3 MB -BaekjoonHub · Young998904/Practice_Algorithm_Auto@03046c4
Show file tree Showing 2 changed files with 158 additions and 0 deletions.
github.com
โ ๋ฐฐ์ด์ด์์ผ๋ฉด ๋จผ์ Arrays.sort() ๋ฅผ ์ฌ์ฉํด์ ์ ๋ ฌํ๋ ๊ฒ์ ์๊ฐํด๋ณด๊ธฐ!
6๏ธโฃ N๊ฐ์ ์ต์๊ณต๋ฐฐ์ (https://school.programmers.co.kr/learn/courses/30/lessons/12953)
[level 2] Title: N๊ฐ์ ์ต์๊ณต๋ฐฐ์, Time: 0.33 ms, Memory: 78 MB -BaekjoonHub · Young998904/Practice_Algorithm_Auto@a6e18
Show file tree Showing 2 changed files with 76 additions and 0 deletions.
github.com
'Coding Test ๐' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [Programmers] Level 1 Java ๋ฌธ์ ํ์ด (3) (0) | 2022.12.08 |
|---|---|
| [Programmers] Level 2 Java ๋ฌธ์ ํ์ด (4) (0) | 2022.12.08 |
| [Programmers] Level 2 Java ๋ฌธ์ ํ์ด (2) (0) | 2022.11.09 |
| [Programmers] Level 2 Java ๋ฌธ์ ํ์ด (1) (0) | 2022.11.08 |
| [Programmers] Level 1 Java ๋ฌธ์ ํ์ด (2) (0) | 2022.10.31 |