Blog Posts

How to Count the Characters in Python

January 5, 2022

The challenge The goal of this challenge is to write a function that takes two inputs: a string and a character.


Read More

How to Install Cuda driver for Nvidia on Ubuntu

January 4, 2022

If you have just upgraded Ubuntu on your AWS g4dn instance and need to install/reinstall Cuda drivers for your Nvidia chipset, then you can run the following:


Read More

How to List all Running Services on Ubuntu

January 3, 2022

If you need to view a list of all the services that are either running or stopped (or both) on an Ubuntu server, then you can use the following command:


Read More

[Solved] conflict: unable to remove repository reference in Docker

January 2, 2022

If you get the following error while trying to delete an image in Docker:


Read More

How to Upgrade an Ubuntu Server

January 1, 2022

Upgrading an Ubuntu Server is quite easy, just follow the below commands:


Read More

How to Solve Two-Sum in Java

December 31, 2021

The challenge Write a function that takes an array of numbers (integers for the tests) and a target number.


Read More

How to Sort the Gift Code in Java

December 30, 2021

The challenge Santa’s senior gift organizer Elf developed a way to represent up to 26 gifts by assigning a unique alphabetical character to each gift.


Read More

How to get the Numericals of a String in Java

December 29, 2021

You are given an input string. For each symbol in the string if it’s the first character occurrence, replace it with a ‘1’, else replace it with the amount of times you’ve already seen it.


Read More

How to Replace Noun Phrases with Pronouns in Golang

December 28, 2021

The challenge A Noun Phrase is a phrase that can be replaced by a pronoun [he/she/it].


Read More

Maximum Positive Integer Rotations in Golang

December 27, 2021

The challenge Write function MaxRot(n) which given a positive integer n returns the maximum number you got doing rotations similar to the above example.


Read More

How to “Dashatize It” in Java

December 26, 2021

The challenge Given a variable n, If n is an integer, Return a string with dash'-'marks before and after each odd integer, but do not begin or end the string with a dash mark.


Read More

How to create a Nickname Generator in Python

December 25, 2021

The challenge Write a nickname generator function, nicknameGenerator that takes a string name as an argument and returns the first 3 or 4 letters as a nickname.


Read More

Comparing Array Multiplicities in Java

December 24, 2021

The challenge Given two arrays a and b write a function comp(a, b) (orcompSame(a, b)) that checks whether the two arrays have the “same” elements, with the same multiplicities.


Read More

How to Find the Sum of Angles in Golang

December 23, 2021

The challenge Find the total sum of internal angles (in degrees) in an n-sided simple polygon.


Read More

How to Find the Max Tree Node Value in Java

December 22, 2021

The challenge You are given a binary tree. Implement the method findMax which returns the maximal node value in the tree.


Read More

How to String Search with a Wildcard in Java

December 21, 2021

The challenge The method below is the most simple string search algorithm.


Read More

How to get the AWS AccountID in Terraform

December 20, 2021

If you are automating AWS resources in Terraform, then you will want to not hardcode things as much as possible.


Read More

Error creating AppStream Fleet – InvalidRoleException

December 19, 2021

If you get the following error when trying to run some Terraform:


Read More

How to Create AWS AppStream resources in Terraform

December 18, 2021

AWS AppStream has finally made its way into the Terraform AWS Provider.


Read More

How to Stop a Goroutine in Golang

December 17, 2021

It’s possible to stop a Goroutine by sending a value into it via a signal channel:


Read More