Given a dice with n sides, you have to find the expected number of times you have to throw that dice to see all its faces at least once. Assume that t ...
分类:
其他好文 时间:
2019-08-28 00:58:33
阅读次数:
82
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex ...
分类:
其他好文 时间:
2019-08-27 19:34:02
阅读次数:
112
Leetcode 5. Longest Palindromic Substring(最长回文子串, Manacher算法) Given a string s, find the longest palindromic substring in s. You may assume that the m ...
分类:
编程语言 时间:
2019-08-26 21:17:29
阅读次数:
121
Mysterious Bacteria LightOJ - 1220 https://vjudge.net/problem/LightOJ-1220 "Each case starts with a line containing an integer x. You can assume that ...
分类:
其他好文 时间:
2019-08-26 21:05:18
阅读次数:
69
Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Example 2: Note:You may assume the string contains only ...
分类:
其他好文 时间:
2019-08-24 09:59:55
阅读次数:
90
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Example 2: ...
分类:
其他好文 时间:
2019-08-22 23:56:36
阅读次数:
174
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only ...
分类:
其他好文 时间:
2019-08-20 01:06:24
阅读次数:
81
Implement a trie with insert, search, and startsWith methods. Example: Note: You may assume that all inputs are consist of lowercase letters a-z. All ...
分类:
其他好文 时间:
2019-08-10 09:32:47
阅读次数:
67
Git 忽略已跟踪文件的改动 git update-index --assume-unchanged Git之本地忽略 这个分两种情况: 本地永久忽略,效果的gitignore一样,只不过不适于写到gitignore中而已,可以自己建立一个本地独享的gitignore,然后git config -- ...
分类:
其他好文 时间:
2019-08-02 20:56:43
阅读次数:
100
Given a text file file.txt, print just the 10th line of the file. Example: Assume that file.txt has the following content: Your script should output t ...
分类:
其他好文 时间:
2019-07-07 12:28:16
阅读次数:
87