How to Validate ISBN-10 numbers in Golang
The challenge
ISBN-10 identifiers are ten digits long. The first nine characters are digits 0-9. The last digit can be 0-9 or X, to indicate a value …
101 articles about go development, tools, and best practices
ISBN-10 identifiers are ten digits long. The first nine characters are digits 0-9. The last digit can be 0-9 or X, to indicate a value …
A Noun Phrase is a phrase that can be replaced by a pronoun [he/she/it].
For example, in the sentence:
a girl ate the cookie
“A …
Read Article →Write function MaxRot(n) which given a positive integer n returns the maximum number you got doing rotations similar to the above …
Find the total sum of internal angles (in degrees) in an n-sided simple polygon.
N will be greater than 2.
Option …
Read Article →It’s possible to stop a Goroutine by sending a value into it via a signal channel:
exit := make(chan bool)
go func() {
for {
select …
Read Article →
Complete the method which returns the number which is most frequent in the given input array. If there is a tie for the most frequent …
Read Article →The two oldest ages function/method needs to be completed. It should take an array of numbers as its argument and return the two highest …
Read Article →Implement a function which behaves like the uniq command in UNIX.
It takes as input a sequence and returns a sequence in which all …
Read Article →If you need to check if a string is empty in Go, then there are two possible ways to immediately verify this:
if len(s) …
Read Article →
If you need to read a file line by line in Go, then you can use the bufio package as follows:
package main
import (
"bufio" …
Read Article →
Consider the function
f: x -> sqrt(1 + x) - 1 at x = 1e-15.
We get: f(x) = 4.44089209850062616e-16
This function involves the …
Read Article →Write a function partlist that gives all the ways to divide an array of at least two elements into two non-empty parts.