Equal Stacks

While I was waiting for some tests to complete I checked my Gmail and found a message from HackerRank suggesting a challenge. The Equal Stacks challenge may be found under Practice > Data Structures > Stacks > Equal Stacks. I read the description for the problem and decided to tackle it using stacks; how creative of me. Continue reading “Equal Stacks”

Transform Strings

It is Sunday morning in the Twin Cities of Minneapolis and St. Paul. Woke up around 04:30 AM and spent the next couple hours working on Machine Learning with Big Data. It is a Coursera course. Have one more week to complete this course; so far so good. After preparing and having breakfast with my best half, return to my computer. Continue reading “Transform Strings”

Parse Text

UPDATE – April 09, 2018When I started this post, I was thinking in several follow ups in order to try different approaches and be able to continue to improve on previous passes by adding code or starting from scratch when a new idea came up. I was interested in showing a normal progression that the reader would encounter when developing software. In the days that passed, I decided to limit the subject to a single post. Please let me know if you encounter an issue or would like for me to expand on this entry.

Sometime last week I attempted to solve a simple online challenge. The challenge dealt with parsing a string of text and then obtaining information from the string. There are probably thousands of variants to the challenge. I am not going to cover the exact challenge in this post. I will make my own. Will start simple and will get more complex each time we add a new obstacle. Continue reading “Parse Text”

New, Duplicate or in Segment

This is my first attempt to create a set of two challenges for HackerRank. If you are interested in generating a new challenge you should try the Challenge Guidelines link and read all about how to proceed.

After reading the guidelines I created the following information for the “New, Duplicate or In Segment” challenge: Continue reading “New, Duplicate or in Segment”

Overload Operators C++

Over the weekend I received an automated email message from HackerRank to solve the following challenge: https://www.hackerrank.com/challenges/overload-operators?utm_campaign=challenge-recommendation&utm_medium=email&utm_source=24-hour-campaign

If interested, please take a look at the challenge description.

As usual, I try to address the challenge without consulting the provided code or look at the discussions. After losing some time on my own, I check the discussions and the code provided to solve the challenge. In this case the following read only code was provided: Continue reading “Overload Operators C++”

Introduction Challenges C++

As I mentioned in a previous post, I will be solving challenges using C++ and Java. Earlier today I found in HackerRank a set of challenges for C++. The set seems to be split into the following categories:

  • Introduction
  • Strings
  • Classes
  • STL
  • Inheritance
  • Other Concepts

As usual, I like to start simple and progress towards the most complicated. In this blog entry I cover my solutions written in C++ using Microsoft Visual Studio 2013 Professional. Continue reading “Introduction Challenges C++”

Down to Zero II

This post is related to HackerRank challenge “Down to Zero II” which seems to require dynamic programming to get it solved. I tried a top down (which I modified into a bottom up) approach. Sorry but I overwrote the code for my first approach. Should have started a new method or saved it in Git.

Please take a look at the challenge at:  https://www.hackerrank.com/challenges/down-to-zero-ii

The idea of Dynamic Programming is to attempt to use existing solutions instead of computing them again each time a similar problem needs to be solved. For example, if you have computer a factor for 32 = 2 * 2 * 2 * 2 * 2 (or 2^5), then when you are computing 64 = 32 * 2 (or 2^6) you could just look up the result associated with 32 and incorporate it into the solution of 64. Continue reading “Down to Zero II”