![article thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FGqJ72%2Fbtrj1J67xz2%2FrMFOeK6hvyHaqCR7CQba50%2Fimg.png)
https://www.hackerrank.com/challenges/designer-pdf-viewer/problem Designer PDF Viewer | HackerRank Help finding selection area in PDF Viewer. www.hackerrank.com Algorithms > Implementation 알파벳의 높이가 저장된 배열과 단어가 주어지면 (단어에 포함된 알파벳의 최고 높이) * (단어 길이)를 반환한다. 코드 int designerPdfViewer(int h_count, int* h, char* word) { int max = 0; int word_count = strlen(word); for (int i = 0; i < word_count; i++) { if..
![article thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdTKzKl%2Fbtrj0U13LNf%2FWpkJgkLqOCTSSGZrkJggx1%2Fimg.png)
https://www.hackerrank.com/challenges/correctness-invariant/problem Correctness and the Loop Invariant | HackerRank How do you demonstrate the correctness of an algorithm? You can use the loop invariant. www.hackerrank.com Algorithms > Sorting 배열을 정렬하는 함수의 잘못된 코드가 주어지면 올바르게 동작하도록 수정한다. 코드 void insertionSort(int N, int arr[]) { int i,j; int value; for(i=1;i=0 && value
![article thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcGRtQe%2Fbtrhdvc0CXw%2F75OE2ATMaXD8z74oK1kXKK%2Fimg.png)
https://www.hackerrank.com/challenges/birthday-cake-candles/problem Birthday Cake Candles | HackerRank Determine the number of candles that are blown out. www.hackerrank.com Algorithms > Warmup 초의 길이 배열이 주어지면 가장 긴 길이를 가진 초의 개수를 출력한다. 코드 int birthdayCakeCandles(int candles_count, int* candles) { int max = 0, count = 0; for (int i = 0; i max) max = candles[i..
![article thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbCkThl%2FbtrhcOxheTI%2FFwuzINqIikhiVMeQvgv3Z0%2Fimg.png)
https://www.hackerrank.com/challenges/countingsort2/problem Counting Sort 2 | HackerRank Simple version of counting sort. www.hackerrank.com Algorithms > Sorting 정수 리스트가 주어지면 각 값이 등장하는 횟수를 세어 배열에 저장하고, 0이 아닌 각 인덱스의 값을 횟수만큼 출력한다. 코드 int* countingSort(int arr_count, int* arr, int* result_count) { *result_count = arr_count; int *count = malloc(100 * sizeof(int)); int *res = malloc(arr_count * sizeo..