
Solve the following coding tasks.
You are given two integer arrays A and B, each sorted in non-decreasing order.
A
has length
m + n
, where the first
m
elements are valid, and the last
n
elements are extra space.
B
has length
n
.
Task: Modify A in-place so that it becomes a single sorted array containing all m + n elements.
Constraints (typical): 0 ≤ m, n ≤ 2e5, values fit in 32-bit signed int.
Given the root of a binary tree, return the list of node values visible when looking at the tree from the right side (i.e., the last node encountered at each depth when scanning left-to-right).
Task: Output the values from top to bottom.
Constraints (typical): up to 2e5 nodes.
You are given a 2D grid representing a maze:
'.'
= empty cell,
'#'
= wall
'S'
= start,
'E'
= end
Tasks:
A. Determine whether a path exists from S to E.
B. If a path exists, return the length of the shortest path (number of moves).
C. Optionally, return one shortest path as a string over {U,D,L,R}.
Constraints (typical): grid size up to 2000 x 2000 (so algorithms should be near-linear in number of cells).