Categories

## [Coderbyte] – Different Cases [Easy]

I was surprised to see that some of my solutions are in top solutions on Coderbyte. The answer to this challenge is the 16th solution in the top 18 solutions. Coming back to the problem, here is what we have to do: Have the function DifferentCases(str) take the str parameter being passed and return it in upper camel case […]

Categories

## [Coderbyte] – H Distance [Easy]

The coding challenge for today is called “H Distance”. In short, this challenge asks us to find the number of characters that are not found in both strings. However, Coderbyte does a better job of explaining the problem: Have the function HDistance(strArr) take the array of strings stored in strArr, which will only contain two strings of equal […]

Categories

## [Exercism] – Pangram

I have found another coding website where you can solve challenges in 48 languages. Besides that, there are mentors that check your solutions and provide you feedback. You can check more about Exercism here. I will use Exercism alongside Coderbyte. The problem description below is taken from Exercism: Determine if a sentence is a pangram. A […]

Categories

## [Coderbyte] – Letter Changes [Easy]

For today’s article, we have the ‘Letter Changes’ problem. The full description from Coderbyte is below: Have the function LetterChanges(str) take the str parameter being passed and modify it using the following algorithm. Replace every letter in the string with the letter following it in the alphabet (ie. c becomes d, z becomes a). Then capitalize every vowel in this […]

Categories

## [Coderbyte] – Dash Insert [Easy]

This problem asks us to add a dash between each pair of odd numbers in the given string. A more detailed description from Coderbyte: Have the function DashInsert(str) insert dashes (‘-‘) between each two odd numbers in str. For example: if str is 454793 the output should be 4547-9-3. Don’t count zero as an odd number.  The first step is to create a […]

Categories

## [Coderbyte] – Time Convert [Easy]

The Time Convert challenge is the challenge I am going to explain in this article. The description below is taken straight from the Coderbyte website: Have the function TimeConvert(num) take the num parameter being passed and return the number of hours and minutes the parameter converts to (ie. if num = 63 then the output should be 1:3). Separate the number of hours and minutes with […]

Categories

## [Coderbyte] – AB Check [Easy]

Have the function ABCheck(str) take the str parameter being passed and return the string true if the characters a and b are separated by exactly 3 places anywhere in the string at least once (ie. “lane borrowed” would result in true because there is exactly three characters between a and b). Otherwise return the string false.  I have tried to avoid using a for loop for this […]

Categories

## [Coderbyte] – ASCII Conversion [Easy]

Before posting the solutions on the blog, I solve them on Coderbyte. Thus, when I have started writing the post, I have observed that my initial solution makes use of two for loops. That means the initial solution has a quadratic time complexity – O(N^2), which is not desired. However, the new solution is making […]