How to Find the Smallest Integer in the Array in Golang
The challenge
Given an array of integers your solution should find the smallest integer.
For example:
- Given
[34, 15, 88, 2]your solution will return …
104 articles about go development, tools, and best practices
Given an array of integers your solution should find the smallest integer.
For example:
[34, 15, 88, 2] your solution will return …You are given an array of arrays and your task will be to return the number of unique arrays that can be formed by picking exactly one …
Read Article →Implement a function that calculates the sum of the integers inside a string. For example, in the string …
Read Article →Complete the solution so that it reverses the string passed into it.
'world' => 'dlrow'
'word' => …
Read Article →
For a given list [x1, x2, x3, ..., xn] compute the last (decimal) digit of x1 ^ (x2 ^ (x3 ^ (... ^ xn))).
Example:
last_digit({3, 4, 2}, …
Read Article →
An array is circularly sorted if the elements are sorted in ascending order but displaced, or rotated, by any number of steps.
Complete …
Read Article →Write a function toWeirdCase (weirdcase in Ruby) that accepts a string, and returns the same string with all even indexed characters in …
Create a function that takes a Roman numeral as its argument and returns its value as a numeric decimal integer. You don’t need to …
Read Article →Clock shows h hours, m minutes and s seconds after midnight.
Your task is to write a function that returns the time since midnight in …
Read Article →Write a function that takes an integer as input, and returns the number of bits that are equal to one in the binary representation of …
Read Article →Find the next higher number (int) with same ‘1’- Bits.
I.e. as much 1 bits as before and output next higher than input. Input is …
Write a function named first_non_repeating_letter that takes a string input, and returns the first character that is not repeated …
Return the last digit of the nth element in the Fibonacci sequence (starting with 1,1, to be extra clear, not with 0,1 or other …
Read Article →Write an algorithm that will identify valid IPv4 addresses in dot-decimal format. IPs should be considered valid if they consist of four …
Read Article →Fmt provides printing to standard output (usually the console) and formatting of strings capabilities.
The main …
Read Article →Reading from “standard input” is really useful if you are making a command-line application and require user input.
package main
import ( …
Read Article →
If you need to install Golang on WSL under Windows 10 or higher, you can follow these few steps.
sudo rm …
Read Article →
Create a function that repeats each character by the amount of it’s index value of the original string.
You are given two interior angles (in degrees) of a triangle.
Write a function to return the 3rd.
Note: only positive integers will be …
Read Article →In this challenge, your function receives an array of integers as input. Your task is to determine whether the numbers are in ascending …
Read Article →Given a string, capitalize the letters that occupy even indexes and odd indexes separately, and return as shown below. Index `` will be …
Read Article →Create a method IsUpperCase to see whether the string is ALL CAPS. For example:
type MyString string
MyString("c").IsUpperCase() …
Read Article →
In Go, there are multiple ways to make a string UpperCase, each of them are by using the strings package.
strings.ToUpper):func ToUpper(str …
Given a string of words, return the length of the shortest word(s).
The input string will never be empty and you do not need to account …
Read Article →