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. C++11之std::future和std::promise和std::std::packaged_task

    为什么C++11引入std::future和std::promise?C++11创建了线程以后,我们不能直接从thread.join()得到结果,必须定义一个变量,在线程执行时,对这个变量赋值,然后执 ...

  2. 【洛谷5309】[Ynoi2012] D1T1(分块)

    点此看题面 大致题意: 两种操作,区间求和,将形如\(ax+y\)的位置的元素值加\(z\). 分块 这种题目显然就是按照\(x\)与\(\sqrt n\)的大小关系来分块. 对于\(x>\sq ...

  3. intellij 无法导入 SimpleTagSupport问题

    主要原因还是导包问题: 需要导入2个包: 之前,我只导入 servlet-api.jar ,总是报错,最后导入jsp-api.jar后,才成功可以继承!

  4. POJ 3621 Sightseeing Cows 【01分数规划+spfa判正环】

    题目链接:http://poj.org/problem?id=3621 Sightseeing Cows Time Limit: 1000MS   Memory Limit: 65536K Total ...

  5. System.Chare的成员

    实现效果: 知识运用: System.Char的静态方法 (判断一个给定的字符是否为数字 字母 标点符号或其他) 实现效果: static void CharFunctionality() { Con ...

  6. EF Ccore 主从配置 最简化

    业务需要 配置一主多从数据库 读写分离  orm用的ef core , 把思路和代码写下 1. 配置2个数据库上下文 ETMasterContext  ETSlaveContext(把增删改功能禁用掉 ...

  7. 七、IntelliJ IDEA 常见文件类型的图标介绍

    咱们已经了解了很多关于 IntelliJ IDEA 的内容啦,例如,在 Windows 系统下安装 IntelliJ IDEA.运行 IntelliJ IDEA .创建 Java 项目以及修改 Int ...

  8. 表达式过滤器currency

    <!DOCTYPE html><html><head><meta http-equiv="Content-Type" content=&q ...

  9. Java基础——数组复习

    数组是一个变量,存储相同数据类型的一组数据 声明一个变量就是在内存空间划出一块合适的空间 声明一个数组就是在内存空间划出一串连续的空间 数组长度固定不变,避免数组越界   数组是静态分配内存空间的,所 ...

  10. oracle https://localhost:1158/em 无法打开

    解决办法一: 首先查看本机Oracle安装路径中 portlist.ini 文件里面的端口号是多少,例如我的就是5500. 那么在浏览器中输入的地址就是:https://localhost:5500/ ...