LeetCode 53: Maximum Subarray
Problem DescriptionGiven an integer array nums, find the subarray with the largest sum, and return its sum.Example 1Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: The subarray [4,-1,2,1]
Problem DescriptionGiven an integer array nums, find the subarray with the largest sum, and return its sum.Example 1Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: The subarray [4,-1,2,1]
Problem DescriptionWe have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i].You're given the startTime, endTime and profit arrays, retur
Problem DescriptionYou are given a string word and an array of strings forbidden.A string is called valid if none of its substrings are present in forbidden.Return the length of the longest valid subs
Problem DescriptionYou are given a 0-indexed array of integers nums of length n. You are initially positioned at nums[0].Each element nums[i] represents the maximum length of a forward jump from index
Problem DescriptionGiven n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.Example 1Input: height = [0,1,0,2,1,0,
Problem DescriptionGiven a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You mu
Problem DescriptionP33There is an integer array nums sorted in ascending order (with distinct values).Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 &l
Problem DescriptionGiven the head of a linked list, reverse the nodes of the list k at a time, and return the modified list.k is a positive integer and is less than or equal to the length of the linke
Problem DescriptionYou 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.Example 1Input: li
Problem DescriptionGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.Example 1Input: n = 3 Output: ["((()))","(()())","(()