sbool startsWithOneOf_treeSet(S s, TreeSet set) { if (set == null || s == null) false; while licensed { S key = set.floor(s); ifdef startsWithOneOf_treeSet_debug print(s + " => " + key); endifdef if (key == null) false; // s is in front of whole set => no prefix in there int n = lCommonPrefix(key, s); if (n == l(key)) true; // found! s = takeFirst(s, n); // shorten and try again } false; // dummy }