Computer Science (21) 썸네일형 리스트형 Hacker Rank_4/54 tests (Easy, Sparse Array) There is a collection of input strings and a collection of query strings. For each query string, determine how many times it occurs in the list of input strings. Return an array of the results. Examplequeries = [a', 'b', c'd']strings = [a', b, c'd']return => [1, 0, 1] func matchingStrings(strings: [String], queries: [String]) -> [Int] { // Hashmap - Dictionary // Arr - size/order //var dic.. Hacker Rank_3/54 tests (Easy, Time Conversion) Given a time in -hour AM/PM format, convert it to military (24-hour) time.func timeConversion(s: String) -> String { //split / components / subscript / index var ans = s.map { $0 } // or copy-inout if s.contains("P") { ans.replaceSubrange(0...1, with: String(Int(s.split(separator: ":")[0])!+12)) if ans[0] == "2" && ans[1] == "4" { ans.replaceSubrange(0...1, .. Hacker Rank_2/54 tests (Easy, Min-Max Sum) While solving basic problems from the beginning, I should also practice summarizing problems written in English.And plan to organize Swift grammar thoroughly starting from the basics.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 spa.. Hacker Rank_1/54 tests (Easy, Plus Minus) Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with 6 places after the decimal.Note: This challenge introduces precision problems. The test cases are scaled to six decimal places, though answers with absolute errors of up to 10(-4) are acceptable. Examplearr = [1, 1, -1, -1, 0]Results .. Updated_Hacker Rank (Intermediate, Equal) Dynamic ProgrammingDivide complex problems into simpler sub-problems. - Tabulation (Bottom-Up) - Iteration(반복문) : For a large set of inputs → Make the results one by one. - Memoization (Top/Deep-Down): Recursion(재귀함수) : For a small set of inputs → Save each result to use next. [Problem Summary]▪︎ Each colleague has some chocolates (The number of chocolates each colleague has initially ▪︎ .. 이전 1 2 3 다음