← Goldman Sachs questions

Maximum palindromic number with at most k changes

Filed under Goldman Sachs

Given a number as a string and an integer k, output the maximum palindromic number that can be formed using at most k digit replacements, or return -1 if impossible.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Goldman Sachs questions

Collected from public candidate posts and coding forums. Updated Nov 2026.