上一页 1 2 3 4 5 6 7 ··· 64 下一页
摘要: 请实现一个函数用来找出字符流中第一个只出现一次的字符。例如,当从字符流中只读出前两个字符 "go" 时,第一个只出现一次的字符是 "g"。当从该字符流中读出前六个字符“google" 时,第一个只出现一次的字符是 "l"。 C++: 阅读全文
posted @ 2019-03-27 17:16 __Meng 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 把 n 个骰子仍在地上,求点数和为 s 的概率。 java: 阅读全文
posted @ 2019-03-27 16:29 __Meng 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 五张牌,其中大小鬼代表任意数字,牌面大小为 0。判断这五张牌是否能组成顺子。 C++: 阅读全文
posted @ 2019-03-27 15:52 __Meng 阅读(492) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You may not modify the values in the list's nodes, only nodes its 阅读全文
posted @ 2019-03-27 11:22 __Meng 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 让小朋友们围成一个大圈。然后,随机指定一个数 m,让编号为 0 的小朋友开始报数。每次喊到 m-1 的那个小朋友要出列唱首歌,然后可以在礼品箱中任意的挑选礼物,并且不再回到圈中,从他的下一个小朋友开始,继续 0...m-1 报数 .... 这样下去 .... 直到剩下最后一个小朋友,可以不用表演。 阅读全文
posted @ 2019-03-26 19:51 __Meng 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 求1+2+3+...+n,要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句(A?B:C)。 阅读全文
posted @ 2019-03-26 16:13 __Meng 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 写一个函数,求两个整数之和,要求在函数体内不得使用+、-、*、/四则运算符号。 C++: 阅读全文
posted @ 2019-03-26 15:57 __Meng 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 给定一个数组 A[0, 1,..., n-1],请构建一个数组 B[0, 1,..., n-1],其中 B 中的元素 B[i]=A[0]*A[1]*...*A[i-1]*A[i+1]*...*A[n-1]。要求不能使用除法。 阅读全文
posted @ 2019-03-26 15:29 __Meng 阅读(211) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example 阅读全文
posted @ 2019-03-26 11:25 __Meng 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 将一个字符串转换成一个整数,字符串不是一个合法的数值则返回 0,要求不能使用字符串转换整数的库函数。 Iuput: +2147483647 1a33 Output: 2147483647 0 C++: 阅读全文
posted @ 2019-03-26 10:53 __Meng 阅读(196) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 64 下一页