Is it possible to get the questions given in the recent Directi coding round (held on 09022014) and possibly solutions any where? [I participated in the round, forgot to note down the qns. Asking this just out of interest and not for any other use]. asked 09 Feb '14, 21:40

answered 09 Feb '14, 22:40
You could write the statement too, since he's asking for problems&solutions :D
(09 Feb '14, 22:58)
@abhinav1234 >> thanks for sharing your approach. :)
(09 Feb '14, 23:22)
@bit_cracker007>> why are the links to code removed ??
(10 Feb '14, 16:32)

Question 2/2 Weighted Stone ArrangementYou are given an infinite number of stones. The 1st stone has the weight 1 The 2nd stone has the weight 3 The tth stone has the weight W(t) = 2 * W(t1) + W(t2) Thus, the weights of the first 10 stones are 1, 3, 7, 17, 41, 99, 239, 577, 1393, 3363 Note that you only have one stone of each weight. You have a weighing machine which is the age old 2pan balance. You wish to use this machine to measure the weight of an item whose weight is T. The item will always be kept on the right pan. A stone may be kept on either one of the pans. Also, it is not required to use all the stones. The stones have a weird magnetic property, due to which, the kth stone cannot be in the same pan as the (k1)th stone. This means that the stone with weight 239 cannot be in the same pan as the stone with weight 99, or in the same pan as the stone with weight 577; and so on.
Note that the other alternative
is Illegal since 3 cannot be in the same pan as 1 (or 7 cannot be in the same pan as 3).
It can be proven that to measure any weight T, there exists a unique arrangement of stones that satisfy the given constraints and measure weight T. Thus, T = 11 or T = 21 can only be measured by the respective arrangements above. You are given T in the input. Output the arrangement of stones that measures T.
answered 10 Feb '14, 01:01

Question 1/2 Compromised PostsThis is year 4096 and humans have found a medicine for immortality in the year 2048. Tukro a famous online social networking site founded in the year 3072 was celebrating its 1024th anniversary. To celebrate the occasion its CEO, Shark, and his team had launched a unique personalised video of length 17min 4sec for each user. The video consisted of a collage of all popular posts made by the user on Tukro. Raka shared this video with all his friends without reviewing it. Immediately after he finished watching the 1024 second length clip he realised that he made a huge mistake. The video was made of all posts made by Raka, irrespective of the privacy settings of the individual post. A post is compromised if a friend who was not supposed to see the original post, has seen it now. Raka wants to know how many of his posts have been compromised. Tukro provides the list of users who have watched the video till now. Help Raka find how many posts were compromised. Raka has N friends, identified by a unique integer between 0 and N1. Raka has L lists of friends, identified by a unique integer between 0 and L1. Each list can be of length at the most N. One friend cannot be added more than once to the same list. A list must have at least one friend. A friend may be added to multiple lists. Visibility of a post in Tukro works through two filters Include Filter: An array of lists, from the L lists above. Friends can view a post if they belong to any friend list, specified in the Include Filter. Exclude Filter: An array of lists, from the L lists above. Friends can view a post if their name does not belong to any friend list, specified in the Exclude Filter. Some caveats of the above are If no Filter is active, the post is visible to all friends If only Include Filter is active, a friend can see the post only if he is present in at least one of the lists of Include Filter. If only Exclude Filter is active, a friend can see the post only if he is not present in any of the lists of exclude filter. If both Include and Exclude Filters are active, a friend can see the post if and only if he is present in at least one of the lists of include filter and he is not present in any of the lists of exclude filter if he is present in both an include filter list, and exclude filter list, he should not be able to see the post Input Specification First line contains a single integer N, the number of friends. Second line contains a list of integers separated by a single space. The first integer V, represents the number of friends who viewed the video. There are V other integers in the line representing the ID's of friends who viewed the video. Third line contains a single integer L representing the number of lists. L lines follow. Each line representing a list. The first integer of the line A, denotes the size of the list; followed by A integers, each denoting the friends in the list. Next line contains a single integer P denoting the number of posts in the video. 2 * P lines follow. Each pair denoting the Include Filter and Exclude Filters of one post respectively. First two lines denote the Include and Exclude Filters for first post Next two lines denote the Include and Exclude Filters of second post and so on.. An include filter is represented by a list of space separated integers. The first integer B represents the number of lists in the filter. B may be 0, to denote that the include filter is not active. If B is more than 0, the include filter is active and the next B integers in the line denote the ID's of lists present in the include filter. Exclude filters are also represented in the same format. Output Specification Print a single integer specifying the number of posts that are compromised according to the definition above.
Note that the constraints on N and P are large. Your solution will exceed time limits if its complexity is O(N*P). Even O(V*P) solutions may exceed time limit! Note the small constraint on L.
answered 10 Feb '14, 00:51

Here are my solutions to both problems. Compromised Posts I could only do the first question during the contest. Did the second after the contest. So hopefully it is correct. Used bitmasking in the first. Second is quite clear from the solution. answered 11 Feb '14, 04:51
These links are not working
(21 Jun '14, 22:49)
@himank77 Should be working now.
(18 Jul '14, 15:27)

@freeman92 >> Give me your email address. I will mail the problem statements and test cases to you. answered 09 Feb '14, 23:50
can you please write the function for second problem. is it f(n)=2*f(n1)+f(n2) or something else???
(09 Feb '14, 23:56)
@bugkiller it would be great if you could share it on some public forum or ..mail me on my id abhinavinsomniac@gmail.com. thanku
(10 Feb '14, 00:34)
@abhinav1234 >> Yes it is the same that you have written. @johri21 >> Okay, I am uploading publicly. I'll post the link asap.
(10 Feb '14, 00:39)
2
Posted problem statements assuming that sharing problems won't harm anyone.
(10 Feb '14, 01:02)
@bugkiller >> thanks for sharing the problem statements :)
(10 Feb '14, 10:53)

The results were to come out today. Did anyone get a mail from them?
I'm wondering about the same thing. No response yet.