# Easy

## Search Insert Position LeetCode Solution

Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.

## Remove Element LeetCode Solution

Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed.

## Merge Two Sorted Lists LeetCode Solution

You are given the heads of two sorted linked lists list1 and list2. Merge the two lists in a one sorted list. The list should be made by splicing together the nodes of the first two lists. Return the head of the merged linked list.

## Climbing Stairs LeetCode Solution

You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?

## Reverse Linked List LeetCode Solution

Given the head of a singly linked list, reverse the list, and return the reversed list.

Given an integer num, repeatedly add all its digits until the result has only one digit, and return it.

## Nim Game LeetCode Solution

Given n, the number of stones in the heap, return true if you can win the game assuming both you and your friend play optimally, otherwise return false.

## Valid Parentheses LeetCode Solution

Given a string s containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid.

## Single Number LeetCode Solution

Given a non-empty array of integers nums, every element appears twice except for one. Find that single one.

## Intersection of Two Linked Lists LeetCode Solution

Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the two linked lists have no intersection at all, return null.

## Reverse Bits LeetCode Solution

Reverse bits of a given 32 bits unsigned integer.

## Happy Number LeetCode Solution

Write an algorithm to determine if a number n is happy. Return true if n is a happy number, and false if not.

## Contains Duplicate II LeetCode Solution

Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i – j) <= k.

## Majority Element LeetCode Solution

Given an array nums of size n, return the majority element. The majority element is the element that appears more than [n / 2] times. You may assume that the majority element always exists in the array.

## Contains Duplicate LeetCode Solution

Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.

Scroll to Top