摘要:
Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime complexi 阅读全文
摘要:
作用:声明外部变量。使变量或对象可以被跨文件访问 c++语言支持分离式编译机制,该机制允许将程序分割为若干个文件,每个文件可被独立编译。 因此在编译期间,各个文件中定义的全局变量互相不透明,也就是说,在编译时,全局变量的可见域限制在文件内部。 对于A.cpp和B.cpp中,分别含有同名全局变量i,两 阅读全文
摘要:
Given two sentences words1, words2 (each represented as an array of strings), and a list of similar word pairs pairs, determine if two sentences are s 阅读全文
摘要:
An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535). Given a coordinate (sr, 阅读全文
摘要:
Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they 阅读全文
摘要:
Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: A: a1 → a2 阅读全文
摘要:
Implement a MyCalendarTwo class to store your events. A new event can be added if adding the event will not cause a triple booking. Your class will ha 阅读全文
摘要:
Implement a MyCalendar class to store your events. A new event can be added if adding the event will not cause a double booking. Your class will have 阅读全文
摘要:
A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 阅读全文
摘要:
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: 求一个数组的范围和,可以使用动态规划来计算。 dp[x]数组表示原 阅读全文