samedi 2 janvier 2021

Returns Pair of two elements - Homework problem Google Challenge

I'm struggling to implement in C a function that gets as two inputs , one input is an integer array, second input is the given sum.

the function returns the pairs of two element that its sum equal to the given sum.

I don't have much experience in C , and I started to implement the function by myself.

I've seen the solution here step by step : enter link description here

but I really didn't understand the logic of the explained code in the video, could anyone please explain to me the algorithm / the code that's explained on the video?

how really we find the matched two pairs that its sum equal to the given sum?

For me a pseudo code is also awesome to understand the solution of the problem.

Much appreciated.

Aucun commentaire:

Enregistrer un commentaire