Easy
Solutions and thought process for easy difficulty Leetcode problems.
206. Reverse Linked List
Given the head of a singly linked list, reverse the list, and return the reversed list.
121. Best Time to Buy and Sell Stock
You are given an array prices where prices[i] is the price of a given stock on the ith day.
704. Binary Search
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1.
20. Valid Parentheses
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
125. Valid Palindrome
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers.
217. Contains Duplicate
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.
1. Two Sum
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
242. Valid Anagram
Given two strings s and t, return true if t is an anagram of s, and false otherwise.