登录
|
注册
公司
标签
文章
搜索
查找
热门公司
百度
阿里巴巴
腾讯
迅雷
小米
淘宝
热门职位
研发工程师
C语言工程师
所有
有回答
没回答
新题目
有最佳答案
排序
热度
·
时间
·
经典指数
1
0
1513
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. click to show follow up. Follow up: Did you use extra space? A straight forward solution using O(mn) space is probably a bad idea. A simple improvement uses O(m + n) space, but still not the best solution. Could you devise a constant space solution? ...
阅读题目
查找
面试题
经典指数
1
0
1510
在搜索引擎中,会针对每一网站生成一段摘要,并展示在相应query的搜索结果中。给你两个字符串S和T,请设计并实现一个高效的最短摘要生成算法,该算法能找出S中包含所有T中的字符的最短子字符串,即最短摘要,如: S="ADOBECODEBANC" T="ABC" 最短摘要结果为"BANC" ...
阅读题目
查找
问答题
经典指数
1
0
1500
给定一个字符串,请写一段代码找出这个字符串中首先出现两次的那个字符。 例如字符串为"qywyer23tdd",输出为y。 ...
阅读题目
查找
问答题
经典指数
1
0
1488
求符合指定规则的数。 给定函数 d(n) = n + n 的各位之和,n 为正整数,如 d(78) = 78+7+8=93。 这样这个函数可以看成一个生成器,如 93 可以看成由 78 生成。 定义数 A:数 A 找不到一个数 B 可以由 d(B)=A,即 A 不能由其他数生成。现在要写程序,找出 1 至 10000 里的所有符合数 A 定义的数。 输出: 1 3 … ...
阅读题目
百度
查找
问答题
经典指数
0
0
1481
请设计一个算法,在满足质因数仅为3,5,7或其组合的数中,找出第K大的数。比如K=1,2,3时,分别应返回3,5,7。要求算法时间复杂度最优。 ...
阅读题目
阿里巴巴
查找
问答题
经典指数
1
0
1472
This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. 输入描述: Each input file contains one test case. Each case contains a positive integer N, followed by N lines of student information. Each line contains a student's name, gender, ID and grade, separated by a space, where name and ID are strings of no more than 10 characters with no space, gender is either F (female) or M (male), and grade is an intege ...
阅读题目
查找
排序
面试题
经典指数
1
0
1451
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example: Given the below binary tree andsum = 22, 5 / \ 4 8 / / \ 11 13 4 / \ / \ 7 2 5 1 return [ [5,4,11,2], [5,8,4,5] ] ...
阅读题目
树
查找
面试题
经典指数
1
0
1411
Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a function to determine if a given target is in the array. ...
阅读题目
查找
排序
面试题
经典指数
0
0
1402
Zhejiang University has 40000 students and provides 2500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses. 输入描述: Each input file contains one test case. For each case, the first line contains 2 numbers: N (<=40000), the total number of students, and K (<=2500), the total number of courses. Then N lines follow, each contains a student's name (3 capital English letters plus a one-digit number), a positive nu ...
阅读题目
查找
排序
面试题
经典指数
0
0
1381
给定字符串S,找出其中第一个出现一次的字符,要求时间复杂度O(N)。 ...
阅读题目
字符串
查找
问答题
经典指数
<<
<
15
16
17
18
19
20
>
>>
205
题目数
1
贡献者
181
答案数
扫描后移动端查看
我也分享一个题目
相关标签
数组
排序
百度
复杂度
字符串
研发工程师
树
阿里巴巴
图
哈希
同类标签
树
排序
数组
链表
字符串
复杂度
栈
图
哈希
队列
微信公众号
欢迎加入,一起群聊
×
登录
注册
找回密码
记住登录
登录
快速注册
直接第三方登录