leetcode 1
2016-01-27 21:32
288 查看
题目:
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are not zero-based.
You may assume that each input would have exactly one solution.
Input: numbers={2, 7, 11, 15}, target=9
Output: index1=1, index2=2
代码:
相关文章推荐
- hdu 1106 排序
- 编程错误总结
- 关于大数据的简单理解
- Selenium2(java)TestNG的使用 七
- 专注于HTTP的高性能高易用性网络库:Fslib.network库
- Java [Leetcode 112]Path Sum
- Windows 线程漫谈——界面线程和工作者线程
- Web components新玩具——X-View
- 几种C#程序读取MAC地址的方法
- POJ 1505 Copying Books
- 排序算法个人总结(2)
- maven-assembly-plugin
- RNA-seq Data Analysis-A Practical Approach-book(2015) 笔记
- 素数打表(常用素数判断题节省时间复杂度)
- Android 关于屏幕的一些事儿
- JDK5.0中JVM堆模型、GC垃圾收集详细解析
- linux下jdk配置
- PHP强制转换类型
- javaweb学习总结(十五)——JSP基础语法
- windows 多线程 消息队列