• 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

  • Find Minimum in Rotated Sorted Array

    Leetcode#153 Find Minimum in Rotated Sorted Array Logic Please read normal Binary search code for finding target and its comparison with rotated array. This will help to build foundation. Problem Statement Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become: Notice that rotating an array [a[0], a[1], a[2], …, a[n-1]] 1 time…

  • Delete the Middle Node of a Linked List

    Leetcode#2095 Delete the Middle Node of a Linked List Problem Statement You are given the head of a linked list. Delete the middle node, and return the head of the modified linked list. The middle node of a linked list of size n is the ⌊n / 2⌋th node from the start using 0-based indexing, where ⌊x⌋ denotes the largest integer less than or equal to x. Example 1: Input: head = [1,3,4,7,1,2,6] Output: [1,3,4,1,2,6]…

  • 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