CNoodle
  • Home
  • Archives
  • Tags
  • About

[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 #two pointer #java #javascript #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 #two pointer #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 #two pointer #java #javascript #linked list

[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 #two pointer #java #javascript #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

[LeetCode] 34. Find First and Last Position of Element in Sorted Array

Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an a
2019-11-04
#leetcode #array #java #javascript #binary search

[LeetCode] 11. Container With Most Water

You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines that together with the x-a
2019-11-02
#leetcode #array #two pointer #java #javascript

53. Maximum Subarray

Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. A subarray is a contiguous part of an array. Example 1:Input: n
2019-11-01
#leetcode #array #java #dynamic programming

[LeetCode] 253. Meeting Rooms II

Given an array of meeting time intervals intervals where intervals[i] = [starti, endi], return the minimum number of conference rooms required. Example 1:Input: intervals = [[0,30],[5,10],[1
2019-11-01
#leetcode #array #java #javascript #heap #line sweep

[LeetCode] 252. Meeting Rooms

Given an array of meeting time intervals where intervals[i] = [start, end], determine if a person could attend all meetings. Example 1:Input: intervals = [[0,30],[5,10],[15,20]]Output: false
2019-10-31
#leetcode #array #java #javascript #line sweep
1…4041424344

Search

Hexo Fluid