摘要:
GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]... 阅读全文
摘要:
作为安装程序的Setup文件是软件的开发者专门为其软件设计的.exe文件,是当前最为盛行的安装程序。在运行该Setup文件进行软件安装时,Setup除了进行复制、改名、解压和目录维护等基本安装工作外,还要对系统进行必要的配置,通常是修改config.sys、autoexec.bat和注册表等文件,以 阅读全文
摘要:
Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion10.01代码如下:class Solution { public: int compareVersion(strin... 阅读全文
摘要:
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
摘要:
Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文
摘要:
Design a stack that supports push, pop, top, and retrieving(检索) the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Rem... 阅读全文
摘要:
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: a... 阅读全文
摘要:
Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.分析:题意即为 阶乘尾部的零(求n!中尾部为0的个数)思路... 阅读全文
摘要:
Rotate an array ofnelements to the right byksteps.For example, withn= 7 andk= 3, the array[1,2,3,4,5,6,7]is rotated to[5,6,7,1,2,3,4].Note:Try to come... 阅读全文
摘要:
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ... 阅读全文