-
8 Patterns Review For Successful Coding Interview
8 Patterns Review For Successful Coding Interview This is nothing but quick 5 min revision before going to interview. Visit https: https://codeandalgo.com for more such contents
-
Container With Most Water
Leetcode#11 Container With Most Water Problem Statement You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines that together with the x-axis form a container, such that the container contains the most water. Return the maximum amount of water a container can…
-
Minimum Number of Arrows to Burst Balloons
Leetcode#452 Minimum Number of Arrows to Burst Balloons Problem Statement There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer array points where points[i] = [xstart, xend] denotes a balloon whose horizontal diameter stretches between xstart and xend. You do not know the exact y-coordinates of the balloons. Arrows can be shot…
-
Maximum Points You Can Obtain from Cards
Leetcode#1423 Maximum Points You Can Obtain from Cards There are several cards arranged in a row, and each card has an associated number of points. The points are given in the integer array cardPoints. In one step, you can take one card from the beginning or from the end of the row. You have to take exactly k cards….
-
Max Sum of K Window
Max Sum of K Window Problem Statement Given an array and an integer K, return the maximum sum that can be obtained by picking up K elements consecutively. Golang Solution Output Test Cases Positive Case Negative Numbers Invalid Cases Similar Problem Please visit https: https://codeandalgo.com for more such contents
-
Longest Substring Without Repeating Characters
Leetcode#3 Longest Substring Without Repeating Characters Problem Statement 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 the length of…
-
(TBD)Longest Consecutive Sequence
Leetcode#128 Longest Consecutive Sequence Problem Statement Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(n) time. Example 1: Input: nums = [100,4,200,1,3,2] Output: 4 Explanation: The longest consecutive elements sequence is [1, 2, 3, 4]. Therefore its length is 4. Example 2: Input:…