Given a sorted array, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra space fo ...
                            
                            
                                分类:
其他好文   时间:
2017-11-08 00:53:57   
                                阅读次数:
147
                             
                    
                        
                            
                            
                                1、再次注意;如果某行是以冒号结尾,则意味着接下来的内容是一个新的代码块,是要被缩进的。(在把while加入def的时候,def下一个缩进,while中又多一个缩进) 2、while循环有可能会出现永不结束的状态。 3、为了避免出现2中的问题,需要遵循以下规定: 尽量少用while,大部分时候用fo ...
                            
                            
                                分类:
其他好文   时间:
2017-11-07 20:59:01   
                                阅读次数:
149
                             
                    
                        
                            
                            
                                name=[ 'coco', 'liux', 'zhangyq', 'liufupengdozhao']# 使用rang()方法for i in range(0,len(name)): print(i,name[i])# 上面的方法有些累赘,使用内置enumerrate函数会有更加直接,优美的做fo... ...
                            
                            
                                分类:
编程语言   时间:
2017-11-07 00:14:30   
                                阅读次数:
225
                             
                    
                        
                            
                            
                                对应于每一个输入,请输出相应层数的杨辉三角,每一层的整数之间用一个空格隔开,每一个杨辉三角后面加一个空行。 #inlude <stdio.h>#define N 100int main(){ int n,i,j,a[N][N]; a[0][0]=1; a[1][0]=1; a[1][1]=1; fo ...
                            
                            
                                分类:
其他好文   时间:
2017-11-06 13:50:28   
                                阅读次数:
171
                             
                    
                        
                            
                            
                                obj=Foo()##Foo类是MyType类的对象 所以先执行MyType的init Foo()加括号执行MyType的call foo=type('Foo',(object,),{'say':lambda a:123}) ##所有类都是type类的对象 print(foo().say()) fo ...
                            
                            
                                分类:
编程语言   时间:
2017-11-05 15:10:00   
                                阅读次数:
175
                             
                    
                        
                            
                            
                                Given a sorted array, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra space fo ...
                            
                            
                                分类:
其他好文   时间:
2017-11-05 00:27:42   
                                阅读次数:
138
                             
                    
                        
                            
                            
                                    触发器 其是一种特殊的存储过程。一般的存储过程是通过存储过程名直接调用,而触发器主要是 通过事件(增、删、改)进行触发而被执行的。其在表中数据发生变化时自动强制执行。 常见的触发器有两种:after(for)、instead of,用于insert、update、delete事件。 after(fo ...
                            
                            
                                分类:
数据库   时间:
2017-11-04 13:34:46   
                                阅读次数:
160
                             
                    
                        
                            
                            
                                1、先借用一下织梦默认搜索结果页面模板search.htm ,在织梦默认模板default中,把search.htm复制到自己模板文件夹下(这里用织梦默认搜索结果页仅仅用来演示,样式可能不好看)。 2、织梦默认的搜索框样代码如下。<div class="search"> <form name="fo ...
                            
                            
                                分类:
其他好文   时间:
2017-11-04 13:27:12   
                                阅读次数:
200
                             
                    
                        
                            
                            
                                    for循环 for循环,通过下标,对循环中的代码反复执行,功能强大,可以通过index取得元素。在处理比较复杂的处理的时候较为方便。 foreach循环 foreach,从头到尾,对于集合中的对象遍历。适用于简单的遍历。foreach使用的时候,会锁定集合的对象,期间不能进行修改。 使用的选择 fo ...
                            
                            
                                分类:
其他好文   时间:
2017-11-02 01:00:03   
                                阅读次数:
121
                             
                    
                        
                            
                            
                                BFS 类问题 1 Surrounded Regions public void surroundedRegions(char[][] board) { int n = board.length; if (n == 0) { return; } int m = board[0].length; fo ...
                            
                            
                                分类:
其他好文   时间:
2017-10-31 12:59:36   
                                阅读次数:
211