Amazon Interview Question — LeetCode 1143

Y Tech
2 min readMar 3, 2022

In this post, we are going to discuss leetcode 1143 — Longest Common Subsequence, which is recently asked in Amazon interviews.

Problem Analysis

Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0.

A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

--

--