Word Ladder – Python 3 (Week 14 – 03)

Solution 1 分层 Time O(n*l + l^2). Space O(n*l). n is total number of words. l is the max length of word. Solution 2 不分层 Time O(n*l + l^2). Space O(n*l). n is total number of words. l is the max length of word. Solution 3 Bidirectional Breadth First Search Time O(n*l + l^2). Space …

Design a site like this with WordPress.com
Get started