Example 1:: 1. Two Sum
Example 1:: 1. Two Sum
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.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
Example 1:
Example 2:
Example 3:
Constraints:
******************
7. Reverse Integer
******************
Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-
bit integer range [-231, 231 - 1], then return 0.
Assume the environment does not allow you to store 64-bit integers (signed or unsigned).
Example 1:
Input: x = 123
Output: 321
Example 2:
Input: x = -123
Output: -321
Example 3:
Input: x = 120
Output: 21
Example 4:
Input: x = 0
Output: 0
Constraints:
********************
9. Palindrome Number
********************
An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not.
Example 1:
Input: x = 121
Output: true
Example 2:
Input: x = -121
Output: false
Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a
palindrome.
Example 3:
Input: x = 10
Output: false
Explanation: Reads 01 from right to left. Therefore it is not a palindrome.
Example 4:
Input: x = -101
Output: false
Constraints:
Follow up: Could you solve it without converting the integer to a string?
*********************
20. Valid Parentheses
*********************
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
Example 1:
Input: s = "()"
Output: true
Example 2:
Input: s = "()[]{}"
Output: true
Example 3:
Input: s = "(]"
Output: false
Example 4:
Input: s = "([)]"
Output: false
Example 5:
Input: s = "{[]}"
Output: true
Constraints:
Merge two sorted linked lists and return it as a sorted list. The list should be made by splicing together the nodes of the
first two lists.
Example 1:
Example 2:
Input: l1 = [], l2 = []
Output: []
Example 3:
Constraints:
***************************************
26. Remove Duplicates from Sorted Array
***************************************