## 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.

## Word Search II LeetCode Solution

Given an m x n board of characters and a list of strings words, return all words on the board.

## Maximal Square LeetCode Solution

Given an m x n binary matrix filled with 0’s and 1’s, find the largest square containing only 1’s and return its area.

## 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.

## Contains Duplicate III LeetCode Solution

You are given an integer array nums and two integers indexDiff and valueDiff. Find a pair of indices (i, j) such that: i != j, abs(i – j) <= indexDiff. abs(nums[i] - nums[j]) <= valueDiff, and Return true if such pair exists or false otherwise.

## Basic Calculator II LeetCode Solution

Given a string s which represents an expression, evaluate this expression and return its value. The integer division should truncate toward zero.

## Longest Palindromic Substring LeetCode Solution

Given a string s, return the longest palindromic substring in s. A palindrome is a string which reads the same in both directions. For example, S = “aba” is a palindrome, S = “abc” is not.

## 3Sum LeetCode Solution

Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.

## Zigzag Conversion LeetCode Solution

The string PAYPALISHIRING is written in a zigzag pattern on a given number of rows like read line by line: “PAHNAPLSIIGYIR”.

## Median of Two Sorted Arrays LeetCode Solution

Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).

## Longest Substring Without Repeating Characters LeetCode Solution

Given a string s, find the length of the longest substring without repeating characters.