"[2:53 pm, 02/12/2021] Mayank: Before we deep dive into brainstorming the solution I go ahead and make few assumptions for clarifying questions:
Step-1- Framing a problem
🎯Why users go to gym?
To relieve stress by doing exercise
To maintain their body
To reduce their weight
To remain active
To make good physique
🎯Who goes to gym?
Couples
Group of friends
Individuals
Here we are trying to design high tech gym so it means we are looking to create good experience-and"
Mayank S. - "[2:53 pm, 02/12/2021] Mayank: Before we deep dive into brainstorming the solution I go ahead and make few assumptions for clarifying questions:
Step-1- Framing a problem
🎯Why users go to gym?
To relieve stress by doing exercise
To maintain their body
To reduce their weight
To remain active
To make good physique
🎯Who goes to gym?
Couples
Group of friends
Individuals
Here we are trying to design high tech gym so it means we are looking to create good experience-and"See full answer
"\# Definition for a binary tree node.
class TreeNode:
def init(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def maxPathSum(self, root: TreeNode) -> int:
self.max_sum = float('-inf')"
Jerry O. - "\# Definition for a binary tree node.
class TreeNode:
def init(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def maxPathSum(self, root: TreeNode) -> int:
self.max_sum = float('-inf')"See full answer
"Java
import java.util.*;
public class Solution {
public static int[] productExceptSelf(int[] nums) {
int n = nums.length;
int[] result = new int[n];
// Step 1: Calculate left products
result[0] = 1;
for (int i = 1; i = 0; i--) {
resul"
Vignesh g 2. - "Java
import java.util.*;
public class Solution {
public static int[] productExceptSelf(int[] nums) {
int n = nums.length;
int[] result = new int[n];
// Step 1: Calculate left products
result[0] = 1;
for (int i = 1; i = 0; i--) {
resul"See full answer
Data Engineer
Data Structures & Algorithms
+3 more
🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.
"function findPrimes(n) {
if (n < 2) return [];
const primes = [];
for (let i=2; i <= n; i++) {
const half = Math.floor(i/2);
let isPrime = true;
for (let prime of primes) {
if (i % prime === 0) {
isPrime = false;
break;
}
}
if (isPrime) {
primes.push(i);
}
}
return primes;
}
`"
Tiago R. - "function findPrimes(n) {
if (n < 2) return [];
const primes = [];
for (let i=2; i <= n; i++) {
const half = Math.floor(i/2);
let isPrime = true;
for (let prime of primes) {
if (i % prime === 0) {
isPrime = false;
break;
}
}
if (isPrime) {
primes.push(i);
}
}
return primes;
}
`"See full answer
"
from typing import List
def getnumberof_islands(binaryMatrix: List[List[int]]) -> int:
if not binaryMatrix: return 0
rows = len(binaryMatrix)
cols = len(binaryMatrix[0])
islands = 0
for r in range(rows):
for c in range(cols):
if binaryMatrixr == 1:
islands += 1
dfs(binaryMatrix, r, c)
return islands
def dfs(grid, r, c):
if (
r = len(grid)
"
Rick E. - "
from typing import List
def getnumberof_islands(binaryMatrix: List[List[int]]) -> int:
if not binaryMatrix: return 0
rows = len(binaryMatrix)
cols = len(binaryMatrix[0])
islands = 0
for r in range(rows):
for c in range(cols):
if binaryMatrixr == 1:
islands += 1
dfs(binaryMatrix, r, c)
return islands
def dfs(grid, r, c):
if (
r = len(grid)
"See full answer
"
import java.util.*;
class Solution {
// Time Complexity: O(n^2)
// Space Complexity: O(n)
public static List> threeSum(int[] nums) {
// Ensure that the array is sorted first
Arrays.sort(nums);
// Create the results list to return
List> results = new ArrayList();
// Iterate over the length of nums
for (int i = 0; i < nums.length-2; i++) {
// We will have the first number in"
Victor O. - "
import java.util.*;
class Solution {
// Time Complexity: O(n^2)
// Space Complexity: O(n)
public static List> threeSum(int[] nums) {
// Ensure that the array is sorted first
Arrays.sort(nums);
// Create the results list to return
List> results = new ArrayList();
// Iterate over the length of nums
for (int i = 0; i < nums.length-2; i++) {
// We will have the first number in"See full answer
"const ops = {
'+': (a, b) => a+b,
'-': (a, b) => a-b,
'/': (a, b) => a/b,
'': (a, b) => ab,
};
function calc(expr) {
// Search for + or -
for (let i=expr.length-1; i >= 0; i--) {
const char = expr.charAt(i);
if (['+', '-'].includes(char)) {
return opschar), calc(expr.slice(i+1)));
}
}
// Search for / or *
for (let i=expr.length-1; i >= 0; i--) {
const char = expr.charAt(i);
if"
Tiago R. - "const ops = {
'+': (a, b) => a+b,
'-': (a, b) => a-b,
'/': (a, b) => a/b,
'': (a, b) => ab,
};
function calc(expr) {
// Search for + or -
for (let i=expr.length-1; i >= 0; i--) {
const char = expr.charAt(i);
if (['+', '-'].includes(char)) {
return opschar), calc(expr.slice(i+1)));
}
}
// Search for / or *
for (let i=expr.length-1; i >= 0; i--) {
const char = expr.charAt(i);
if"See full answer
"Hadoop is better than PySpark when you are dealing with extremely large scale, batch oriented, non-iterative workloads where in-memory computing isn't feasible/ necessary, like log storage or ETL workflows that don't require high response times. It's also better in situations where the Hadoop ecosystem is already deeply embedded and where there is a need for resource conscious, fault tolerant computation without the overhead of Spark's memory constraints. In these such scenarios, Hadoop's disk-b"
Joshua R. - "Hadoop is better than PySpark when you are dealing with extremely large scale, batch oriented, non-iterative workloads where in-memory computing isn't feasible/ necessary, like log storage or ETL workflows that don't require high response times. It's also better in situations where the Hadoop ecosystem is already deeply embedded and where there is a need for resource conscious, fault tolerant computation without the overhead of Spark's memory constraints. In these such scenarios, Hadoop's disk-b"See full answer