2020/09/03

    [Swift] Swift 값 입력, 비교

    Alice and Bob each created one problem for HackerRank. A reviewer rates the two challenges, awarding points on a scale from 1 to 100 for three categories: problem clarity, originality, and difficulty.The rating for Alice's challenge is the triplet a = (a[0], a[1], a[2]), and the rating for Bob's challenge is the triplet b = (b[0], b[1], b[2]).The task is to find their comparison points by compar..

    [Swift] Array의 Sum 구하기

    Given an array of integers, find the sum of its elements.For example, if the array , , so return .Function DescriptionComplete the simpleArraySum function in the editor below. It must return the sum of the array elements as an integer.simpleArraySum has the following parameter(s):ar: an array of integersInput FormatThe first line contains an integer, , denoting the size of the array. The second ..

    [Swift] URLSession이란? (2)

    URLSession (2)response 받은 데이터를 object로 만들어 볼 것이다.블로그 내의 데이터를 받아와보려고 했으나, 구조가 많이 달라 우선 강의과 같은 조건으로 진행해보자. 우선 기존에 작성했던 것 처럼 urlComponents를 생성한다. let config = URLSessionConfiguration.defaultlet session = URLSession(configuration: config) // URLvar urlComponents = URLComponents(string: "https://itunes.apple.com/search?")!let mediaQuery = URLQueryItem(name: "media", value: "music")let entityQuery = U..