Source
seen from United States

seen from United States

seen from Netherlands

seen from Canada
seen from Uruguay

seen from Russia
seen from Australia

seen from United States

seen from Finland
seen from China
seen from Canada

seen from United States
seen from United States
seen from United States

seen from United States
seen from Brazil

seen from Russia
seen from Australia

seen from Australia

seen from Italy
Source
Day 30: Word Search II
Given a 2D board and a list of words from the dictionary, find all words in the board.
Each word must be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once in a word. Link
(Note that this means that words can bend, which is not at all how real word searches work)
The hints here are really good! You have to iterate through every cell on the board, and then you have to decide whether to do a depth-first or breadth first search, so naive computational complexity looks bad. But you can decide whether to backtrack in O(len(current_candidate_string)), if you “trie” hard enough.
For a problem with this many moving parts, I’d normally be worried about performance, but my first full solution was accepted immediately. A nice end to the month! (I’m writing this on July 2 because I’m slow)
I enjoyed writing these, so I might continue along similar lines in the future. I’m definitely not doing the July LeetCode Challenge; I’m reclaiming my spare time.
Building an autocomplete system using Trie
Building an autocomplete system using Trie
Introduction
Few days back I wrote a post about the Trie data structure. This post is a continuation to it, and intends to introduce some practical problems which Trie solves. An autocomplete system is a perfect use case.
Many of the websites use this feature to help there users with suggestions & autocomplete. Also, in this post we will define a Trie interface and then work through this problem…
View On WordPress