Notice
Recent Posts
Recent Comments
- Today
- Total
01-11 05:49
Tags
- ๋ค์ต์คํธ๋ผ
- dp
- database
- ํ๋ก๊ทธ๋๋จธ์ค
- ์์์ ๋ ฌ
- PS
- tree
- ๋ฌธ๋ฒ
- OOP
- MST
- ๋ฐฑ์๋
- ๊ทธ๋ฆฌ๋
- leetcode
- java
- ์๋ฐ์์ ์
- spring
- ๋ฒจ๋งํฌ๋
- CS
- ์๋ฃ๊ตฌ์กฐ
- ์กธ์ ์ํ
- ๋ฐฑ์ค
- Graph
- ์ธํด
- ๊ตฌํ
- pytorch
- array
- ์๋ฐ
- Algorithm
- BFS
- ๋ฐ์ดํฐ๋ฒ ์ด์ค
Link
Partially Committed
[ํ๋ก๊ทธ๋๋จธ์ค] ๊ฐ์ด๋ฐ ๊ธ์ ๊ฐ์ ธ์ค๊ธฐ ๋ณธ๋ฌธ
๐ฅ Algorithm || ๋ฌธ์ ํ์ด/PS
[ํ๋ก๊ทธ๋๋จธ์ค] ๊ฐ์ด๋ฐ ๊ธ์ ๊ฐ์ ธ์ค๊ธฐ
WonderJay 2022. 7. 5. 17:44728x90
๋ฐ์ํ
SMALL
https://school.programmers.co.kr/learn/courses/30/lessons/12903
๋ฌธ์์ด์ ์ค๊ฐ๊ฐ์ ์ถ์ถํ๋ค.
[C++]
#include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0)
using namespace std;
string solution(string s) {
string answer = "";
fastio;
int middle = (s.end() - s.begin()) / 2;
if (s.size() % 2 == 0)
{
answer.push_back(s[middle-1]);
answer.push_back(s[middle]);
}
else
{
cout << middle << '\n';
answer.push_back(s[middle]);
}
return answer;
}
728x90
๋ฐ์ํ
LIST
'๐ฅ Algorithm || ๋ฌธ์ ํ์ด > PS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํ๋ก๊ทธ๋๋จธ์ค] ๊ฐ์ ์ซ์๋ ์ซ์ด (0) | 2022.07.06 |
---|---|
[2018 KAKAO BLIND RECRUITMENT] (1์ฐจ) ๋คํธ ๊ฒ์ (0) | 2022.07.06 |
[2018 KAKAO BLIND RECRUITMENT] (1์ฐจ) ๋น๋ฐ์ง๋ (0) | 2022.07.05 |
[์ํด๋ฆฌ ์ฑ๋ฆฐ์ง] ๋ถ์กฑํ ๊ธ์ก ๊ณ์ฐํ๊ธฐ (0) | 2022.07.05 |
[์๊ฐ ์ฝ๋ ์ฑ๋ฆฐ์ง ์์ฆ3] ๋๋จธ์ง๊ฐ 1์ด ๋๋ ์ ์ฐพ๊ธฐ (0) | 2022.07.05 |
Comments