"Example:
bucket A: 3 liters capacity
bucket B: 5 liters capacity
goal: 4 liters
You are asked to print the logical sequence to get to the 4 liters of water in one bucket.
Follow up:
How would you solve the problem if you have more than 2 buckets of water?"
B. T. - "Example:
bucket A: 3 liters capacity
bucket B: 5 liters capacity
goal: 4 liters
You are asked to print the logical sequence to get to the 4 liters of water in one bucket.
Follow up:
How would you solve the problem if you have more than 2 buckets of water?"See full answer
"In Java, GC is the process of automatically identifying and reclaming memory occupied by objects that are no longer reachable.. the process involves the 3 steps
Mark phase -- identify the objects that are still in use. i.e reachable
sweep Phase -- removes the unreachable objects
compact phase -- rearragnes objects to prevent fragmentation
4 types of Garbage collection
Serial GC -- single threaded simple and compacting -- best for small applications
Parrallel GC -- throughput GC"
Sue G. - "In Java, GC is the process of automatically identifying and reclaming memory occupied by objects that are no longer reachable.. the process involves the 3 steps
Mark phase -- identify the objects that are still in use. i.e reachable
sweep Phase -- removes the unreachable objects
compact phase -- rearragnes objects to prevent fragmentation
4 types of Garbage collection
Serial GC -- single threaded simple and compacting -- best for small applications
Parrallel GC -- throughput GC"See full answer
"An Object Oriented programming deals with data and members.
An Object Oriented Programming consumes more memory.
An OOPS Consist of bottom-up approach.
An OOPS is more secure Than POP.
POP.
An POP deals with Functions.
An POP is less secure compare to OOPS.
An POP contains less memory.
An POP doesnt contain acess Modifiers."
Arun G. - "An Object Oriented programming deals with data and members.
An Object Oriented Programming consumes more memory.
An OOPS Consist of bottom-up approach.
An OOPS is more secure Than POP.
POP.
An POP deals with Functions.
An POP is less secure compare to OOPS.
An POP contains less memory.
An POP doesnt contain acess Modifiers."See full answer
"
from typing import List
def permute(nums: List[int]) -> List[List[int]]:
pass # your code goes here
res = []
def helper(nums, k):
if k == len(nums):
res.append(list(nums))
return
for i in range(k, len(nums)):
nums[k], nums[i] = nums[i], nums[k]
helper(nums, k + 1)
nums[k], nums[i] = nums[i], nums[k]
helper(nums, 0)
return res
debug your code below
print(permute([1]))
`"
Rick E. - "
from typing import List
def permute(nums: List[int]) -> List[List[int]]:
pass # your code goes here
res = []
def helper(nums, k):
if k == len(nums):
res.append(list(nums))
return
for i in range(k, len(nums)):
nums[k], nums[i] = nums[i], nums[k]
helper(nums, k + 1)
nums[k], nums[i] = nums[i], nums[k]
helper(nums, 0)
return res
debug your code below
print(permute([1]))
`"See full answer