2017年10月17日

摘要: Given a string, find the first non repeating character in it and return it's index. If it doesn't exist, return 1. Examples: Note: You may assume the 阅读全文
posted @ 2017-10-17 20:32 Wanna_Go 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than times. You may assume that the array i 阅读全文
posted @ 2017-10-17 09:48 Wanna_Go 阅读(114) 评论(0) 推荐(0) 编辑

2017年10月13日

摘要: 先放一条mysql的导出语句 PG提供了数据导出功能pg_dump,但是不能直接将函数导出。思路是将表的结构导出,过滤出函数名,再解析出函数的sql语句。上面是提供的参数及其含义 具体方法如下: 阅读全文
posted @ 2017-10-13 15:36 Wanna_Go 阅读(3528) 评论(0) 推荐(0) 编辑

2017年10月12日

摘要: Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a g 阅读全文
posted @ 2017-10-12 20:39 Wanna_Go 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 工作时候需要模拟shell来执行任务,借助包 "paramkio" 阅读全文
posted @ 2017-10-12 15:21 Wanna_Go 阅读(385) 评论(0) 推荐(0) 编辑

2017年10月11日

摘要: Find the sum of all left leaves in a given binary tree. Example 求二叉树左边叶子的和 这类题目无非就是对二叉树的遍历上面做文章,最简单的方法就是递归求解,牢记遍历时候的套路。下面是使用非递归方式,借用stack 阅读全文
posted @ 2017-10-11 09:44 Wanna_Go 阅读(96) 评论(0) 推荐(0) 编辑

2017年10月4日

摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2017-10-04 11:46 Wanna_Go 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree with non negative values, find the minimum absolute difference between values of any two nodes. Example: 题目要求找到二叉搜索树中,节点之间最 阅读全文
posted @ 2017-10-04 10:53 Wanna_Go 阅读(160) 评论(0) 推荐(0) 编辑

2017年9月30日

摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2017-09-30 20:01 Wanna_Go 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文
posted @ 2017-09-30 09:42 Wanna_Go 阅读(102) 评论(0) 推荐(0) 编辑

导航