To the Top
File:  root - text - article - 2019 - 10 - daily-problem-longest-substring-without-repating-characters.txt
Tags: 微软, 面试题, 最长子字符串, Microsoft, interview questions, daily problems, longest substring, | English | Home Page | Category: Computing | 312 Views, 20552 Search Bots | 81 Words

Subscribe to Feed Burner | Browse | Archive
This problem was recently asked by Microsoft:

Given a string, find the length of the longest substring without repeating characters.

Here is an example solution in Python language. (Any language is OK to use in an interview, though we'd recommend Python as a generalist language utilized by companies like Google, Facebook, Netflix, Dropbox, Pinterest, Uber, etc.,)


class Solution:
def lengthOfLongestSubstring(self, s):
# Fill this in.

print Solution().lengthOfLongestSubstring('abrkaabcdefghijjxxx')
# 10


Can you find a solution in linear time?
Tags: 微软, 面试题, 最长子字符串, Microsoft, interview questions, daily problems, longest substring, | English | Home Page | Cateogry: Computing | 312 Views, 20552 Search Bots | 81 Words Subscribe to Feed Burner

Related Articles

  1. Daily Interview Problem: Largest BST in a Binary Tree
  2. Algorithm Interview: No Adjacent Repeating Characters
  3. [Daily Problem] Validate Balanced Parentheses
  4. Daily Interview Problem: Reconstrunct Binary Tree from Preorder and Inorder Traversals
  5. Daily Interview Problem: Merge K Sorted Linked Lists
  6. Daily Interview Problem: Largest Product of 3 Elements I
  7. Print a tree level-by-level, with line-breaks
  8. Daily Interview Problem: Validate Binary Search Tree
  9. Daily Interview Problem: Word Ordering in a Different Alphabetical Order
  10. Daily Interview Problem: Longest Substring With K Distinct Characters

Comments (0)

    Be the first one to comment this page !


Page Edited: May 11 2024 14:36:49 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />