is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
This can be done in time complexity O(n) and space cpmplexity O(n).
- sanchay101 March 03, 2016Data structure trie (or trie like). Each node will have children and can have recursive path to some of the parents. A character will come only once in this trie. Also store a hashmap of the character key and the node as value. Parse the input string once to create trie structure and populate this hashmap. If a path already exists in this trie like structure add 1 to the count. Assuming each path is initialized with 1 value of the count.
For every substring to be checked, check if path exists and if it does, take the minimum value.
If all the possible substrings of a particular length are to be found, traverse this trie and find substrings with that length