import java.util.*; public class Solution { public boolean flag = false; public int lowestCommonAncestor (TreeNode root, int p, int q) { // write code here ArrayList<Integer> listP = new ArrayList<>(); ArrayList<Integer> listQ = new ArrayList<>(); dfs(root,listP,p); flag = fa...