Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя ybc_c

Автор ybc_c, 10 лет назад, По-английски

Hi All :-)

I think some of you may read this problem from hackerrank. Here is the link:

https://www.hackerrank.com/challenges/dynamic-programming-classics-the-longest-common-subsequence

Since the test data is so weak, the traditional O(mn) solution can pass all the test data. So let's assume the two strings can be as long as 10^5. In this case, how to solve this problem? I guess the time complexity of the solution should be O(500*10^5) but have no idea to code it ... :-(

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится