+ 2

Let's say you have a list of N+1 integers between 1 and N. You know there's at least one duplicate, but there might be more.

Let's say you have a list of N+1 integers between 1 and N. You know there's at least one duplicate, but there might be more. For example, if N=3, your list might be 3, 1, 1, 3 or it might be 1, 3, 2, 2. Print out a number that appears in the list more than once. (That is, in the first example, you can print '1' or '3' -- you don't have to print both.)

14th Nov 2017, 6:59 AM
SaiKumar
SaiKumar - avatar
2 Antworten
+ 3
@saikumar look- a solution with a filter function https://code.sololearn.com/c9hW2jsxWSUJ/?ref=app
14th Nov 2017, 7:34 AM
Oma Falk
Oma Falk - avatar
0
How do I type on my keyboard?
14th Nov 2017, 10:09 AM
Ethan_Lloyd
Ethan_Lloyd - avatar