"function isPalindrome(s, start, end) {
while (s[start] === s[end] && end >= start) {
start++;
end--;
}
return end <= start;
}
function longestPalindromicSubstring(s) {
let longestPalindrome = '';
for (let i=0; i < s.length; i++) {
let j = s.length-1;
while (s[i] !== s[j] && i <= j) {
j--;
}
if (s[i] === s[j]) {
if (isPalindrome(s, i, j)) {
const validPalindrome = s.substring(i, j+1"
Tiago R. - "function isPalindrome(s, start, end) {
while (s[start] === s[end] && end >= start) {
start++;
end--;
}
return end <= start;
}
function longestPalindromicSubstring(s) {
let longestPalindrome = '';
for (let i=0; i < s.length; i++) {
let j = s.length-1;
while (s[i] !== s[j] && i <= j) {
j--;
}
if (s[i] === s[j]) {
if (isPalindrome(s, i, j)) {
const validPalindrome = s.substring(i, j+1"See full answer
"You should be able to easily identify this as a Measure Success question. These kinds of questions are used to test your analytical skills, as well as your ability to track project progress post-launch.
Recall the strategy for tackling them methodically and thoroughly:
Ask clarifying questions
State the goal of the feature / product
Behavior Mapping / UX Flow Mapping
Provide criteria to prioritize metrics
Prioritize metrics
Summarize
Let's begin!
"
Exponent - "You should be able to easily identify this as a Measure Success question. These kinds of questions are used to test your analytical skills, as well as your ability to track project progress post-launch.
Recall the strategy for tackling them methodically and thoroughly:
Ask clarifying questions
State the goal of the feature / product
Behavior Mapping / UX Flow Mapping
Provide criteria to prioritize metrics
Prioritize metrics
Summarize
Let's begin!
"See full answer
"This is a Strategy Question, which asks you to justify high-level business decisions and strategy. Since this is asking to look at the geopolitical climate, it's important to dig deeper on understanding how things have a cause-effect relationship.
Let's go over one possible solution:
> The trade war affects Apple in many ways, but I think the three biggest are:Higher tariffs
> Slower new hardware growth
> Lower domestic sales
>
Higher tariffs
> The trade war immediately impacts our botto"
Exponent - "This is a Strategy Question, which asks you to justify high-level business decisions and strategy. Since this is asking to look at the geopolitical climate, it's important to dig deeper on understanding how things have a cause-effect relationship.
Let's go over one possible solution:
> The trade war affects Apple in many ways, but I think the three biggest are:Higher tariffs
> Slower new hardware growth
> Lower domestic sales
>
Higher tariffs
> The trade war immediately impacts our botto"See full answer
Product Manager
Product Strategy
🧠Want an expert answer to a question? Saving questions lets us know what content to make next.
"Make current as root.
2 while current is not null,
if p and q are less than current,
go left.
If p and q are greater than current,
go right.
else return current.
return null"
Vaibhav D. - "Make current as root.
2 while current is not null,
if p and q are less than current,
go left.
If p and q are greater than current,
go right.
else return current.
return null"See full answer
"Leetcode 347: Heap + Hashtable
Follow up question: create heap with the length of K instead of N (more time complexity but less space )"
Chen J. - "Leetcode 347: Heap + Hashtable
Follow up question: create heap with the length of K instead of N (more time complexity but less space )"See full answer
"filter function usually exists in some high level programming that adopt FP paradigm.
It taks a sequence of items and a predicate function, and returns (conceptually) a subset of the items that satisfy the predicate.
Adopt this kind of operation (filter, map, reduce, take, pairwise ...) can help writting
cleaner code, and reduce the usage of mutable part in the program, lower the
possibility of making human mistake.
Take Python for example (although const-ness is not exists in Python),
assu"
Weida H. - "filter function usually exists in some high level programming that adopt FP paradigm.
It taks a sequence of items and a predicate function, and returns (conceptually) a subset of the items that satisfy the predicate.
Adopt this kind of operation (filter, map, reduce, take, pairwise ...) can help writting
cleaner code, and reduce the usage of mutable part in the program, lower the
possibility of making human mistake.
Take Python for example (although const-ness is not exists in Python),
assu"See full answer
"You should be able to identify this as a Measure Success question. These kinds of questions are used to test your analytical skills, as well as your ability to track project progress post-launch.
Recall the strategy for tackling them methodically and thoroughly:
Ask clarifying questions
State the goal of the feature / product
Behavior Mapping / UX Flow Mapping
Provide criteria to prioritize metrics
Prioritize metrics
Summarize
Let's begin!
Ask cl"
Exponent - "You should be able to identify this as a Measure Success question. These kinds of questions are used to test your analytical skills, as well as your ability to track project progress post-launch.
Recall the strategy for tackling them methodically and thoroughly:
Ask clarifying questions
State the goal of the feature / product
Behavior Mapping / UX Flow Mapping
Provide criteria to prioritize metrics
Prioritize metrics
Summarize
Let's begin!
Ask cl"See full answer