11 2016 档案
摘要:Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This
阅读全文
摘要:We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron
阅读全文
摘要:阿西吧,今天碰到一件特别蛋疼的事,给Ubuntu安装Python的MySQL驱动,驱动显示安装成功了 但是 在程序中导入,老是报错。 明明驱动安装成功了啊。转念一想,默认的Python版本是2.7.2 应该是安装到2.7的目录下了,要安装到Python3的目录下,应该使用pip3 于是又安装了pip
阅读全文
摘要:Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at
阅读全文
摘要:alculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example:Given a = 1 and b = 2, return 3. 注意:不能使用运算符喽 那我
阅读全文
摘要:好长时间没用小飞机了,今天打开发现,无法启动了。 查看了日志: 端口监听失败,小飞机默认本地端口是1080,于是我们使用如下命令查看1080端口的占用情况。 我们看到,1080端口被迅雷占用了 于是我们更改小飞机的本地监听端口为1081 并且更改本地代理的监听端口为1081,我们又能愉快的Googl
阅读全文
摘要:Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh".
阅读全文
摘要:Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example:Given num = 16, return true. Given num = 5, return fa
阅读全文
摘要:Given an integer, write a function to determine if it is a power of three. Follow up:Could you do it without using any loop / recursion?
阅读全文
摘要:Reverse a singly linked list.
阅读全文
摘要:Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 此题是求阶乘后面零的个数。
阅读全文
摘要:Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 -
阅读全文
摘要:在处理一道题目是,发现他们使用了List 中的set 方法,这个方法我平时很少用到,今天来研究一下,set和add的区别 add(int index,Object obj)方法与set(int index,Object e) 我们写一个例子: 结果:
阅读全文
摘要: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 the
阅读全文
摘要:Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 参考博客:链表环状检测
阅读全文
摘要:Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Note:Could you optimize your algorithm to us
阅读全文
摘要:Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return solution:
阅读全文
摘要:近期在登录自己博客时,老是报数据库连接失败,然后重启服务器就好了。但是,重启服务器很耗时间,不方便,不能每次都重启吧于是远程连接服务器看了一下原来是数据库服务挂掉了启动时还报错于是查看了下错误日志 原因是内存不够用了,导致mysql 崩溃解决办法修改mysql配置文件 修改如下代码: 把内存改小就好
阅读全文
摘要:创建表 修改表 修改表名 修改字段数据类型,字段名 增加字段 在首行增加字段 指定位置增加字段 删除字段 删除外键约束 首先查看外键名称 删除外键约束 删除表 删除没有被关联的普通表 删除被其他表关联的父表(共两种方式) ①:删除外键约束,再删除父表; ②:删除字表,再删除父表;
阅读全文