You will solve the following coding tasks (independent of each other). Provide clear input/output behavior and handle edge cases.
Given a string s, find:
Return (max_len, substring).
Clarifications / edge cases to handle:
s
can be empty.
Given an array of strings strs, group the strings into lists where each list contains strings that are anagrams of each other.
Return the groups in any order.
Follow-up:
You are on an infinite 2D grid starting at (0, 0). You receive a command string cmd consisting of characters representing moves:
U
/
u
: move up
(x, y+1)
D
/
d
: move down
(x, y-1)
L
/
l
: move left
(x-1, y)
R
/
r
: move right
(x+1, y)
Process the string in order and return the final coordinate (x, y).
Clarifications: