HackerRank (5) 썸네일형 리스트형 [HackerRank] [C#] 1 Week Preparation Kit > Day 2 > Counting Sort 1 문제 : Counting Sort 1 사용언어 : C# 문제 내용 Comparison Sorting Quicksort usually has a running time of n x log(n), but is there an algorithm that can sort even faster? In general, this is not possible. Most sorting algorithms are comparison sorts, i.e. they sort a list just by comparing the elements to one another. A comparison sort algorithm cannot beat n x log(n) (worst-case) running time, since n x .. [HackerRank] [C#] 1 Week Preparation Kit > Day 2 > Diagonal Difference 문제 : Diagonal Difference 사용언어 : C# 문제 내용 Given a square matrix, calculate the absolute difference between the sums of its diagonals. For example, the square matrix arr is shown below: 1 2 3 4 5 6 9 8 9 The left-to-right diagonal = 1 + 5 + 9 = 15. The right to left diagonal = 3 + 5 + 9 + 17. Their absolute difference is |15 - 17| = 2. Function description Complete the diagonalDifference function .. [HackerRank] [C#] 1 Week Preparation Kit > Day 2 > Lonely Integer 문제 : Lonely Integer 사용언어 : C# 문제 내용 Given an array of integers, where all elements but one occur twice, find the unique element. Example a = [1,2,3,4,3,2,1] The unique element is 4. Function Description Complete the lonelyinteger function in the editor below. lonelyinteger has the following parameter(s): int a[n]: an array of integers Returns int: the element that occurs only once Input Format T.. [HackerRank] [C++] 1 Week Preparation Kit > Day 1 Time Conversion 문제 : Time Conversion 사용언어 : C++ 문제 내용 Given a time in 12-hour AM/PM format, convert it to military (24-hour) time. Note: - 12:00:00AM on a 12-hour clock is 00:00:00 on a 24-hour clock. - 12:00:00PM on a 12-hour clock is 12:00:00 on a 24-hour clock. Example s = '12:01:00PM' Return '12:01:00'. s = '12:01:00AM' Return '00:01:00'. Function Description Complete the timeConversion function in the edit.. [HackerRank] [C++] 1 Week Preparation Kit > Day 1 > Mini-Max Sum 문제 : Mini-Max Sum 사용언어 : C++ 문제 내용 Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers. Example arr = [1,3,5,7,9] The minimum sum is 1 + 3 + 5 + 7 = 16 and the maximum sum is 3 + 5 + 7 + 9 = 24. The function .. 이전 1 다음