How to Sort the Gift Code in Java
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 …
Read Article →In-depth guides, insights, and best practices for modern software engineering
Santa’s senior gift organizer Elf developed a way to represent up to 26 gifts by assigning a unique alphabetical character to each …
Read Article →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 …
Read Article →A Noun Phrase is a phrase that can be replaced by a pronoun [he/she/it].
For example, in the sentence:
a girl ate the cookie
“A …
Read Article →Write function MaxRot(n) which given a positive integer n returns the maximum number you got doing rotations similar to the above …
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 …
Write a nickname generator function, nicknameGenerator that takes a string name as an argument and returns the first 3 or 4 letters as a …
Given two arrays a and b write a function comp(a, b) (orcompSame(a, b)) that checks whether the two arrays have the “same” …
Find the total sum of internal angles (in degrees) in an n-sided simple polygon.
N will be greater than 2.
Option …
Read Article →You are given a binary tree. Implement the method findMax which returns the maximal node value in the tree.
For example, the maximum in …
Read Article →The method below is the most simple string search algorithm. It will find the first occurrence of a word in a text string.
haystack = …
If you are automating AWS resources in Terraform, then you will want to not hardcode things as much as possible.
Terraform makes it possible to pull …
Read Article →If you get the following error when trying to run some Terraform:
error creating Appstream Fleet (): InvalidRoleException: AppStream 2.0 encountered …
AWS AppStream has finally made its way into the Terraform AWS Provider.
If you are using hashicorp/aws version 3.67 or above, then you can do the …
It’s possible to stop a Goroutine by sending a value into it via a signal channel:
exit := make(chan bool)
go func() {
for {
select …
Read Article →
If you need to create an empty branch in git, you can follow one of the below options.
If you are using git version 2.27 or newer, then follow the …
Read Article →Given a lowercase string that has alphabetic characters only and no spaces, return the highest value of consonant substrings. Consonants …
Read Article →This function should test if the factor is a factor of base.
Return true if it is a factor or false if it is not.
About factors …
Read Article →There are 6 binary/bitwise operators in Python:
~)&)|)^)<<)>>)A …
Read Article →Given a string "abc" and assuming that each letter in the string has a value equal to its position in the alphabet, our string …
If you use Homebrew – and you probably should if you’re on a Mac – then you have probably installed various different applications and packages …
Read Article →Using Firebase and get the following error in the console?
Uncaught Error in onSnapshot: FirebaseError: Missing or insufficient …
If you try and run npm i and get Error: Cannot find module '../lib/cli.js', then you can easily fix the problem by running the following.
If you’ve tried to use git commit in GitHub Actions before, you may have come across the following error messages:
Author identity unknown
*** …
Read Article →
If you have been handed the Acquiring state lock error message about ConditionalCheckFailedException: The conditional request then you have 2 options …