Ravi Kumar
BAN USER- 0of 0 votes
AnswersGiven an array of integers, we have to print all the sub sets of the array which have sum >=k.
- Ravi Kumar in India for Risk Assessment
For example, If my array is {1,2,3,4,5}
and my k= 5, then the sets I have to print are,
{5}, {4,1}, {4,2},{4,3}.......{1,2,3,4,5}.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 0of 0 votes
AnswersGiven a char array color[]={'a','b','c','d','e','f'.......'z'}
- Ravi Kumar in India for Retail
and a random array arr[]= {'f','a','b','b','z','a','a','a'}
you need to sort them such that resultant array will be {'a','a','a','a','b','b','f','z'}.
Conditions:
1) You should use swap function.
2) Every element may repeat minimum 5 times and maximum 26 times.
3) 'a' can be swapped only 1 time, 'b' can be swapped max 2 times,'c' can be swapped 3 times ...... z can be swapped max 26 times.
4) You cannot make elements of given array to 0.
5) you should not write helper functions.
Input will be of 100 elements each.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm
- 4 Answers How to get into top product based companies with 2 years exp
Hi,
- Ravi Kumar October 20, 2013
I did my graduation from one of the top IIIT's in comp science. And I have 2 years of experience in Java in a top product based company. I have a CGPA >9 and I have very good algorithmic skills.
Now I want to get into companies like Google, Microsoft, Facebook .. or companies like that. I have applied in the career portals of those companies, but no use. I hardly get any calls.
What should be my approach to apply in such companies? How to apply, so that I get an Interview call at least?
Your replies will be very helpful for my career!.
Thanks in Advance :)| Flag | PURGE
Use of color array :::
'a' can be swapped only 1 time, 'b' can be swapped max 2 times,'c' can be swapped 3 times ...... z can be swapped max 26 times.
if color array is {c,a,b,......z} , c can be swapped once , a can be swapped twice and b can be swapped thrice.. and so on
Obviously you have provided 0(2^n ) solution, I was asked to solve using n^2 and I can use dynamic programming
- Ravi Kumar August 09, 2013