Browse and switch challenges
Longest Common Subsequence

Return one longest common subsequence of two strings; return '' if none.

Important

  • -Any one valid LCS is accepted.
Signature
Constraints
  • -|a|, |b| ≤ 2000
Examples
    System prompt
    0 tokens
    Read-only
    // Waiting for generated code…
    // Your output will appear here as soon as the model returns JavaScript.
    // It must define function lcs(…).
    // Tip: write a prompt on the left and click "Generate code" .
    0 tokens
    Submission #1
    0tokens(0/0)
    Leaderboard
    Loading leaderboard...