+ 1
How can I do this. Please help guys
Let's say we have a table like this: Diana: 2 5 7 Maria: 5 6 4 Venus: 9 1 3 I need an algorithm to extract two different numbers from this table that have a SPECIFIC PRODUCT, for example 10. I want it to get me the 2 from diana and the 5 from maria. I don't want it to get the 2 and 5 from the same (string/person). Can someone give me a lead please?
22 Respuestas
+ 16
@ Tudor Selea, please delete your phone number 👍😉
+ 16
@ Tudor Selea, have a nice sunday 👍😉
+ 7
I'd code this:
Pick first person their first number that still allows getting a second one.
While you haven't found the remainder, check each of the numbers of each other people.
If you stll haven't found the pair, repeat the process with their next number and failing that move on to the next person.
If you haven't found a working combination having check all but the last person's numbers, it doesn't exist.
+ 5
Write code for your table.
Write initialization of the table.
Link that code here.
I'll read your code and make suggestions from there (I need effort on your part because I don't write someone else's code. I will fix it even though it will take much more of my time because you will learn during the process.)
+ 3
I can help you write it. But, want you to learn while doing it.
+ 3
This is a safe way to direct message.
https://www.sololearn.com/Discuss/689391
+ 2
I'll help you.
+ 2
I don't know, doesn't google have an app for this? Because I don't want to post my phone number.
+ 2
Over 600 of SoloLearn members are on Discord.
+ 2
Note that publishing personal information like skype is against the rules
+ 2
@tooselfish I did. I am sorry. It won't happen again
+ 1
I would always check everything below the current value.
+ 1
Skype or Discord, Tudor?
+ 1
Ok, we'll do Skype.
+ 1
Oh... Well, just delete it, I sent you a request anyways.
+ 1
I deleted it, I didn't remember that rule x-x
+ 1
Are you FenOth on Discord?
0
@john wells. I kind of understand but I have minor knowledge in programming how do I do the stuff you said?
0
@Timon how can we get to talk outside this app?
0
@john okay thank you, I will try to write the code myself and hopefully I wont do many mistakes