This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
有一种细胞,经过一分钟分裂为2个,再过一分钟,分裂为4个, | |
这样,将一个细胞放在一个瓶子里面,一个小时后瓶子被细胞充满了。 | |
现在假设一开始放入瓶中的为两个细胞,那么到充满瓶子要多长的时间? | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n个数字(0,1,...,n-1)形成一个圆圈,从数字0开始, | |
每次从这个圆圈中删除第m个数字(第一个为当前数字本身,第二个为当前数字的下一个数字), | |
当一个数字删除后,从被删除数字的下一个继续删除第m个数字, | |
求出这个圆圈中剩下的最后一个数字 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
输入两个整数n和m,从数列1,2,3......n中随意取几个数, | |
使其和等于m,输出其中所有的可能组合。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
验证邮箱合法性。规则如下,欢迎补充。 | |
1 必须为英文,不能是中文,必须为英文开始(以数字开头规则在六条),且用户名长度为6-25,即为@前长度 | |
2 包含@, .两个字符,@在点之前,@不能是首尾 | |
3 包含常用域名,如 163, 126,qq,Gmail,outlook | |
4 以.com, .org, .cn, .me 等结尾 | |
5 首尾,中间不能有空格 | |
6 如果名字以数字开头,则必为11位,且全为数字,即为常见手机号码的邮箱,如:13,15,开头的[email protected] | |
PS: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
输入任意数字,求该数二进制表达中有多少个1。 | |
例如:输入10,由于其二进制表示为1010,有两个1,因此输出2 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
判断这个字符串是否是合法的ip地址 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
一个字符串,找出这个字符串的第一对重复的字符 | |
如 abcdefgjikuoa 第一对重复的字符是’a’ | |
如 abcdegfeter 第一对重复的字符 ‘e’ | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
查找字符串中出现最多的字符和个数。 | |
如: addfbsdfaf,字母d出现的次数最多,且为4次。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
请写一个字符串转成驼峰的方法? | |
如:font-size -> fontSize, background-color -> backgroundColor. | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
数组中有一个数字出现的次数超过了数组长度的一半,找出这个数字。 | |
如:[2,2],2出现2次,数组长度的一半为1。 | |
[3,5,5,7],5出现2次,数组长度的一半为2,则为5。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` |