X

View By:

Q2
**Flatten array of arrays**

Write a program to Merge/flatten an Array of Arrays in JavaScript

Q3
**Single linked list**

Find the nth last element of the single linked list

Q4
**how to kill a hen who is not giving egg since 10 days.**

There are many number of hens (say 1000 ) in a poultry farm. One out of them is not laying egg since last 10 days.

How to kill that hen ?

Q5
**Facebook Programming Challenge - Bar Problem - N friends are playing a game**

N friends are playing a game. Each of them has a list of numbers in front of himself.

Each of N friends chooses a number from his list and reports it to the game administrator. Then the game administrator sorts the reported numbers and shouts the K-th largest number.

You want to know the count all possible numbers that the game administrator can shout.

Input Format:

First line of the input contain an integer T, the number of testcases. Then follow T testcases. For each test case the input is of the following format.

In the first line there are two numbers N and K. In each of next N lines there is an integer a_i followed by a_i integers, ith line describes the list for ith person.

All the numbers ...

show more

Q6
**Regarding Flipkart online exam**

Hi There. I have a flipkart online exam scheduled. Can anyone help me with the test pattern for Flipkart online exam for MySql and Java?
I meant what sort of questions they might ask?
Thanks :)

Q7
**Custom Sort**

You have a set of numbers. a1, a2, a3, a4.....an. numbers are random and may
repeat.

Arrange the number in order such that x1 > x2 < x3 > x4 < x5 > x6.......

x1 has no relation ship with x3, x4, x5... x2 has no relation ship with x4, x5... x3 has no relation ship with x1, x5, x6... and so on.

There maybe many feasible solution to this problem see that the final answer reaches any one of them. If the input is like 22,22,22 then it should output a message as no feasible solution but for an input like this 7 7 7 3 3 it should print out a solution like : 7 3 7 3 7.

Q8
**BasketBall game**

A group of N high school students wants to play a basketball game. To divide
themselves into two teams they first rank all the players in the following
way:

Players with a higher shot percentage are rated higher than players with a lower shot percentage. If two players have the same shot percentage, the taller player is rated higher.

Luckily there are no two players with both the same shot percentage and height
so they are able to order themselves in an unambiguous way. Based on that
ordering each player is assigned a draft number from the range [1..N], where
the highest-rated player gets the number 1, the second highest-rated gets the
number 2, and so on. Now the first team contains all the players with the odd
draft numbers and ...

show more

Q9
**Sequence of vowels and consonant**

In the English alphabet, the letters A, E, I, O and U are vowels. Y is also
considered to be a vowel if it's not preceded by another vowel and is not the
first letter in a word (the fact that a vowel is defined to some extent in
terms of itself does not make it ambiguous). If a letter is not a vowel then
it is a consonant. So in "TOY" the consonants are T and Y, and in "SYZYGY"
they are S, Z and G.

A sequence of vowels will be denoted by uppercase letter 'V' and a sequence of
consonants will be denoted by uppercase letter 'C'. A word can then be
described as an alternating sequence of 'C' and 'V'. For instance, the word
"WHEREABOUTS" has the sequence CVCVCVC, and the words "YORK" and "TOY" both
have the sequence CVC. It's not permissibl...

show more

Q10
**Puzzle "Parlor "**

Beautiful You Pvt. Ltd. owns several parlors. Research has shown that if a
customer arrives and there is no staff available to service them, the customer
will turn around and leave, thus costing the company a sale. Your task is to
write a program that tells the company how many customers left without getting
any service.

Problem Definition:

The samples below consists of function calls for 4 parlors. Function call for each parlor contains a positive integer, representing the number of staff in the parlor, followed by a sequence of uppercase letters.

Letters in the sequence occur in pairs. The first occurrence indicates the
arrival of a customer; the second indicates the departure of that same
customer. A customer will be ser...

show more