Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2370. Longest Ideal Subsequence
Given a string s and integer k, find the longest subsequence where the absolute difference between every two adjacent letters' positions in the alphabet is ≤ k — essentially a variant of longest subsequence solved by dynamic programming over the 26 letters, maintaining for each letter the best length of an ideal subsequence ending there and updating from letters within ±k.
Asked at:
Microsoft
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late January, 2025
Microsoft
Intern
Longest ideal subsequence
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.