
leetcode
文章平均质量分 71
Coding懒懒
享受技术人生
展开
-
[leetcode]Search in Rotated Sorted Array
Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the array return its原创 2015-04-20 17:06:00 · 456 阅读 · 0 评论 -
leetcode Climbing Stairs
You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?原题链接:https://oj.leetcode.com转载 2015-05-07 16:35:00 · 442 阅读 · 0 评论 -
[leetcode]Gray Code
The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total number of bits in the code, print the sequence of gra转载 2015-05-07 17:13:19 · 404 阅读 · 0 评论 -
leetcode Plus One
【题目】Given a number represented as an array of digits, plus one to the number.【题意】给你一个用数组表示的数,求加一之后的结果,结果还是用数组表示。【分析】从低位到高位,连续遇到9才能加一进位。【代码1】/********************************** 日期:20转载 2015-05-07 16:19:36 · 368 阅读 · 0 评论 -
JAVA oj注意事项
基本输入输出其实我感觉在有c基础后,学习java还是挺简单的,写acm时候主要是不太适应java的输入输出,其实关键还是在于你心里是否接受java的语法(吐槽:java的api的名字太TM长了吧) 在c里输入输出的标准格式: [cpp] #include int main(void) { int转载 2016-06-20 15:01:43 · 2468 阅读 · 0 评论