static int lastIndexOf(S a, S b) {
ret a == null || b == null ? -1 : a.lastIndexOf(b);
}
static int lastIndexOf(S a, char b) {
ret a == null ? -1 : a.lastIndexOf(b);
}
// starts searching from i-1
static int lastIndexOf(L l, int i, A a) {
if (l == null) ret -1;
for (i = min(l(l), i)-1; i >= 0; i--)
if (eq(l.get(i), a))
ret i;
ret -1;
}
static int lastIndexOf(L l, A a) {
if (l == null) ret -1;
for (int i = l(l)-1; i >= 0; i--)
if (eq(l.get(i), a))
ret i;
ret -1;
}