Skip to content

Second commit-yashjain - #12

Open
yashjain0112 wants to merge 1 commit into
sadanatushar:masterfrom
yashjain0112:master
Open

Second commit-yashjain#12
yashjain0112 wants to merge 1 commit into
sadanatushar:masterfrom
yashjain0112:master

Conversation

@yashjain0112

Copy link
Copy Markdown

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 a[], and the rating for Bob's challenge to be the triplet b[].

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

If a[i]>b[i] then Alice is awarded point.
If a[i]<b[i] then Bob is awarded point.
If a[i]=b[i] then neither person receives a point.
Comparison points is the total points a person earned.

Function Description

Complete the function compareTriplets in the editor below. It must return an array of two integers, the first being Alice's score and the second being Bob's.

compareTriplets has the following parameter(s):

a: an array of integers representing Alice's challenge rating
b: an array of integers representing Bob's challenge rating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant