Welcome To Golang By Example

Menu
  • Home
  • Blog
Menu

Tag: golang

Check if a string contains single or multiple whitespaces in Go (Golang)

Posted on February 10, 2023February 10, 2023 by admin

Overview A simple regex can be used to check if a string contains single or multiple white spaces in Go. Here is the program for the same Program Output Note: Check out…

Repeat a string multiple times in Go (Golang)

Posted on October 9, 2023October 9, 2023 by admin

Overview strings.Repeat method can be used to repeat a string multiple times in Go (Golang) Here is the link to this function in the Go strings package https://pkg.go.dev/strings#Repeat Here is the signature…

Remove Linked List Elements Program in Go (Golang)

Posted on September 15, 2023September 15, 2023 by admin

Overview Given a linked list and a value, delete all nodes from the linked list whose value is equal to the given value. Example 1 Example 2 Program Below is the program…

Recover Binary Search Tree Program in Go (Golang)

Posted on August 19, 2023August 19, 2023 by admin

Overview The root of a binary search tree is given. Two nodes of the binary search tree have been swapped. We need to fix the binary tree and recover the original structure…

Program for ugly number 2 in Go (Golang)

Posted on August 13, 2023August 13, 2023 by admin

Overview An ugly number is a number whose prime factors are limited to 2,3 and 5. We have already seen a program where given a number n returns true if it is…

Binary Tree Maximum Path Sum Program in Go (Golang)

Posted on July 30, 2023July 30, 2023 by admin

Overview A  binary tree is given. The objective is to find the maximum Path Sum in that binary tree.  A path in a binary tree is a sequence of nodes that are connected…

Sort characters by frequency in Go (Golang)

Posted on July 28, 2023July 28, 2023 by admin

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…

Check If N and Its Double Exist in Go (Golang)

Posted on July 25, 2023July 25, 2023 by admin

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)

Posted on July 25, 2023July 25, 2023 by admin

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)

Posted on July 21, 2023July 21, 2023 by admin

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…

Posts pagination

1 2 … 41 Next

Popular Articles

Golang Comprehensive Tutorial Series

All Design Patterns in Go (Golang)

Slice in golang

Variables in Go (Golang) – Complete Guide

OOP: Inheritance in GOLANG complete guide

Using Context Package in GO (Golang) – Complete Guide

All data types in Golang with examples

Understanding time and date in Go (Golang) – Complete Guide

©2025 Welcome To Golang By Example | Design: Web XP