bimleshsharma
BAN USER
Comments (4)
Reputation -10
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
-1
of 1 vote
I am Pythonic so i can answer in Python only:
from collections import Counter #module import
L=[6,7,7,8,8,2,3,8,8,11,23,8,8,1,3,3,4,4,4]
most_common,num_most_common =Counter(L).most_common(1)[0]
print most_common,num_most_common # output (8, 6)
Comment hidden because of low score. Click to expand.
-1
of 1 vote
Then it is more simple.
if miss_num in list:
pass
else:
print "missing number is", miss_num
Comment hidden because of low score. Click to expand.
0
of 0 vote
Correction:
def find_missing():
l=list(x for x in range(1,101))
l.remove(55)
print l
Y=1
for x in l:
if x==Y:
pass
else:
print Y,"tnumber not in list"
break
Y+=1
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Here is perl....
- bimleshsharma July 27, 2013