摘要:
Given two strings S and T, determine if they are both one edit distance apart.Analysis:Must be exactly one distance apart. Not the same.Solution: 1 pu... 阅读全文
摘要:
The API: int read4(char *buf) reads 4 characters at a time from a file.The return value is the actual number of characters read. For example, it retur... 阅读全文
摘要:
The API: int read4(char *buf) reads 4 characters at a time from a file.The return value is the actual number of characters read. For example, it retur... 阅读全文
摘要:
Given a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s = “eceba”,T is "ece" which... 阅读全文
摘要:
Given a sorted integer array where the range of elements are [lower, upper] inclusive, return its missing ranges. For example, given [0, 1, 3, 50, 75] 阅读全文
摘要:
Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:Only one letter can be ch... 阅读全文
摘要:
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example,Given [100, 4, 200, 1, 3, 2],The longes... 阅读全文
摘要:
Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ... 阅读全文
摘要:
There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following req... 阅读全文
摘要:
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ... 阅读全文