shadykiller
BAN USER
Questions (2)
Comments (2)
Reputation 60
- 2of 2 votes
AnswersGiven N pair of parenthesis. Write an algorithm which would print out all possible permutations possible with those parenthesis given that parenthesis are in correct order (i.e. every open parenthesis is matched with closed parenthesis)
- shadykiller in India
For .e.g. .. N =3 should give:
()()()
(()())
()(())
(())()
((()))| Report Duplicate | Flag | PURGE
Flipkart Algorithm - 0of 0 votes
AnswersYou are given 2 dice. Both are fair. One of the dice has no numbers printed on it. You have to label the unmarked dice such that when both the dice are thrown, the sum on the faces is evenly distributed between 1 and 12.
- shadykiller in India| Report Duplicate | Flag | PURGE
Flipkart Brain Teasers
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 thats what I told :). Good
- shadykiller March 06, 2012Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Well imagine case of 2 normal dice. The sums will be between 2-12 when you throw them. Also 2 will come less times ( 1 + 1) while 7 would come more times ( 4 + 3 , 3 + 4, 5 + 2, 2+5), therefore this is not even distribution.
- shadykiller March 06, 2012You have to make sure that the probability of each number between 1-12 is equal. Having 3 faces 0 and 3 faces 6 does that. Calculate by yourself