How do u find the largest repeating string and the number of times it repeats in a given string efficiently offcourse !? ex : String : "abc fghi bc kl abcd lkm abcdefg" Ans : "abcd" count = 2
There are 4 buckets of coins. Real coins weigh one gram each. fake grams weigh 2 grams each. Each bucket is fake (contains only fake coins) or real (contains only real coins). You have weighing machine, which can be used only one weighing. If there are 9 coins per bucket, how can you determine all the buckets that are fake with just one weighing.
Given a binary tree, you need to verify it is a binary search tree or not. How do you do that?
Write a C function, which takes a number n and positions p1 and p2 and returns if the the bits at positions p1 and p2 are same or not.
Write a C function, which takes two numbers m and n, (which are representing and bit set) and checks whether m is a subset of n or not.
A majority element in an array A, of size N is an element that appears more than N/2 times (and hence there is atmost one such element) Write a function which takes an array and emits the majority element (if it exists), otherwise prints NONE as follows: I/P : 3 3 4 2 4 4 2 4 4 O/P : 4 I/P : 3 3 4 2 4 4 2 4 O/P : NONE