Let say we have N number and N is odd. Among the N numbers, two of them equal to each other except one. For example, let's say we have 7 numbers, which could be 5, 3, 4, 1, 3, 5, 1. Only 4 is distinct, other number always has anther one member equal to it. Then how can we design a algorithm to find the distinct number(among N numbers) in linear time with only one variable introduced.

alien2006.happy
0
Newbie Poster

## Recommended Answers

Jump to PostLet's say I have a homework question. Let's say I have no intention of actually doing it myself.

Let's say I post that question on an internet forum and see how many people will try and post the answer.

Jump to PostLet's say I have a homework question. Let's say I have no intention of actually doing it myself.

Let's say I post that question on an internet forum and see how many people will try and post the answer.

## All 6 Replies

iamthwee

iamthwee

Rashakil Fol
978
Super Senior Demiposter
Team Colleague

mrnutty
761
Senior Poster

alien2006.happy
0
Newbie Poster

Rashakil Fol
978
Super Senior Demiposter
Team Colleague

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.