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.


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
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.


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.


프로그래머스 - 탑

수평 직선에 탑 N대를 세웠습니다.
모든 탑의 꼭대기에는 신호를 송/수신하는 장치를 설치했습니다.
발사한 신호는 신호를 보낸 탑보다 높은 탑에서만 수신합니다.
또한, 한 번 수신된 신호는 다른 탑으로 송신되지 않습니다.

Compare the Triplets

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.

We define the rating for Alice’s challenge to be the triplet a = (a[0], a[1], a[2]), and the rating for Bob’s challenge to be the triplet b = (b[0], b[1], b[2]).

Your task is to find their comparison points by comparing a[0] with b[0], a[1] with b[1], and a[2] with b[2].


Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×