Post, Code and Quiet Time.
  • Home
Sign in Subscribe

Trie,

A collection of 4 posts
Trie,

Word Break III

Question http://www.lintcode.com/en/problem/word-break-iii/ Give a dictionary of words and a sentence with all whitespace removed, return the number of sentences you can form by inserting whitespaces to the sentence so that each word can be found in the dictionary. Example Given a String CatMat Given
Nov 28, 2017 1 min read
Trie,

Word Break II

Question Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences. Example Gieve s = lintcode, dict = ["de", "ding", "co", "code", "lint"]. A solution is ["lint code", "lint co de"
Nov 28, 2017 1 min read
Trie,

Word Break

Question http://www.lintcode.com/en/problem/word-break/ Given a string s and a dictionary of words dict, determine if s can be break into a space-separated sequence of one or more dictionary words. Example Given s = "lintcode", dict = ["lint", "code"]. Return true because "lintcode" can be break as "lint
Nov 28, 2017 1 min read
Trie,

Maximum Subarray VI

Question Given an array of integers. find the maximum XOR subarray value in given array. What's the XOR: https://en.wikipedia.org/wiki/Exclusive_or Notice Expected time complexity O(n). Answer https://threads-iiith.quora.com/Tutorial-on-Trie-and-example-problems Let's say F(L,R) is XOR of subarray from L to R.
Nov 22, 2017 1 min read
Page 1 of 1
Post, Code and Quiet Time. © 2023
Powered by Ghost