Categories
Array Coderbyte Data Structures and Algorithms Python String manipulation

[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
Array Coderbyte Data Structures and Algorithms Python String manipulation

[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 String manipulation

[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 Data Structures and Algorithms Easy Python String manipulation

[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 Data Structures and Algorithms Easy Maths Python String manipulation Uncategorized

[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 Data Structures and Algorithms Python String manipulation

[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 Data Structures and Algorithms Python String manipulation

[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 Easy LeetCode Python String manipulation

[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 […]

Categories
Coderbyte Data Structures and Algorithms Easy Python Uncategorized

[Coderbyte] – Array Addition I [Easy]

I want to start this post by mentioning that I have moved from LeetCode to Coderbyte for a while. The reason for doing so is because Coderbyte offers a discount on the premium plan for students. The premium membership offers access to all the coding challenges (200+), and it offers step-by-step solutions as well. Also, […]

Categories
Data Structures and Algorithms Easy LeetCode Python

[LeetCode] – Reverse Words in a String III [Easy]

The next challenge I am going to explain is how to reverse the words in a String. This one is a little bit tricky because we have to take into account the whitespace and the initial order of the words. Below we have the challenge: Given a string, you need to reverse the order of […]