ms_emp
BAN USERDev
Comments (4)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
1) get the ratio of weight and height
2) order the ratio
3) order all the pairs by weight
4) check if all the height become ordered by doing 3)
5) if 4) is true return
6) if 4) is false discard the pair whose ratio is furthest from a median ratio value of 2) <no matter the biggest or the mallest>
7) start from the 3) again
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
for i 0 to n {
- ms_emp June 07, 2008idx = atoi(str[i])
if(tempStr[idx] != null) then not unique and return
else tempStr[idx] = str[i]
}
then unique and return