"static int findLongestRepeatingSubSeq(String str)
{
int n = str.length();
int dp = new intn+1;
for (int i=0; i<=n; i++)
for (int j=0; j<=n; j++)
dpi = 0;
for (int i=1; i<=n; i++)
{
for (int j=1; j<=n; j++)
{
if (str.charAt(i-1)== str.charAt(j-1) && i != j)
dpi = 1 + dpi-1;
else
dpi = Math.max(dpi, dpi-1);
}
}
`return"
Padmanaban M. - "static int findLongestRepeatingSubSeq(String str)
{
int n = str.length();
int dp = new intn+1;
for (int i=0; i<=n; i++)
for (int j=0; j<=n; j++)
dpi = 0;
for (int i=1; i<=n; i++)
{
for (int j=1; j<=n; j++)
{
if (str.charAt(i-1)== str.charAt(j-1) && i != j)
dpi = 1 + dpi-1;
else
dpi = Math.max(dpi, dpi-1);
}
}
`return"See full answer
"The idea of prefix sum can be applied here to find a product prefix array and a product suffix array.
Create a prefix product array by calculating the cumulative product of all elements which appear before that particular element in the array.
Similarly, create a suffix array for all elements which appear later than particular element in the array.
Now, replace each element with the product of prefix and suffix products of adjacent elements. This will give you the answer."
Somdip S. - "The idea of prefix sum can be applied here to find a product prefix array and a product suffix array.
Create a prefix product array by calculating the cumulative product of all elements which appear before that particular element in the array.
Similarly, create a suffix array for all elements which appear later than particular element in the array.
Now, replace each element with the product of prefix and suffix products of adjacent elements. This will give you the answer."See full answer
"Before we begin, it's important to understand what the interviewer is testing with this type of question. This is a Strategy Question that tests an interviewee's ability to create compelling arguments from high level information, discern motive, and think strategically. We can split this question into two parts: Why is Amazon buying retailers and why is Amazon keeping them independent?
Why is Amazon buying retailers?
> To start, let's go over some recent examples of Amazon buying retail c"
Exponent - "Before we begin, it's important to understand what the interviewer is testing with this type of question. This is a Strategy Question that tests an interviewee's ability to create compelling arguments from high level information, discern motive, and think strategically. We can split this question into two parts: Why is Amazon buying retailers and why is Amazon keeping them independent?
Why is Amazon buying retailers?
> To start, let's go over some recent examples of Amazon buying retail c"See full answer
"Sir Assalamu Alaikum. How are you? I am from this company. Our water is the best. Your store is running out of water. Our drinking is the most profitable. Ours is superior to all other waters."
Jx J. - "Sir Assalamu Alaikum. How are you? I am from this company. Our water is the best. Your store is running out of water. Our drinking is the most profitable. Ours is superior to all other waters."See full answer