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

Scalar Product of an Array #344

Closed pallavivaswani closed 3 years ago

pallavivaswani commented 3 years ago

Feature ✅

Description

Given two arrays A1 and A2; Find the Minimum and Maximum Scalar product of these two arrays. A scalar product is also known as the dot product of two vectors.

For finding the minimum scalar product of arrays we need to multiply the minimum value of array to the maximum value of the second array and add all multiple values.

Hint: here we need to sort the array1 and array2 in ascending order and descending order respectively.

For finding the maximum scalar product of arrays we need to multiply the minimum value of array to the minimum value of the second array and add these multiple values.

Hint: Here we need to sort the array1 and array2 in ascending order and ascending order respectively.

Example

Example for Minimum Scalar Product

array 1 : 1 2 3 4 array 2 : 5 3 2 1 scalar product: 15+23+32+41 = 5+6+6+4 = 21

Example for Maximum Scalar Product

array 1 : 1 2 3 4 array 2 : 2 3 4 5 scalar product: 12+23+34+45 = 2+6+12+20 = 40

Checklist:

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

kitteltom commented 3 years ago

@pallavivaswani @pratik-choudhari I would like to do this in Python. Can you assign it to me?

AniketDGiri commented 3 years ago

Hello, I would like to do it in C++, Could you please assign this to me?

ghanender-chauhan commented 3 years ago

assign me this i will do in python its my second contribution plz assign me

pratik-choudhari commented 3 years ago

@ghanender-chauhan It is assigned to @kitteltom

bhavya092 commented 3 years ago

Can you assign this to me ? (C++)

ShraxO1 commented 3 years ago

Can you assign me for python/C/C++

MAHIMA01 commented 3 years ago

Can you please assign me this issue for JAVA and Python?