Bit Counting in Golang
The challenge
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 →In-depth guides, insights, and best practices for modern software engineering
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 →In this challenge, you have to write a method that folds a given array of integers by the middle x-times.
An example says more than a …
Read Article →Fmt provides printing to standard output (usually the console) and formatting of strings capabilities.
The main …
Read Article →Given a list lst and a number N, create a new list that contains each number of lst at most N times without reordering. For example if N …
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 →
Write a function that accepts a string, and returns true if it is in the form of a phone number.
Assume that any integer from 0-9 in any …
Sort elements in an array by decreasing frequency of elements. If two elements have the same frequency, sort them by increasing value. …
Read Article →