网站首页 站内搜索

搜索结果

查询Tags标签: Medium,共有 43条记录
  • [LeetCode] 3. Longest Substring Without Repeating Characters_Medium tag: two pointers

    Given a string s, find the length of the longest substring without repeating characters.Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3.Example 2: Input: s = "bbbbb" Outpu…

    2021/8/5 6:08:37 人评论 次浏览
  • [LeetCode] 11. Container With Most Water_Medium tag: two pointers

    Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of the line i is at (i, ai) and (i, 0). Find two lines, which, together with the x-axis forms a…

    2021/8/5 6:07:07 人评论 次浏览
  • [LeetCode] 11. Container With Most Water_Medium tag: two pointers

    Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of the line i is at (i, ai) and (i, 0). Find two lines, which, together with the x-axis forms a…

    2021/8/5 6:07:07 人评论 次浏览
  • leetCode1104. 二叉树寻路(medium)

    审题: 在一棵无限的二叉树上,每个节点都有两个子节点,树中的节点 逐行 依次按 “之” 字形进行标记。 如下图所示,在奇数行(即,第一行、第三行、第五行……)中,按从左到右的顺序进行标记; 而偶数行(即,第二行、第四行、第六行……)中,按从右到左的顺序进行标…

    2021/8/1 6:06:14 人评论 次浏览
  • leetCode1104. 二叉树寻路(medium)

    审题: 在一棵无限的二叉树上,每个节点都有两个子节点,树中的节点 逐行 依次按 “之” 字形进行标记。 如下图所示,在奇数行(即,第一行、第三行、第五行……)中,按从左到右的顺序进行标记; 而偶数行(即,第二行、第四行、第六行……)中,按从右到左的顺序进行标…

    2021/8/1 6:06:14 人评论 次浏览
  • [LeetCode]348. Design Tic-Tac-Toe_Medium tag: array

    Assume the following rules are for the tic-tac-toe game on an n x n board between two players:A move is guaranteed to be valid and is placed on an empty block. Once a winning condition is reached, no more moves are allowed. A player who succeeds in pl…

    2021/7/30 6:07:48 人评论 次浏览
  • [LeetCode]348. Design Tic-Tac-Toe_Medium tag: array

    Assume the following rules are for the tic-tac-toe game on an n x n board between two players:A move is guaranteed to be valid and is placed on an empty block. Once a winning condition is reached, no more moves are allowed. A player who succeeds in pl…

    2021/7/30 6:07:48 人评论 次浏览
  • [LeetCode] 5. Longest Palindromic Substring _Medium tag: Two pointers

    Given a string s, return the longest palindromic substring in s.Example 1: Input: s = "babad" Output: "bab" Note: "aba" is also a valid answer.Example 2: Input: s = "cbbd" Output: "bb"Example 3: Input:…

    2021/7/29 6:07:53 人评论 次浏览
  • [LeetCode] 5. Longest Palindromic Substring _Medium tag: Two pointers

    Given a string s, return the longest palindromic substring in s.Example 1: Input: s = "babad" Output: "bab" Note: "aba" is also a valid answer.Example 2: Input: s = "cbbd" Output: "bb"Example 3: Input:…

    2021/7/29 6:07:53 人评论 次浏览
  • [LeetCode] 211. Design Add and Search Words Data Structure_Medium tag: Trie, DFS

    Design a data structure that supports adding new words and finding if a string matches any previously added string. Implement the WordDictionary class:WordDictionary() Initializes the object. void addWord(word) Adds word to the data structure, it can …

    2021/6/30 6:21:45 人评论 次浏览
  • [LeetCode] 208. Implement Trie (Prefix Tree)_Medium tag: Trie

    A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker. Implement…

    2021/6/29 6:20:30 人评论 次浏览
  • LeetCode - Medium - 1315. Sum of Nodes with Even-Valued Grandparent

    Topic TreeDepth-first Search Description https://leetcode.com/problems/sum-of-nodes-with-even-valued-grandparent/ Given a binary tree, return the sum of values of nodes with even-valued grandparent. (A grandparent of a node is the parent of its parent…

    2021/6/21 14:28:39 人评论 次浏览
  • 1899. 合并若干三元组以形成目标三元组(Medium)

    题目 题目及示例 我的题解 triplets中的数组一一与target中对比,如果有大于target的数,则不能加入运算;如果有等于target的数,则可以确定在target中的位置。 class Solution {public boolean mergeTriplets(int[][] triplets, int[] target) {boolean[] confirmed = n…

    2021/6/15 10:22:43 人评论 次浏览
共43记录«上一页123下一页»
扫一扫关注最新编程教程