private static String vectorToStr(Vector<String> v, int lo, int hi) {
    if (lo < 0 || hi > v.size()) return "";
    String res = "[ ";
    for (int i = lo; i < hi; i++) res += v.get(i) + " ";
    return res + "]";
  }