代码改变世界

[LeetCode] 56. Merge Intervals_Medium Tag: sort

2021-07-29 06:43 by Johnson_强生仔仔, 26 阅读, 0 推荐, 收藏, 编辑
摘要:Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals 阅读全文

[Leetcode] 543. Diameter of Binary Tree_Easy Tag: DFS

2021-07-29 05:51 by Johnson_强生仔仔, 7 阅读, 0 推荐, 收藏, 编辑
摘要:Given the root of a binary tree, return the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwee 阅读全文

[LeetCode] 25. Reverse Nodes in k-Group_Hard tag: Linked List

2021-07-29 04:33 by Johnson_强生仔仔, 11 阅读, 0 推荐, 收藏, 编辑
摘要:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to 阅读全文

[LeetCode] 5. Longest Palindromic Substring _Medium tag: Two pointers

2021-07-29 00:38 by Johnson_强生仔仔, 9 阅读, 0 推荐, 收藏, 编辑
摘要: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. Examp 阅读全文

[LeetCode] 79. Word Search_Medium tag: Backtracking, DFS

2021-07-28 11:04 by Johnson_强生仔仔, 42 阅读, 0 推荐, 收藏, 编辑
摘要:Given an m x n grid of characters board and a string word, return true if word exists in the grid. The word can be constructed from letters of sequent 阅读全文

[LeetCode]2. Add Two Numbers_Medium tag: Linked List

2021-07-27 22:00 by Johnson_强生仔仔, 10 阅读, 0 推荐, 收藏, 编辑
摘要:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes conta 阅读全文

[LeetCode] 77. Combinations_Medium tag: backtracking

2021-07-14 10:18 by Johnson_强生仔仔, 18 阅读, 0 推荐, 收藏, 编辑
摘要:Given two integers n and k, return all possible combinations of k numbers out of the range [1, n]. You may return the answer in any order. Example 1: 阅读全文

[LeetCode] 211. Design Add and Search Words Data Structure_Medium tag: Trie, DFS

2021-06-30 01:11 by Johnson_强生仔仔, 24 阅读, 0 推荐, 收藏, 编辑
摘要:Design a data structure that supports adding new words and finding if a string matches any previously added string. Implement the WordDictionary class 阅读全文

[LeetCode] 642. Design Search Autocomplete System_Hard tag: Trie

2021-06-30 00:03 by Johnson_强生仔仔, 44 阅读, 0 推荐, 收藏, 编辑
摘要:Design a search autocomplete system for a search engine. Users may input a sentence (at least one word and end with a special character '#'). You are 阅读全文

[LeetCode] 212. Word Search II_Hard tag: Trie, DFS

2021-06-29 20:06 by Johnson_强生仔仔, 37 阅读, 0 推荐, 收藏, 编辑
摘要:Given an m x n board of characters and a list of strings words, return all words on the board. Each word must be constructed from letters of sequentia 阅读全文
上一页 1 2 3 4 5 6 7 8 9 10 ··· 39 下一页