Given a string `s`

, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.

**Example 1:**

**Input:** s = "A man, a plan, a canal: Panama"

**Output:** true

**Explanation:** "amanaplanacanalpanama" is a palindrome.

**Example 2:**

**Input:** s = "race a car"

**Output:** false

**Explanation:** "raceacar" is not a palindrome…

657. Robot Return to Origin

There is a robot starting at position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot **ends up at (0, 0)** after it completes its moves.

The move sequence is represented by a string, and the…

Given an `m x n`

2D binary grid `grid`

which represents a map of `'1'`

s (land) and `'0'`

s (water), return *the number of islands*.

An **island** is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. …

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.

Example 1:

Input: nums = [1,2,3,1] Output: true Example 2:

Input: nums = [1,2,3,4] Output: false Example 3:

Input: nums = [1,1,1,3,3,4,3,2,4,2] Output…

`There is an integer array nums sorted in ascending order (with distinct values).`

Prior to being passed to your function, nums is rotated at an unknown pivot index k (0 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed). For example…

`704. Binary Search`

Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums. If target exists, then return its index, otherwise return -1.

Example 1:

Input: nums = [-1,0,3,5,9,12], target = 9

Output: 4

Explanation: 9 exists in nums and its…

Given an array of integers `nums`

sorted in ascending order, find the starting and ending position of a given `target`

value.

If `target`

is not found in the array, return `[-1, -1]`

.

**Follow up:** Could you write an algorithm with `O(log n)`

runtime complexity?

**Example 1:**

**Input:** nums = [5,7,7,8,8,10]…

3. Longest Substring Without Repeating Characters

Given a string `s`

, find the length of the **longest substring** without repeating characters.

**Example 1:**

**Input:** s = "abcabcbb"

**Output:** 3

**Explanation:** The answer is "abc", with the length of 3.

**Example 2:**

**Input:** s = "bbbbb"

**Output:** 1

**Explanation:** The answer is "b", with…

Given an array `arr`

of 4 digits, find the latest 24-hour time that can be made using each digit **exactly once**.

24-hour times are formatted as `"HH:MM"`

, where `HH`

is between `00`

and `23`

, and `MM`

is between `00`

and `59`

. …

A string `s`

is called **good** if there are no two different characters in `s`

that have the same **frequency**.

Given a string `s`

, return* the **minimum** number of characters you need to delete to make *`s`

* **good**.*

The **frequency** of a character in a string is the number of…