Skip to content

Subsequence

Sar Champagne Bielert edited this page Apr 6, 2024 · 9 revisions

Unit 2 Session A

U-nderstand

Understand what the interviewer is asking for by using test cases and questions about the problem.

  • Will either list ever be empty?
    • Potentially, yes. Your code should allow for this.

P-lan

Plan the solution with appropriate visualizations and pseudocode.

General Idea: TODO

1) TODO

⚠️ Common Mistakes

I-mplement

def is_subsequence(array, sequence):
    seq_idx = 0
    for num in array:
        if seq_idx == len(sequence):
            return True
        if sequence[seq_idx] == num:
            seq_idx += 1
    return False
Clone this wiki locally