hacker rank
-
Counting Valleys해커랭크(HackerRank) 2018. 8. 19. 17:17
1. 문제 2. 알고리즘키워드 - 구현 3. 코드 1234567891011121314151617181920212223242526272829303132333435363738#include using namespace std; int countingValleys(int n, string s) { // Complete this function // 초기 위치는 0 int position = 0; // 깊이 int depth = 0; for(int i =0; i
-
CamelCase해커랭크(HackerRank) 2018. 8. 19. 17:15
1. 문제입력 받은 문자열에서 대문자의 개수를 출력 하는 문제 2. 알고리즘키워드 - 구현 3. 코드 12345678910111213141516171819202122232425262728293031#include using namespace std; int camelcase(string s) { // Complete this function const int size = s.size(); int count = 1; for(int i=0; i= 'a' && ch > s; int result = camelcase(s); cout