Panda Guru LogoPanda
Guru

Amazon Online Assessment Question

Round 1

Questions: Given a string, split it into two substrings and check whether both substrings can be palindromes by removing at most one character.

What can be a better approach to do this in O(n)?

Link to Leetcode discussion


Candidate's Approach
  • Tried solving by running a loop to create two substrings and checking if both can be palindromes.
  • The solution had a time complexity of O(n^2), which resulted in a few test cases timing out (TLE).
  • The approach involved creating two substrings for each index and then checking if both substrings could be palindromes.
Interviewer's Feedback

No feedback provided.


Additional Questions