pratik-choudhari / AlgoCode

Welcome everyone!🌟 Here you can solve problems, build scrappers and much more💻
https://github.com/pratik-choudhari/AlgoCode
MIT License
131 stars 166 forks source link

Compare Triplets #328

Closed pallavivaswani closed 3 years ago

pallavivaswani commented 3 years ago

Feature ✅

Description

Give rating of two People- Person A and Person B as triplet a = (a[0], a[1], a[2]) for A, and b = (b[0], b[1], b[2]) for B. The 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]. If a[i] > b[i], then A is awarded 1 point. If a[i] < b[i], then B is awarded 1 point. If a[i] = b[i], then neither A nor B receives a point. Given a and b, determine their respective comparison points.

Input

The first line contains 3 space-separated integers, a[0], a[1], and a[2], the respective values in triplet a. The second line contains 3 space-separated integers, b[0], b[1], and b[2], the respective values in triplet b.

Example

a = 1 2 3 b = 3 2 1 For elements 0, Person B is awarded a point because a[0] . For the equal elements a[1] and b[1], no points are earned. Finally, for elements 2, a[2] > b[2] so Person A receives a point. The returned array is [1, 1] with Person A’s score first and Person B's second.

Checklist:

Contributors are supposed to mention their coding language while asking for assignment

Saurabh-Daware commented 3 years ago

Can you assign me this? I can implement it in Java.

KompuDan commented 3 years ago

Hi, can i joint in this assignment? A would use Java

Isha2208 commented 3 years ago

Hey, @pratik-choudhari i would like to implement the code in C/C++. Please assign it to me.

pratik-choudhari commented 3 years ago

@KompuDan Java is taken up by another contributor for this issue. Wanna try other language? @Isha2208 You are assigned to 2 issues, it is the limit for this repo.

KompuDan commented 3 years ago

@pratik-choudhari sure, i'll do it on python

sawzedong commented 3 years ago

Since Isha2208 hit the limit for number of assigned issues, may I take this issue and implement in C/C++? Thanks!