Sunday, May 6, 2018

Leetcode 140: Word Break II (brute force solution)

May 6, 2018

Introduction


It is hard level algorithm called Leetcode 140: Word Break II. I like to go over some ideas through most viewed discuss first. Now it is 9:30 PM, I like to spend 30 minutes to read a few answers.

Now it is 9:39 PM. I decided to go over the blog written in Chinese first, and then make a gist based on the analysis. I like to understand the analysis from the author.

Algorithm practice


Now it is 11:03 PM.  I finally put together C# code using the idea in the above gist. Based on the original author's advice, the solution will time out for a super long string test case. I still need to work on the correct solution to pass all test cases.





No comments:

Post a Comment