摘要:
Given an index k, return the kth row of the Pascal's triangle. 阅读全文
摘要:
Given numRows, generate the first numRows of Pascal's triangle. 阅读全文
摘要:
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. 阅读全文
摘要:
Implement an method to compress the string according to the number of occurrences of each char in the string. For example, "aabcccaa" is compressed as "a2b1c3a2". If the string after the compression is not shorter, return the original string. 阅读全文
摘要:
Write a method to replace all spaces in a string with ‘%20’. 阅读全文
摘要:
Write a method to decide if two strings are anagrams or not. 阅读全文
摘要:
Write code to reverse a C-Style String. (C-String means that “abcd” is represented as five characters, including the null character.) 阅读全文
摘要:
Implement an algorithm to determine if a string has all unique characters. What if you can not use additional data structures? 阅读全文
摘要:
Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig... 阅读全文
摘要:
Given a binary tree, flatten it to a linked list in-place. 阅读全文