I am currently using my laptop. I prefer using a desktop with a couple monitors; but such is life.
It is almost time to complete the first 2-hour block of the day. I work using a technique called Deep Work. Today I got up at 05:00 AM and have been at it for about two hours. I believe I have enough time to complete this post.
I received an email message from HackerRank with the Game of Thrones – 1 challenge. The challenge is simple. We have to determine if a string of characters may be converted to a palindrome or not. Keep in mind that palindromes longer than one character are made up of pairs of characters. Continue reading “Game of Thrones – I”
Earlier this morning I took a look at the Strong Password challenge in HackerRank. I just want to exercise my skills processing text / strings with Java.
The idea is to check if a password entered by a user follows the requirements stipulated in the challenged for a strong password. If it does not, one needs to return the number (not types) of characters missing to make current password specified by the user strong. Continue reading “Strong Password”
I received a message from HackerRank to solve the Modified Kaprekar Numbers challenge. Had to look up on-line what a Kaprekar number is.
My first goal was to generate the actual Kaprekar numbers. Once I was done with that I went after the actual requirements for the challenge. Continue reading “Modified Kaprekar Numbers”
I took a look at the Extra Long Factorials at the HackerRank web site. If interested take a look at the requirements.
The challenge is to print the factorial for a number in the range 1 <= N <= 100. I used Java 8 to solve the challenge.
A screen capture of the console of the Eclipse IDE using the test data follows: Continue reading “Extra Long Factorials”
Decided to take a stab at “Binary Search: Ice Cream Parlor” challenge in Hacker Rank. If interested you can get the requirements at the following URL: https://www.hackerrank.com/challenges/ctci-ice-cream-parlor
The general idea is to solve the sum of two numbers. I will address more on the subject of sum of two numbers on the second part of this post.
It is nice that Hacker Rank has been putting links to short videos with some challenges. In this case there is a video on Binary Search by Gayle Laakmann McDowell author of “Cracking the Coding Interview”. I watched the video. It was simple and to the point. Gayle covers the subject with an implementation using a recursive approach which she then converts to a loop implementation. Continue reading “Ice Cream Parlor – Part I”
I took a look at the “Is This a Binary Search Tree?” challenge at HackerRank. If interested in learning about this challenge and associated requirements use the following URL: https://www.hackerrank.com/challenges/ctci-is-binary-search-tree
The idea is quite simple. A BST should have all nodes in an ascending order when traversed using an in order traversal algorithm. If they do not, a value in a node is out of order rendering the tree as an invalid BST. Continue reading “Is this a Binary Search Tree”
I received a message from HackerRank suggesting the BotClean challenge. If interested take a look at the requirements at the following URL: https://www.hackerrank.com/challenges/botclean
I had an issue with the Output Format description. Some time ago I looked at a different challenge and my solution generated a set of steps in order to complete each task. In this case only one step may be displayed at a time. Seems that the code that invokes the method next_move() updates the coordinates and the board each time after executing a move. Continue reading “BotClean”
I selected the next unsolved challenge at HackerRank in the section labeled Cracking the Coding Interview. If interested you may use the following URL to get to the challenge: https://www.hackerrank.com/challenges/ctci-balanced-brackets
It seems to me like I have already solved this challenge.
Following is the console of the Eclipse Neon IDE: Continue reading “Balanced Brackets – Possible Second Attempt”