How to Read from Standard Input in Golang
Reading from “standard input” is really useful if you are making a command-line application and require user input.
package main
import ( …
Read Article →
In-depth guides, insights, and best practices for modern software engineering
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 →Write a function that receives two strings and returns n, where n is equal to the number of characters we should shift the first string …
Read Article →Compare two strings by comparing the sum of their values (ASCII character code).
null …Given two integers a, b, find The sum of them, BUT You are not allowed to use the operators + and –
Notes
Count how many arguments a method is called with.
Examples
args_count(1, 2, 3) -> 3
args_count(1, 2, 3, 10) -> 4
You are given a list/array which contains only integers (positive and negative). Your job is to sum only the numbers that are the same …
Read Article →You are given a string. You must replace any occurrence of the sequence coverage by covfefe, however, if you don’t find the word …
Your task is to write a function toLeetSpeak that converts a regular english sentence to Leetspeak.
More about LeetSpeak You can read at …
Read Article →Count the number of occurrences of each character and return it as a list of tuples in order of appearance. For empty output return an …
Read Article →Given a credit card number we can determine who the issuer/vendor is with a few basic knowns.
Complete the function getIssuer() that …
Complete the function to find the count of the most frequent item of an array. You can assume that input is an array of integers. For an …
Read Article →Given an array/list [] of integers, Find the Nth smallest element in this array of integers
Notes
Sometimes you will find that your Mac is running very hot, and you may want to keep track of it over time to see if it’s persistent or only a …
Read Article →Split a given string into different strings of equal size.
Example:
Split the below string into other strings of size #3 …
Read Article →
If you are getting the following error in MySQL:
ERROR 1030 (HY000): Got error 168 from storage engine
Then this usually means that your server has …
Read Article →Given a sequence of numbers, find the largest pair sum in the sequence.
For example
[10, 14, 2, 23, 19] --> 42 (= 23 + 19)
[99, 2, …
Read Article →
Consider the word "abode". We can see that the letter a is in position 1 and b is in position 2. In the alphabet, a and b are …
Check to see if a string has the same amount of ‘x’s and ‘o’s. The method must return a boolean and be case insensitive. The …
Read Article →Find the sum of the odd numbers within an array, after cubing the initial integers. The function should return None if any of the values …
Given a positive integer n, calculate the following sum:
n + n/2 + n/4 + n/8 + ...
All elements of the sum are the results of integer …
Read Article →Preloaded for you is a class, struct, or derived data type Node (depending on the language) used to construct linked lists in this …