682. Baseball Game 题目链接 682. Baseball Game 题目分析 给定一个字符串数组,每一个字符串有以下形式: 数字。直接计算得分。 +。代表本轮分数为上一轮和上上一轮分数之和。 D。代表本…
标签:LeetCode php
Leetcode PHP题解--D36 811. Subdomain Visit Count
811. Subdomain Visit Count 题目链接 811. Subdomain Visit Count 题目分析 题目给定一个字符串数组,每个字符串分两部分,以空格分割。 第一部分为访问次数,第二部分为域名…
Leetcode PHP题解--D35 876. Middle of the Linked List
876. Middle of the Linked List 题目链接 876. Middle of the Linked List 题目分析 返回一个链表中最中间的元素。 思路 先全部塞入数组,再根据长度/2得到中间元…
Leetcode PHP题解--D34 977. Squares of a Sorted Array
977. Squares of a Sorted Array 题目链接 977. Squares of a Sorted Array 题目分析 本题比较简单。对给定数组的每一个数字的平方。并对结果进行排序。 思路 遍历每…
Leetcode PHP题解--D33 700. Search in a Binary Search Tree
700. Search in a Binary Search Tree 题目链接 700. Search in a Binary Search Tree 题目分析 从给定的二叉树中,查找指定值及其子节点。 思路 这个好像…
Leetcode PHP题解--D32 617. Merge Two Binary Trees
617. Merge Two Binary Trees 题目链接 617. Merge Two Binary Trees 题目分析 给定两个二叉树,返回一个 将对应位置值相加后的二叉树。 例如,树A的顶点值为1,树B的顶…
Leetcode PHP题解--D31 965. Univalued Binary Tree
965. Univalued Binary Tree 题目链接 965. Univalued Binary Tree 题目分析 如果二叉树中所有节点的值都相同,那么该二叉树被称为单值二叉树。 当给定的二叉树是单值二叉树时…
Leetcode PHP题解--D30 728. Self Dividing Numbers
728. Self Dividing Numbers 题目链接 728. Self Dividing Numbers 题目分析 如果一个数字能被其中的每一位整除,那么这个数字被称为自整除数。 例如,数字128。128%1…
Leetcode PHP题解--D29 973. K Closest Points to Origin
973. K Closest Points to Origin 题目链接 973. K Closest Points to Origin 题目分析 给一个坐标数组points,从中返回K个离0,0最近的坐标。 其中,用欧…
Leetcode PHP题解--D28 884. Uncommon Words from Two Sentences
884. Uncommon Words from Two Sentences 题目链接 884. Uncommon Words from Two Sentences 题目分析 返回给定的两个句子中唯一不同的单词。 思路 …
Leetcode PHP题解--D27 620. Not Boring Movies
620. Not Boring Movies 题目链接 620. Not Boring Movies 题目分析 前面铺垫了那么多,要求就在这: movies with an odd numbered ID and a d…
Leetcode PHP题解--D26 766. Toeplitz Matrix
766. Toeplitz Matrix 题目链接 766. Toeplitz Matrix 题目分析 拓普利兹矩阵,应该不用多说了。 要求自己的右下和左上元素值相等。 思路 拿当前行的前0n-1位,与下一行的1n位对比…