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.
3Sum LeetCode Solution Read More »
Leetcode SolutionGiven 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.
3Sum LeetCode Solution Read More »
Leetcode SolutionGiven 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.
Longest Palindromic Substring LeetCode Solution Read More »
Leetcode SolutionGiven a string s which represents an expression, evaluate this expression and return its value. The integer division should truncate toward zero.
Basic Calculator II LeetCode Solution Read More »
Leetcode SolutionGiven 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.
Maximal Square LeetCode Solution Read More »
Leetcode SolutionGiven an integer array nums representing the amount of money of each house, return the maximum amount of money you can rob tonight without alerting the police.
House Robber LeetCode Solution Read More »
Leetcode SolutionGiven the head of a singly linked list where elements are sorted in ascending order, convert it to a height-balanced binary search tree.
Convert Sorted List to Binary Search Tree LeetCode Solution Read More »
Leetcode SolutionThere is a singly-linked list head and we want to delete a node node in it. Delete the given node
Delete Node in a Linked List LeetCode Solution Read More »
Leetcode SolutionGiven two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Find the Index of the First Occurrence in a String LeetCode Solution Read More »
Leetcode SolutionGiven two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator. Return the quotient after dividing dividend by divisor.
Divide Two Integers LeetCode Solution Read More »
Leetcode SolutionGiven an array of integers nums, find the next permutation of nums.
Next Permutation LeetCode Solution Read More »
Leetcode SolutionGiven the array nums after the possible rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums.
Search in Rotated Sorted Array LeetCode Solution Read More »
Leetcode SolutionGiven an array nums of distinct integers, return all the possible permutations. You can return the answer in any order.
Permutations LeetCode Solution Read More »
Leetcode SolutionGiven a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list’s nodes.
Swap Nodes in Pairs LeetCode Solution Read More »
Leetcode SolutionGiven an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order.
Combination Sum LeetCode Solution Read More »
Leetcode SolutionGiven a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target.
Combination Sum II LeetCode Solution Read More »
Leetcode Solution