The_Samurai's blog

By The_Samurai, 6 weeks ago, translation, In English

Hello everyone. Recently I saw an interesting problem and could not solve it. I think you can help :)

Given a string $$$ s $$$. In one operation, you can delete a character or swap adjacent characters. Find minimum number of operations to make a string palindrome.

$$$1 \leq |s| \leq 10^6$$$

 
 
 
 
  • Vote: I like it
  • +16
  • Vote: I do not like it

»
6 weeks ago, # |
  Vote: I like it +6 Vote: I do not like it

Swapping characters must be adjacent or any?