• 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

  • UnDirected Graph Cycle Detection

    Problem Statement Important Logic Golang Solution Output Visit https: https://codeandalgo.com for more such contents.

  • Number of Islands

    Leetcode#200 Problem Statement Given an m x n 2D binary grid grid which represents a map of ‘1’s (land) and ‘0’s (water), return the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. Example 1: Input: grid = [ [“1″,”1″,”1″,”1″,”0”],…

  • Rotting Oranges

    Problem Statement Leetcode#994 Rotting Oranges You are given an m x n grid where each cell can have one of three values: Every minute, any fresh orange that is 4-directionally adjacent to a rotten orange becomes rotten. Return the minimum number of minutes that must elapse until no cell has a fresh orange. If this is impossible, return -1. Example 1 Input: grid…

  • Queue

    Implementing a Simple Queue in Go: A Step-by-Step Guide When working with data structures in Go, understanding how to implement a basic queue is a crucial skill. A queue operates on a First In, First Out (FIFO) principle, meaning the first element added is the first one to be removed. In this post, we’ll walk…

  • Graph

    Graph Representation & usage Choosing between map[int][]edge and [][]int{} for representing graph data in Go depends on the specific requirements of your application and the characteristics of the graph you are working with. Here’s a comparison of both approaches: Adjecancy List map[int][]edge Advantages Disadvantages Adjecancy Matrix[][]int{} Advantages Disadvantages Conclusion In many real-world applications, especially with…

  • Maximum Product Subarray

    LeetCode#152 Maximum Product Subarray Problem Statement Given an integer array nums, find a subarray that has the largest product, and return the product. The test cases are generated so that the answer will fit in a 32-bit integer. Example 1: Input: nums = [2,3,-2,4] Output: 6 Explanation: [2,3] has the largest product 6. Example 2: Input: nums = [-2,0,-1] Output: 0…