CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 234. Palindrome Linked List

Given the head of a singly linked list, return true if it is a palindrome or false otherwise. Example 1:Input: head = [1,2,2,1]Output: true Example 2:Input: head = [1,2]Output: false Constra
2019-11-10
#leetcode #java #javascript #two pointer #linked list #palindrome

[LeetCode] 21. Merge Two Sorted Lists

You are given the heads of two sorted linked lists list1 and list2. Merge the two lists into one sorted list. The list should be made by splicing together the nodes of the first two lists. Return the
2019-11-10
#leetcode #java #javascript #sort #linked list #merge sort

[LeetCode] 142. Linked List Cycle II

Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. There is a cycle in a linked list if there is some node in the list that can be reached agai
2019-11-10
#leetcode #java #javascript #two pointer #linked list

[LeetCode] 141. Linked List Cycle

Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked list if there is some node in the list that can be reached again by continuously fol
2019-11-10
#leetcode #java #javascript #two pointer #linked list

[LeetCode] 82. Remove Duplicates from Sorted List II

Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the linked list sorted as well. Example 1:Input: head
2019-11-08
#leetcode #java #javascript #linked list

[LeetCode] 83. Remove Duplicates from Sorted List

Given the head of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well. Example 1:Input: head = [1,1,2]Output: [1,2] Example
2019-11-08
#leetcode #java #javascript #linked list

[LeetCode] 19. Remove Nth Node From End of List

Given the head of a linked list, remove the nth node from the end of the list and return its head. Example 1:Input: head = [1,2,3,4,5], n = 2Output: [1,2,3,5] Example 2:Input: head = [1
2019-11-08
#leetcode #java #javascript #two pointer #linked list

[LeetCode] 189. Rotate Array

Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1:Input: [1,2,3,4,5,6,7] and k = 3Output: [5,6,7,1,2,3,4]Explanation:rotate 1 steps to the right: [7,1,2
2019-11-05
#leetcode #java #javascript #array #two pointer

[LeetCode] 61. Rotate List

Given the head of a linked list, rotate the list to the right by k places. Example 1:Input: head = [1,2,3,4,5], k = 2Output: [4,5,1,2,3] Example 2:Input: head = [0,1,2], k = 4Outpu
2019-11-05
#leetcode #java #javascript #two pointer #linked list

[LeetCode] 162. Find Peak Element

A peak element is an element that is strictly greater than its neighbors. Given a 0-indexed integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return
2019-11-04
#leetcode #java #javascript #binary search
1…424344454647

Search

Hexo Fluid