code.guruji
BAN USER
Comments (5)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
yes i think this is the correct explanation to this solution. we use binomial coefficient where we need to find exactly k successes in n trail. but here in question they are asking 4 out of 6 (not exactly i think ) and 5 out of 6 and 6 out of 6 should also taken in account
- code.guruji November 15, 2014Comment hidden because of low score. Click to expand.
0
of 0 vote
any reason why printing it with printf("%c"), it is printing nothing..., is it that there is no chracter corresponding to all ones?
- code.guruji April 21, 2012Comment hidden because of low score. Click to expand.
0
of 0 vote
any reason why printing it with printf("%c"), it is printing nothing..., is it that there is no chracter corresponding to all ones?
- code.guruji April 21, 2012Comment hidden because of low score. Click to expand.
0
of 0 vote
any reason why printing it with printf("%c"), it is printing nothing..., is it that there is no chracter corresponding to all ones?
- code.guruji April 21, 2012Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
is it a written test question ?
- code.guruji November 15, 2014data structures could be :
Assumption: you know the no. of different items possible. say 15 . then create an array of that size ,
int num_of_items = 15
int [] clothes = new clothes[num_of_items];
also create one enum having all the types of cloth;
enum cloth_type
{
white_shirt =0,
red_shirt = 1
etc
}
Now read the input
while (input != eof)
{
//read cloth type from input
switch(cloth type)
{
case cloth_type.cloth_type:
clothes[cloth_type.cloth_type] ++;
sames for other cases.
}
}
after while loop iterate over array and divide the socks type of entry by 2 . like 9/2 = 4 so 4 pair and 9%2 =1 alone.