hi, How about this solution if the elements are in the range and all the elements should present then u can find sum of N numbers n(n+1)/2 by using range and factorial of n numbers
then u will get 2 equations solve the equations u will get the actual repeted no for 1,3,3,4 11-y+x=10 36x/y = 24 solve these equation to get the x value which is missing ....or y value which is repeate... Correct me if iam wrong On Fri, Aug 19, 2011 at 5:01 PM, Sanjay Rajpal <tosanjayraj...@gmail.com>wrote: > Yes this is the restriction and in assumption I have cleared it . > > > *Regards > > Sanju > > Happy to Help :)* > > > > On Fri, Aug 19, 2011 at 3:33 AM, monty 1987 <1986mo...@gmail.com> wrote: > >> @Sanju >> I think there exists a restriction in your approach that all numbers >> between 1and n has to be present in the array. >> >> Thanks >> Soumitra >> >> On Fri, Aug 19, 2011 at 9:53 AM, Sanjay Rajpal < >> tosanjayraj...@gmail.com> wrote: >> >>> In the first loop, numbers are the numbers in the given array >>> but in the second loop, numbers are just natural numbers. >>> >>> I forgot to mention as people may get confused. >>> >>> >>> >>> *Regards >>> >>> Sanju >>> >>> Happy to Help :)* >>> >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.