All Posts

Leetcode 1: Two Sum

Given an array of integers nums and a target integer target, find and return the indices of two distinct numbers in the array that sum up to the given target. The solution is guaranteed to exist for the given input. You can return the indices in any order.

Leetcode 9: Palindrome Number

Given an integer, return true if the number is a palindrome. A number is a palindrome if it reads the same forwards and backwards. If the number is negative, it is automatically not a palindrome.

Leetcode 13: Roman to Integer

Convert a given valid Roman numeral string into its integer equivalent by following the Roman numeral system.

Leetcode 20: Valid Parentheses

You are given a string containing characters representing various types of brackets: ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’. Your task is to determine if the input string is valid. A string is considered valid if:

  1. Open brackets must be closed by the same type of brackets.
  2. Open brackets must be closed in the correct order.
  3. Every close bracket has a corresponding open bracket of the same type.

Leetcode 21: Merge Two Sorted Lists

Given two sorted linked lists, merge them into one sorted linked list by splicing together the nodes from both lists. Return the head of the merged linked list.

Leetcode 27: Remove Element

Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return the number of elements in nums which are not equal to val. Modify the array nums such that the first k elements contain the elements which are not equal to val, and the remaining elements of nums are not important. Return k.