List<int> sliceFromEnd(List<int> list, int idx) { return list.sublist(0, list.length - 1).sublist(idx); }