摘要:
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 阅读全文
2017年10月17日
摘要:
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 阅读全文
2017年10月13日
摘要:
先放一条mysql的导出语句 PG提供了数据导出功能pg_dump,但是不能直接将函数导出。思路是将表的结构导出,过滤出函数名,再解析出函数的sql语句。上面是提供的参数及其含义 具体方法如下: 阅读全文
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 阅读全文
摘要:
工作时候需要模拟shell来执行任务,借助包 "paramkio" 阅读全文
2017年10月11日
摘要:
Find the sum of all left leaves in a given binary tree. Example 求二叉树左边叶子的和 这类题目无非就是对二叉树的遍历上面做文章,最简单的方法就是递归求解,牢记遍历时候的套路。下面是使用非递归方式,借用stack 阅读全文
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 阅读全文
摘要:
Given a binary search tree with non negative values, find the minimum absolute difference between values of any two nodes. Example: 题目要求找到二叉搜索树中,节点之间最 阅读全文
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 阅读全文
摘要:
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 阅读全文