Two Pointers

/Tag:Two Pointers
­

[Leetcode] Remove Nth Node From End of List

Given a linked list, remove the nth node from the end of list and return its head.

November 14th, 2015|Categories: DS and Algorithms, Linked List|Tags: , , , , |

[Leetcode] Linked List Cycle

Given a linked list, determine if it has a cycle in it.

November 14th, 2015|Categories: DS and Algorithms, Linked List|Tags: , , , , |

[Leetcode] Linked List Cycle II

Given a linked list, return the node where the cycle begins. If there is no cycle, return null.

November 28th, 2015|Categories: DS and Algorithms, Linked List|Tags: , , , , |

[Leetcode] 3Sum

Given an array S of n integers, find there elements a, b, c in S such that a + b + c = 0.

November 14th, 2015|Categories: Array, DS and Algorithms|Tags: , , , , |

[Leetcode] 3Sum closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number.

November 14th, 2015|Categories: Array, DS and Algorithms|Tags: , , , , |

[Leetcode] Remove Duplicates from Sorted Array

Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.

November 14th, 2015|Categories: Array, DS and Algorithms|Tags: , , , , |

[Leetcode] Rotate List

Given a list, rotate the list to the right by k places, where k is non-negative.

November 14th, 2015|Categories: DS and Algorithms, Linked List|Tags: , , , , |

[Leetcode] Happy Number

Write an algorithm to determine if a number is "happy".

November 14th, 2015|Categories: DS and Algorithms, Hash, Math|Tags: , , , , |

[Leetcode] Intersection of Two Linked Lists

Write a program to find the node at which the intersection of two singly linked lists begins.

November 14th, 2015|Categories: DS and Algorithms, Linked List|Tags: , , , , |

[Leetcode] Minimum Size Subarray Sum

Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of [...]

December 1st, 2015|Categories: Array, DS and Algorithms|Tags: , , , , |

[Leetcode] Move Zeroes

Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.

December 5th, 2015|Categories: Array, DS and Algorithms|Tags: , , , , |

[Leetcode] Container With Most Water

Find two vertical lines which form a container with x-axis , such that the container contains the most water.

December 5th, 2015|Categories: Array, DS and Algorithms|Tags: , , , , |

[Leetcode] Remove Duplicates from Sorted List

Given a sorted linked list, delete all duplicates such that each element appear only once.

December 7th, 2015|Categories: DS and Algorithms, Linked List|Tags: , , , , |

[Leetcode] Palindrome Linked List

Given a singly linked list, determine if it is a palindrome.

December 12th, 2015|Categories: DS and Algorithms, Linked List|Tags: , , , , |