当前搜索:
题目Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum ...
在经典系统,可以在重新启动时按Shift键,将第三方的功能扩展关闭,使机子能完成启动,之后再设法修复磁盘错误或功能扩展冲突的问题。重新启动,当所有功能扩展的上载完成后,立即按下Option+Command键,直到出现重建桌面文件的窗口,点击OK,可以重建桌面文件,修复因桌面文件出错引起的问题。即使...
题目Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters...
题目Given a binary tree, flatten it to a linked list in-place.For example,Given 1
/ \
2 5
/ \ \
3 4 6
The fla...
题目Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bi...
K-Means介绍 K-means算法是聚类分析中使用最广泛的算法之一。它把n个对象根据他们的属性分为k个聚类以便使得所获得的聚类满足:同一聚类中的对象相似度较高;而不同聚类中的对象相似度较小。其聚类过程可以用下图表示: 如图所示,数据样本用圆点表示,每个簇的中心点用叉叉...
题目Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].No...
题目Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that t...
题目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: ...
题目Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[
[1],
[1,1],
[1,2,1],
[1,3,3,1],...
博主是goagent忠实用户,但是在mac下每次启动goagent都要cd到proxy的目录下,然后再执行proxy.py文件,非常麻烦,所以博主想到能否自己定义一个shell命令,一健启动goagent,其实也很简单,过程如下。(1)我们在user目录下输入,"-a"是现实隐...
题目Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum...
题目Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest...
题目 Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binar...
题目1.same treeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurall...
题目Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1-&...
题目Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or eq...
题目 爬楼梯问题,这是一道很有趣的问题。首先看题目:You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. I...
题目Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".代码public cl...
题目Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last wo...