Overview An input string is given. The objective is to sort the string based on frequency. We have to sort based on decreasing order of the frequency of characters. Let’s understand it…
Author: admin
Program for Income Tax Paid in Go (Golang)
Overview A 2d array is given which represents the bracket of income tax. The input array is brackets where which means that ith bracket has an upper bound of upperi and is…
Check If N and Its Double Exist in Go (Golang)
Overview An array is given. The objective is to find if there exists any number for which it’s double also exists. Example 1 Example 2 The idea is to use a map…
Program for Pascal’s Triangle in Go (Golang)
Overview The objective is to find the print n number of rows of Pascal’s triangle. The number n is given as an input to the program Example 1 Example 2 Refer to…
Longest Consecutive Sequence Program in Go (Golang)
Overview An integer array is given. Find the length of the longest consecutive sequence in it. Let’s see an example to understand it Example 1 Example 2 The naive idea is to…
Print all Binary Tree Paths in Go (Golang)
Overview The root of a tree is given. The objective is to print all the tree paths starting with the root. Example Output: Program Below is the program for the same Output:…
Reverse vowels of a string in Go (Golang)
Overview A string is given. The objective is to reverse all vowels in that string Example 1 Example 2 Program Below is the program for the same Output: Note: Check out our…
Determine Whether Matrix Can Be Obtained By Rotation in Go (Golang)
Overview Two n*n matrices are given source and target. We have to determine whether the source matrix can be converted to the target matrix by doing 90-degree rotations any number of times…
Detonate the maximum bombs program in Go (Golang)
Overview A 2d array is given where each entry in an array has three values i- Denotes the x coordinates of the bomb j – Denotes the y coordinates of the bomb…
Rotting Oranges Program in Go (Golang)
Overview An m*n matrix is given where each entry contains three values 0 – Denotes that entry is empty 1 – Denotes that entry contains fresh orange 2 – Denotes that the…