my answer:

​​​​出现的问题:倒数第二行and i !=s这种情况没有考虑进去,以后要思考全面些

leetcode笔记--1 two-sum的更多相关文章

  1. Leetcode 笔记 113 - Path Sum II

    题目链接:Path Sum II | LeetCode OJ Given a binary tree and a sum, find all root-to-leaf paths where each ...

  2. Leetcode 笔记 112 - Path Sum

    题目链接:Path Sum | LeetCode OJ Given a binary tree and a sum, determine if the tree has a root-to-leaf ...

  3. LeetCode 笔记27 Two Sum III - Data structure design

    Design and implement a TwoSum class. It should support the following operations: add and find. add - ...

  4. leetcode笔记:Range Sum Query - Mutable

    一. 题目描写叙述 Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), ...

  5. Leetcode 笔记 110 - Balanced Binary Tree

    题目链接:Balanced Binary Tree | LeetCode OJ Given a binary tree, determine if it is height-balanced. For ...

  6. Leetcode 笔记 100 - Same Tree

    题目链接:Same Tree | LeetCode OJ Given two binary trees, write a function to check if they are equal or ...

  7. Leetcode 笔记 99 - Recover Binary Search Tree

    题目链接:Recover Binary Search Tree | LeetCode OJ Two elements of a binary search tree (BST) are swapped ...

  8. Leetcode 笔记 98 - Validate Binary Search Tree

    题目链接:Validate Binary Search Tree | LeetCode OJ Given a binary tree, determine if it is a valid binar ...

  9. Leetcode 笔记 101 - Symmetric Tree

    题目链接:Symmetric Tree | LeetCode OJ Given a binary tree, check whether it is a mirror of itself (ie, s ...

  10. Leetcode 笔记 36 - Sudoku Solver

    题目链接:Sudoku Solver | LeetCode OJ Write a program to solve a Sudoku puzzle by filling the empty cells ...

随机推荐

  1. 【BZOJ2510】弱题

    题目大意 有\(M\)个球,一开始每个球均有一个初始标号,标号范围为\(1-N\)且为整数,标号为i的球有\(a_i\)个,并保证\(\sum a_i=M\). 每次操作等概率取出一个球(即取出每个球 ...

  2. Wannafly挑战赛1,2

    做了好久了,今天大佬讲题,好厉害,弱鸡只会几道水题. Treepath 给定一棵n个点的树,问其中有多少条长度为偶数的路径.路径的长度为经过的边的条数.x到y与y到x被视为同一条路径.路径的起点与终点 ...

  3. Android学习笔记_13_网络通信之多个上传文件

    一.获取HTTP协议: 建立一个Web项目,建立一个如下所示的jsp界面,用IE捕获表单提交信息. <%@ page language="java" contentType= ...

  4. gcc扩展语法一:在表达式中的语句和声明

    在GNU C中包含在括号中的复合语句可以作为一个表达式.这就允许你在表达式中使用循环,switch和局部变量. 以前复合语句是包含在大括号中语句序列.在这种构造中,圆括号包围在大括号中.如下面的例子: ...

  5. linux下通过源码安装git

    1.移除旧版本git [root@Git ~]# git --version ## 查看自带的版本git version 1.8.3.1 [root@Git ~]# yum remove git ## ...

  6. 轻量ORM-SqlRepoEx (一)SqlRepoEx介绍

    一.SqlRepo项目 发现SqlRepo项目库是在构建自动代码工具时.对于数据访问,在.Net下,有很多选择,比如EF,但EF使用起来,不是很方便的.以前一直使用Atk.Expression库+Sy ...

  7. 执行计划sql

    我准备开始分析并优化我的查询.在分析之前,我想到了一些问题. MS-SQL Server什么时候使用"Table Scan"? MS-SQL Server什么时候使用"I ...

  8. bootstrap到底是用来做什么的

    Bootstrap官网:http://v3.bootcss.com/ Bootstrap是Twitter推出的一个用于前端开发的开源工具包.它由Twitter的设计师Mark Otto和Jacob T ...

  9. 根据坐标计算距离(mysql函数)

    CREATE DEFINER=`root`@`localhost` FUNCTION `getDistance`(lng1 ) BEGIN DECLARE result double; DECLARE ...

  10. 关于java dom解析的问题

    如下的xml代码: <persons> <person> <name>小强</name> <sex>male</sex> < ...