개발차
[알고리즘] 05. Plus Minus
Given an array of integers, calculate the fractions of its elements that are positive, negative, and are zeros. Print the decimal value of each fraction on a new line.Note: This challenge introduces precision problems. The test cases are scaled to six decimal places, though answers with absolute error of up to are acceptable.For example, given the array there are elements, two positive, two nega..
[알고리즘] 04. Diagonal Difference
Given a square matrix, calculate the absolute difference between the sums of its diagonals.For example, the square matrix is shown below:1 2 3 4 5 6 9 8 9 The left-to-right diagonal = . The right to left diagonal = . Their absolute difference is .Function descriptionComplete the function in the editor below. It must return an integer representing the absolute diagonal difference.diagonalDifferen..
[알고리즘] 03. A Very Big Sum
Calculate and print the sum of the elements in an array, keeping in mind that some of those integers may be quite large.Function DescriptionComplete the aVeryBigSum function in the editor below. It must return the sum of all array elements.aVeryBigSum has the following parameter(s):ar: an array of integers .Input FormatThe first line of the input consists of an integer . The next line contains s..
[알고리즘] 02. Compare the Triplets
Alice and Bob each created one problem for HackerRank. A reviewer rates the two challenges, awarding points on a scale from to for three categories: problem clarity, originality, and difficulty.We define the rating for Alice's challenge to be the triplet , and the rating for Bob's challenge to be the triplet .Your task is to find their comparison points by comparing with , with , and with .If , ..
[알고리즘] 01. Simple 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 ..
[알고리즘] 00. Solve Me First
Complete the function solveMeFirst to compute the sum of two integers.Function prototype:int solveMeFirst(int a, int b);where,a is the first integer input.b is the second integer inputReturn valuessum of the above two integersSample Inputa = 2 b = 3 Sample Output5 ExplanationThe sum of the two integers and is computed as: . 답: def solveMeFirst(a,b): return a+b num1 = int(input())num2 = int(input..