Text Justification LeetCode Solution
Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully justified.
Text Justification LeetCode Solution Read More »
Leetcode SolutionGiven an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully justified.
Text Justification LeetCode Solution Read More »
Leetcode SolutionYou are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list and return it.
Merge k Sorted Lists LeetCode Solution Read More »
Leetcode SolutionGiven a string s containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid.
Valid Parentheses LeetCode Solution Read More »
Leetcode SolutionGiven an input string s and a pattern p, implement regular expression matching with support for ‘.’ and ‘*’ where ‘.’ Matches any single character and ‘*’ Matches zero or more of the preceding element.
Regular Expression Matching LeetCode Solution Read More »
Leetcode SolutionGiven n, the number of stones in the heap, return true if you can win the game assuming both you and your friend play optimally, otherwise return false.
Nim Game 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 the head of a singly linked list, reverse the list, and return the reversed list.
Reverse Linked List LeetCode Solution Read More »
Leetcode SolutionYou are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
Climbing Stairs LeetCode Solution Read More »
Leetcode SolutionYou are given the heads of two sorted linked lists list1 and list2. Merge the two lists in a one sorted list. The list should be made by splicing together the nodes of the first two lists. Return the head of the merged linked list.
Merge Two Sorted Lists LeetCode Solution Read More »
Leetcode SolutionGiven the head of a linked list, reverse the nodes of the list k at a time, and return the modified list.
Reverse Nodes in k-Group LeetCode Solution Read More »
Leetcode SolutionGiven an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed.
Remove Element 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 SolutionYou are given a string s and an array of strings words. All the strings of words are of the same length. Return the starting indices of all the concatenated substrings in s. You can return the answer in any order.
Substring with Concatenation of All Words LeetCode Solution Read More »
Leetcode SolutionGiven an array of integers nums, find the next permutation of nums.
Next Permutation LeetCode Solution Read More »
Leetcode Solution