摘要:
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 阅读全文
摘要:
Given two 1d vectors, implement an iterator to return their elements alternately. For example, given two 1d vectors: By calling next repeatedly until 阅读全文
摘要:
Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3].... Example 1: Example 2: Note:You may assume all input has v 阅读全文
摘要:
Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... For example, given nums = [3, 5, 2, 1, 6, 4], 阅读全文
摘要:
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating 阅读全文
摘要:
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to 阅读全文
摘要:
Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutati 阅读全文
摘要:
Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the 阅读全文
摘要:
Design a Phone Directory which supports the following operations: Example: 设计一个电话目录有3个功能,get: 给出一个没有使用的电话号码,check: 查验一个电话号码是否被使用了,release: 释放一个电话号码,使其 阅读全文
摘要:
On a horizontal number line, we have gas stations at positions stations[0], stations[1], ..., stations[N-1], where N = stations.length. Now, we add K 阅读全文