InterviewDB Question

Ways to Make Palindrome: Count Minimum Insertions to Make a String a Palindrome

Question Details

Problem Given a string s, find the minimum number of characters to insert (at any positions) to make s a palindrome. Also return the count of distinct palindromes that can be formed with exactly that many insertions. Follow-ups The minimum insertions equal n - LPS(s) where LPS is the Longest Palindromic Subsequence length. Prove this. How do you count distinct palindromes? Walk through your approach, handling duplicate characters carefully. What is the time and space complexity of the LPS DP? Ca…

Full Details

🔒

Unlock all Hudson River Trading questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a reported interview question from a hudson river trading interview during the oa round.

It covers the following topics: Dynamic Programming, Coding, Oa, Strings .