How to Square Every Digit in C++
The challenge You are asked to square every digit of a number and concatenate them. For example, if we run 9119 through the function, 811181… Read More »How to Square Every Digit in C++
The challenge You are asked to square every digit of a number and concatenate them. For example, if we run 9119 through the function, 811181… Read More »How to Square Every Digit in C++
The challenge Return the number (count) of vowels in the given string. We will consider a, e, i, o, u as vowels for this challenge (but not y). The input string will… Read More »How to Count Vowels in C++
The challenge Given the triangle of consecutive odd numbers: Calculate the sum of the numbers in the nth row of this triangle (starting at index 1)… Read More »How to Calculate the Sum of the Numbers in the Nth row of a Triangle in Golang
If you are using PowerShell and trying to run a terraform init, you may get an error as follows: Error: error accessing remote module registry… Read More »[Solved] Terraform Error accessing remote module registry in PowerShell
If you want to recursively delete a directory/folder using PowerShell, then you have 2 options. Option 1 – With LiteralPath and Force Option 2 –… Read More »How to Recursively Delete a Directory in PowerShell
If you get the following message, then there’s a very easy fix:npm ERR! could not determine executable to run The solution – using npm The… Read More »[Solved] npm ERR! could not determine executable to run
If you get the following error and need a solution, then look no further! Option 1 – With npm First, remove the node-sass dependency from… Read More »[Solved] npm ERR! path node_modules/node-sass
You can install lodash through yarn as follows: Step 1 – Install Lodash to get the Library Step 2 – Get the Typescript info
If you need to SHA256 a String in Go, then you can use the crypto/sha256 package. SHA256 a String in Go The output will look… Read More »How to SHA256 a String in Golang
Go ships with an encoding/base64 package that allows for encode and decoding of Base64 strings. Import the base64 package and then start using it! Base64… Read More »How to Base64 Encode/Decode in Golang
Quick solution In short, you can just do this: Examples and an explanation In Java 8 and above, you just need to import the Base64… Read More »How to Base64 Encode a String in Java
If you have an aws_lambda_function block that needs to make use of environment variables, then you can simply do the following: The above example creates… Read More »How to add a Lambda Environment Variable in Terraform
The challenge You will be given an array of integers whose elements have both a negative and a positive value, except for one integer that… Read More »How to perform Array Element Parity in Golang
The challenge Given a string str, reverse it omitting all non-alphabetic characters. Examples: For str = “krishan”, the output should be “nahsirk”. For str = “ultr53o?n”, the output should… Read More »How to Reverse Letters in Kotlin
The challenge Get the ASCII value of a character. The solution in Kotlin Option 1: Option 2: Option 3: Test cases to validate our solution
You have 2 options: Option 1 – Recommended (Using npx) Option 2 – Older way (Using npm globally)
The challenge Take the following IPv4 address: 128.32.10.1 This address has 4 octets where each octet is a single byte (or 8 bits). 1st octet… Read More »How to Convert IPv4 to int32 in Javascript
The challenge Finish the solution so that it takes an input n (integer) and returns a string that is the decimal representation of the number grouped by… Read More »How to Solve the Grouped by Commas Challenge in Javascript
You have 3 options here: Option 1: use tee with sed Option 2: use > with sed Option 3: use sed with -i option
If you have a BigNumber when using web3, then you can convert this to a regular Javascript Number using the ethers library as follows: Ethers… Read More »How to Convert BigNumber to Int/Number in Ethers/Web3
The challenge Write a function that when given a number >= 0, returns an Array of ascending length subarrays. Note: the subarrays should be filled with 1s… Read More »How to Create a Pyramid Array in Javascript
The challenge Your job is to create a calculator which evaluates expressions in Reverse Polish notation. For example expression 5 1 2 + 4 * + 3… Read More »How to Create a Reverse Polish Notation Calculator in Javascript
If you need to declare a global variable in React, then you can do the following: Create a file called config.js Then import the config… Read More »How to declare a global variable in React?
The challenge An Arithmetic Progression is defined as one in which there is a constant difference between the consecutive terms of a given series of… Read More »How to Find the Missing Term in an Arithmetic Progression in Javascript
The challenge The main idea is to count all the occurring characters in a string. If you have a string like aba, then the result should… Read More »How to Count Characters in a Javascript String