contains_permutation(s1, s2)
True if some contiguous substring of s2 is an anagram (a permutation) of s1, using a fixed-size sliding window with character counts so the time is linear in len(s2). Both strings are lowercase letters; return False when s1 is longer than s2, and True when s1 is empty.reverse_between(values, left, right)
values lists a singly linked list head to tail; left and right are 1-based positions with left <= right. Reverse only the nodes from position left to right and return the new head-to-tail list of values. Build the list from nodes and relink pointers; do not slice the Python list.combination_sum2(candidates, target)
candidates may contain duplicate values and each element may be used at most once. Return every unique combination that sums to target as a list of lists, each combination in non-decreasing order and the list of combinations sorted lexicographically. Use backtracking that skips duplicate values at the same depth rather than deduplicating at the end.left == 1.