leetcode
yjies
这个作者很懒,什么都没留下…
展开
-
Three Traversal of Binary Tree
Preorder The preoder is as same as the DFS like root, left, right. The tranversal starts from root (1) , then visit its left grand child at the leave level (3), then its right child (4), the next visit should be their father node’s sibling (5) which is the原创 2020-12-13 14:15:02 · 117 阅读 · 1 评论 -
Leetcode 1640. Check Array Formation Through Concatenation
Check Array Formation Through Concatenation You are given an array of distinct integers arr and an array of integer arrays pieces, where the integers in pieces are distinct. Your goal is to form arr by concatenating the arrays in pieces in any order. Howe.原创 2020-11-10 19:41:42 · 170 阅读 · 0 评论 -
Leetcode 1486. XOR Operation in an Array
XOR Operation in an Array Given an integer n and an integer start. Define an array nums where nums[i] = start + 2*i (0-indexed) and n == nums.length. Return the bitwise XOR of all elements of nums. Example 1: Input: n = 5, start = 0 Output: 8 Explanation.原创 2020-11-10 13:24:51 · 80 阅读 · 0 评论 -
Leetcode 1389. Create Target Array in the Given Order
Create Target Array in the Given Order Given two arrays of integers nums and index. Your task is to create target array under the following rules: Initially target array is empty. From left to right read nums[i] and index[i], insert at index index[i] the.原创 2020-11-10 11:21:27 · 116 阅读 · 0 评论 -
Leetcode 1. 反转链表
Leetcode 1 反转链表 Ex: 1 -> 2 > 3 Output: 3- >2 ->1 public class Solution { public ListNode ReverseList(ListNode head) { ListNode pre = null; ListNode current = head; ListNode next = null; ListNode temp = null;原创 2020-11-07 15:55:07 · 208 阅读 · 1 评论