static int MaxLoot(int[] A, int n)
{
int[] S = new int[n];
S[0] = A[0];
S[1] = A[1];
S[2] = S[0] + A[2];
int maxloot = Math.Max(S[1], S[2]);
for (int i = 3; i n; i++)
{
S[i] =
, Jan 13, 2011 at 11:53 AM, Davin dkthar...@googlemail.com wrote:
Smaple Data :
input : abcdacdc
Output : cadb
If the count is same for characters. maintain the original order of
the characters from input string.
Please do let me know for any clarification.
--
You received
cab
As 'c' and 'a' have same count but 'c' was before 'a' in the input
string.
On Jan 13, 1:39 pm, juver++ avpostni...@gmail.com wrote:
@Davin.
Please provide an example of output for this -
cabbaacc
--
You received this message because you are subscribed to the Google Groups
Algorithm
@juver++ Thanks for hint. Problem solved.
On Jan 13, 1:48 pm, juver++ avpostni...@gmail.com wrote:
@Davin
maintain count of each character, along with the first occurence of it in
the string.
then write your own comparator and run sort using it
--
You received this message because you
1) Get count of the nodes in first list, let count be c1.
2) Get count of the nodes in second list, let count be c2.
3) Get the difference of counts d = abs(c1 – c2)
4) Now traverse the bigger list from the first node till d nodes so
that from here onwards both the lists have equal no of nodes.
5)
@manoj, Can you please explain question about your understanding?
On Jan 12, 4:19 pm, manoj manoj.lala...@gmail.com wrote:
wake up ..L
I think original question has asked about intersection (set
intersection)...not the node intersection of two linked list.
On Jan 12, 4:04 pm,
Smaple Data :
input : abcdacdc
Output : cadb
If the count is same for characters. maintain the original order of
the characters from input string.
Please do let me know for any clarification.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
Find the area with less distance between words. Distance is measured
words count in between two words.
On Dec 30, 4:08 pm, 周翔 csepark...@gmail.com wrote:
Distance is measured on number of words. what is your meaning ? can you
explain it?
2010/12/29 Davin dkthar...@googlemail.com
Given set of words, find an area of the text where these words are as
close to each other as possible.
Distance is measured on number of words.
e.g. for words [rat”, “jat”, “pat”] and text “rat stop the pat blah
blah jat by pat jat tra la la” such area is “cat by mat bat”
--
You received this
Problem Definition : Find minimum time X from set of questions to pass
the exam : Input : Array of Marks [0, n-1] corresponding Array of
Time of Each Questions[0, n-1]. Thanks for help in advance.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
Marks for Questions(1,6): {10,15,20,25,10,20}
Time for Each Questions(1,6) : { 2, 4,3,4, 2,4}
Passing Marks : 40 Out of 100
Find Questions with minimum time to pass the exam?
On Dec 23, 7:04 pm, juver++ avpostni...@gmail.com wrote:
Please clarify the problem statement. Provide example.
From
Thanks for reply. I am looking for O(n) for solution.
Davin
On Dec 23, 8:29 pm, snehal jain learner@gmail.com wrote:
hint : use dp
On Thu, Dec 23, 2010 at 8:30 PM, Davin dkthar...@googlemail.com wrote:
Marks for Questions(1,6): {10,15,20,25,10,20}
Time for Each Questions(1,6
12 matches
Mail list logo