Overview A sorted input array having distinct integers and a target value are given. The objective is to find the insert position for that target value in that array. There are two…
Category: Tech
Minimum Path Sum Program in Go (Golang)
Overview There is an m*n matrix that contains non-negative integers. The objective is to find a minimum sum path moving from Top-Left to Bottom-Right. You can only move right or down. For…
Program for the same binary tree in Go (Golang)
Overview The objective is to find if two given binary trees are the same or notExampleBelow trees are the same Tree 1 Tree 2 Program Here is the program for the same….
Program for length of the last word in a string in Go (Golang)
Overview The objective is to find the length of the last word in a given string Example Program Here is the program for the same. Output Note: Check out our Golang Advanced…
Plus one program or Add one to an integer array in Go (Golang)
Overview An integer array is given. Overall this integer array represents a number. So let’s say the integer array name is digits then digitis[i] denote the ith digit of the integer. The…
Partition a linked list in Go (Golang)
Overview A linked list is given. Also, a target value is given. Partition the given linked list in such a way all values less than target values comes before all the values…
Best time to Buy-Sell Stocks Program in Go (Golang)
Overview An array prices is given where prices[i] represent the price of a stock on the ith day. You can only buy and sell once. Find the max profit you can earn…
Unique Paths Program in Go (Golang)
Overview There is an m*n grid. There is a robot at the position (0,0). The robot can only move in the right direction and down direction. What is the total number of…
Remove all occurrences of a given value in an array in place in Go (Golang)
Overview An integer array is given and a target element is given. Remove all occurrences of that target element from the array. The removal must be done in place Program Here is…
Merge two sorted arrays in Go (Golang)
Overview Two arrays are given. Both are sorted First array is of length m+n Second array is of n The objective is to merge these sorted arrays. The first array contains enough…