"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
"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
"This is a Design a Product question. For this, we'll want to follow the formula for success:
Ask clarifying questions
Identify user types, behaviors, and pain points
State the goal and use cases
List current solutions
Improvements / net new solutions
Evaluate and select solutions
Measure Success
Summarize
Ask clarifying questions
It's important to get clarity on anything if things are unclear. Since this ask is quite straightforward"
Exponent - "This is a Design a Product question. For this, we'll want to follow the formula for success:
Ask clarifying questions
Identify user types, behaviors, and pain points
State the goal and use cases
List current solutions
Improvements / net new solutions
Evaluate and select solutions
Measure Success
Summarize
Ask clarifying questions
It's important to get clarity on anything if things are unclear. Since this ask is quite straightforward"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
"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
"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