geekological

metonym.in

Your friend for GRE words and Vocabulary. Find here

Interview street

/Interview street

Pairs challenge in Interview street

By |October 7th, 2012|

Problem Statement

Given N numbers , we need to count the total pairs of numbers that have a difference of K.

Input Format:
1st line contains N & K (integers).
2nd line contains N numbers of the set. All the N numbers are assured

to be distinct.

Output Format:
One integer saying the no of pairs of numbers […]

Median challenge in Interviewstreet

By |October 7th, 2012|

Problem Statement
 

The median of M numbers is defined as the middle number after sorting them in order, if M is odd or the average number of the middle 2 numbers (again after sorting) if M is even. Given an empty number list at first. Then you can add or remove some number from the list. […]

String Similarity Interviewstreet

By |October 7th, 2012|

Problem Statement
String similarity of two strings is defined as length of longest prefix common to both strings. For example string similarity for abcd and abb is 2, length of ab. Calculate sum of similarities of a string with each of its suffixes.
Input: First line contains T, no of test cases and next T lines contain […]

Flowers challenge interview street

By |October 7th, 2012|

Problem Statement

There are k friends who want to buy N flowers. Each flower has some cost ci. But there is condition that the price of flowers changes for customer who had bought flowers before. More precisely if a customer has already bought x flowers, he should pay (x+1)*ci dollars to buy flower number i. What […]