[Algorithms] – Problem “Jumping on the Clouds” solved with go

Problem: Solution: Following the code implemented to solve it. package algoTest func JumpingOnClouds(c []int32) int { jumps :=0 i := … More

[Algorithms] – Problem regards repeated strings solved with go

Problem: Solution: Following the code to solve the problem. package algoTest import “strings” func RepeatedString(s string, n int64) int64 { … More

[Algorithms] – The classic Fibonacci with and without recursion in golang

What is Fibonacci? See more here What is Fibonacci formula? Fibonacci sequence, such that each number is the sum of … More

[Algorithms] – Creating an LRUCache in golang

What is an LRUCache? The LRU means discards the least recently used items first. It means that a cache implementation … More

[Golang] – Code example to calc roots

To calc the root we will use here the Newton Raphson Method. In this case, Newton’s formula is to approximate Sqrt(x) by … More

An algorithm which check a array and perform operations

Problem Given an array and an integer number perform the operations to increase or set the max value where if the value … More

An algorithm which returns the number of integers divisible by N in an sequenced interval [Y..Z].

Following the solution. public int algo(int Y, int Z, int N) { if ( Z==0 ) { return 1; } … More

An algorithm to find the smallest positive integer that does not occur in a given array.

Following examples. [1, 3, 6, 4, 1, 2, 7] then return 5 [-1, 1, 2, 3] the return 4 [−1, … More

An algorithm that checks if the values of an array form one or two numerical sequences starting from 1

If the values of the array can form one or two numerical sequences then return 1 otherwise return 0. For example … More

An algorithm to find the min value of the difference between the sum of all numbers from all possible two parts to which it can be divided

The solution is the min absolute value of |(A + … + A[D-1]) – (A[D] + … + A[N-1])| where A … More