摘要: 题目: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not 阅读全文
posted @ 2017-09-09 16:29 糯米团子syj 阅读(114) 评论(0) 推荐(0) 编辑
摘要: You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contai 阅读全文
posted @ 2017-09-09 12:29 糯米团子syj 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 co 阅读全文
posted @ 2017-08-27 23:06 糯米团子syj 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 题目: 给定商品价格、特价组合、要买的商品数量,给出买到指定数量商品的最小花费 题解: 针对每个special offer,计算使用这个special offer后的花费,如果比minPrice少, 则保存为minPrice; 递归方法实现,如果商品数量是k,special offer的数量是n, 阅读全文
posted @ 2017-08-27 22:16 糯米团子syj 阅读(1246) 评论(1) 推荐(0) 编辑
摘要: 题目: A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is 阅读全文
posted @ 2017-08-27 19:02 糯米团子syj 阅读(147) 评论(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 transac 阅读全文
posted @ 2017-08-27 18:10 糯米团子syj 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 题目: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stoppin 阅读全文
posted @ 2017-08-27 17:55 糯米团子syj 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: 解题: 思路一: 因为看到题目的要求是sumRange要频繁的调用 阅读全文
posted @ 2017-08-27 17:35 糯米团子syj 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 题目: 求获取n个A的最小操作步骤的数目minStep Initially on a notepad only one character 'A' is present. You can perform two operations on this notepad for each step: Gi 阅读全文
posted @ 2017-08-27 17:04 糯米团子syj 阅读(1525) 评论(0) 推荐(0) 编辑
摘要: 网上看到的pycharm的设置显示行号的方法都是特别老的版本的pycharm了,而且大部分都不是mac下的,按照他们的方法仍然找不到相关设置;摸索一番才找到,遂决定写一个amc下的pycharm5设置方法 我的pycharm的版本是pycharm 5.0.4,是mac下安装的; 1、右上角PyCha 阅读全文
posted @ 2016-04-14 19:26 糯米团子syj 阅读(1874) 评论(0) 推荐(0) 编辑