분류 전체보기
-
int findMedian(vector arr) { sort(arr.begin(), arr.end()); int n = arr.size(); int median = arr[n / 2]; return median; }
[HackerRank] Find Medianint findMedian(vector arr) { sort(arr.begin(), arr.end()); int n = arr.size(); int median = arr[n / 2]; return median; }
2023.10.19 -
void fizzBuzz(int n) { for (int i = 1; i
[HackerRank] FizzBuzzvoid fizzBuzz(int n) { for (int i = 1; i
2023.10.19 -
https://www.hackerrank.com/challenges/one-week-preparation-kit-time-conversion Time Conversion | HackerRank Convert time from an AM/PM format to a 24 hour format. www.hackerrank.com #include using namespace std; /* * Complete the 'timeConversion' function below. * * The function is expected to return a STRING. * The function accepts STRING s as parameter. */ string timeConversion(string s) { str..
[HackerRank] Time Conversionhttps://www.hackerrank.com/challenges/one-week-preparation-kit-time-conversion Time Conversion | HackerRank Convert time from an AM/PM format to a 24 hour format. www.hackerrank.com #include using namespace std; /* * Complete the 'timeConversion' function below. * * The function is expected to return a STRING. * The function accepts STRING s as parameter. */ string timeConversion(string s) { str..
2023.10.19 -
https://www.hackerrank.com/challenges/one-week-preparation-kit-mini-max-sum Mini-Max Sum | HackerRank Find the maximum and minimum values obtained by summing four of five integers. www.hackerrank.com #include using namespace std; string ltrim(const string &); string rtrim(const string &); vector split(const string &); /* * Complete the 'miniMaxSum' function below. * * The function accepts INTEGE..
[HackerRank] Mini-Max-Sumhttps://www.hackerrank.com/challenges/one-week-preparation-kit-mini-max-sum Mini-Max Sum | HackerRank Find the maximum and minimum values obtained by summing four of five integers. www.hackerrank.com #include using namespace std; string ltrim(const string &); string rtrim(const string &); vector split(const string &); /* * Complete the 'miniMaxSum' function below. * * The function accepts INTEGE..
2023.10.19 -
https://www.hackerrank.com/challenges/one-week-preparation-kit-plus-minus Plus Minus | HackerRank Calculate the fraction of positive, negative and zero values in an array. www.hackerrank.com #include using namespace std; string ltrim(const string &); string rtrim(const string &); vector split(const string &); /* * Complete the 'plusMinus' function below. * * The function accepts INTEGER_ARRAY ar..
[HackerRank] Plus Minushttps://www.hackerrank.com/challenges/one-week-preparation-kit-plus-minus Plus Minus | HackerRank Calculate the fraction of positive, negative and zero values in an array. www.hackerrank.com #include using namespace std; string ltrim(const string &); string rtrim(const string &); vector split(const string &); /* * Complete the 'plusMinus' function below. * * The function accepts INTEGER_ARRAY ar..
2023.10.19 -
https://www.hackerrank.com/challenges/arrays-ds Arrays - DS | HackerRank Accessing and using arrays. www.hackerrank.com #include #include using namespace std; string ltrim(const string &); string rtrim(const string &); vector split(const string &); /* * Complete the 'reverseArray' function below. * * The function is expected to return an INTEGER_ARRAY. * The function accepts INTEGER_ARRAY a as p..
[HackerRank] arrays-dshttps://www.hackerrank.com/challenges/arrays-ds Arrays - DS | HackerRank Accessing and using arrays. www.hackerrank.com #include #include using namespace std; string ltrim(const string &); string rtrim(const string &); vector split(const string &); /* * Complete the 'reverseArray' function below. * * The function is expected to return an INTEGER_ARRAY. * The function accepts INTEGER_ARRAY a as p..
2023.10.19