"Coding is just like talking to a unknown girl. Once you talked to her with guts, the next time you'll never afraid",Really? Yes , try it Now !!!
Everything here is for education and learning purpose only , individual holds rights on outer posts/links etc.
Team Cracking The Code
About Me
▼
Wednesday, December 14, 2011
If pairwise sums of 'n' numbers are given in non-decreasing order identify the individual numbers. If the sum is corrupted print -1 Example: i/p: 4 5 7 10 12 13 o/p: 1 3 4 9
Can you explain how did you do it in O(n^2) . where n is the number of elements given to us. that is n = (N*(N-1)/2). where N is the number of elements in final answer. Please verify its correctness.
Hey, Am not able to see the program. only the question and comments are visible. I have visited this site in the past and I dint have any issues that time - Chris
Shouldn't there be only a single "4" in the input? Four numbers should generate 6 pairwise sums, not 7.
ReplyDelete@Ted Hoop , Yeah by mistake it was multiple 4's , thnx i have updated the same., it can done in O(N^2) , i am wondering for linear algo ?
ReplyDeleteCan you explain how did you do it in O(n^2) .
ReplyDeletewhere n is the number of elements given to us. that is n = (N*(N-1)/2).
where N is the number of elements in final answer.
Please verify its correctness.
I'm not able to see the post. Only comments are visible.
ReplyDeleteHey,
ReplyDeleteAm not able to see the program. only the question and comments are visible. I have visited this site in the past and I dint have any issues that time
- Chris