# Build an optimized algorithm.

Prefer Javascript or C/C++ language.

Please don't spend more than 1-2 hours on this. Show us your best coding & documentation style - the way you like to write code.

You are given a list of integers, both positive and negative. Each integer in the list must either be paired with another element in the list or be a single element. Once the elements have been paired, the integers in the pairs are multiplied and the results are summed up - the sum will include the single elements.

Write a program to find the biggest possible sum.

Examples:

for the list [0,1,2,3,4,5] the pairs (4,5) and (2,3) are formed and 0 and 1 are single elements. The max. sum is 27 - (20+6+0+1).

for the list [-1,0,1] the pairs (-1,0) is formed and 1 is a single element. The max. sum is 1.

for the list [1,1] no pairs are formed only two single elements. The max. sum is 2. You choose the implementation language and how input/output is handled etc.

Om arbejdsgiveren:
( 22 bedømmelser ) Vladivostok, Russian Federation

Projekt ID: #19828349

## 27 freelancere byder i gennemsnit \$93 på dette job

vrcoder

A simple optimal algorithm in linear time O(n) for sorted array or O(n*log(n)) for unsorted. It was tested for millions of generated cases by comparing with a slow but reliable reference algorithm.

\$40 USD på 1 dag
(313 bedømmelser)
7.4
Jeltz

Lets look at sequence of four different positive numbers sorted from least to the greates value - m1,m2,m3,m4. It can be proved that greatest sum is m3*m4+m1*m2, i.e. it is bigger than other combinations. That suggest Flere

\$120 USD in 7 dage
(29 bedømmelser)
7.4
Piao217

Hi I see you are looking for someone to write C/C++ code for finding biggest sum combination from list. I am a Master of Maths and also an expert in C , C++, Algorithm, etc.. So I am very interested in your project Flere

\$100 USD in 3 dage
(132 bedømmelser)
7.8
utkarshkatiyar19

Hi, I’m an expert in solving these type of coding problems. I already have an algorithm in my mind. I’m sure that I can easily do this.

\$120 USD på 1 dag
(371 bedømmelser)
7.3
xinglong717

Algorithm expert. I have many experiences. I can complete your project successfully. I'm software engineer and algorithm expert. I'm fullstack website developer and database manager. Thanks.

\$140 USD in 7 dage
(48 bedømmelser)
5.5
harshdaga

Hi, I've got quite some experience with algorithms and C++ and I'm sure I can come up with a solution to this problem within an hour.

\$50 USD på 1 dag
(91 bedømmelser)
5.6
JinTaiZhe

Hi Glad to see you I am good at math and logic I have experience in ACM I can assure you good results Please ping me and let's discuss in detail Thanks Regards

\$140 USD in 7 dage
(15 bedømmelser)
5.6
amfahsoft

We are specialize in building websites. If you want your website to be more professional then we are the right folks for that. We are using HTML5, PHP, JAVASCRIPT, JQUERY languages. We have some debugging team as well Flere

\$155 USD in 3 dage
(14 bedømmelser)
4.2
KimHyokJun

Hi, sir. I'm finished your project. let me call to decision on chat. I can understand what you really want. I have experienced with Android and C++ many years and have done so many projects. If you hire me, I'll d Flere

\$200 USD på 1 dag
(20 bedømmelser)
4.2
heem42

I have been working in C++ and algorithms and pretty sure I will be able to help you out with this project. Lets discuss further in chat. I assure you to give best quality and best performance code, according to your n Flere

\$40 USD in 3 dage
(9 bedømmelser)
3.3
zpedia723

\$100 USD på 1 dag
(8 bedømmelser)
4.1
kostya1207

Hi Dear!... You just found bright shine like star in here. I will bring you good luck. Don't worry about your project. I have over 7 years experience of this development. I have enough passion , strength and endurance. Flere

\$200 USD på 1 dag
(5 bedømmelser)
2.2
WangJinStar

✫✫✫ Dear Hiring Manager ✫✫✫ Wish you a very good day!!! After reviewing your post, I am very interested in that due to my experience. I’d like to be considered for your project position. I am an expert C++/C# deve Flere

\$150 USD in 3 dage
(1 bedømmelse)
2.4
Rimalisa

Hi I have read your requirement very carefully. So I am really confidence your project. I have rich experiences with C and C++. I can finish your project with high quality in time. Hope your kind contact. Best regards!

\$30 USD på 1 dag
(2 bedømmelser)
1.0
chalnayaar1000

I am a computer engineering student and i have done these problems before, let me know if you want me to do this, payment will be discussed on chat.

\$55 USD in 3 dage
(0 bedømmelser)
0.0

i have a good hold over c++ language and i have the ability to solve complex problems with a simpler approach

\$35 USD in 2 dage
(0 bedømmelser)
0.0
ccs1664

Hi I saw that you many offers in many programming languages. I will do this program in 3 days. The language that I do my the best is PICAT. Please see [login to view URL] and my git of Picat's code [login to view URL] Flere

\$100 USD in 3 dage
(0 bedømmelser)
0.0
nalbe

\$30 USD på 1 dag
(0 bedømmelser)
0.0
nurfaizi2

Предлагаю алгоритм поиска : Вариантов включения элементов последовательности a[0,a[1],a[2],.. a[N-1] в пары 2**N (2 в степени N). Для каждого варианта можем вычислить сумму. То есть можем построить STL совместимый ите Flere

\$140 USD in 7 dage
(0 bedømmelser)
1.4
\$155 USD in 3 dage
(0 bedømmelser)
0.0