Remove an Exclamation Mark from the End of String Using Python

The challenge Remove a exclamation mark from the end of string. For a beginner kata, you can assume that the input data is always a string, no need to verify it. Examples Test cases The solution in Python Option 1: Option 2 (using endswith): Option 3 (simple): Option 4 (using reg … | Continue reading


@ao.gl | 3 years ago

How to “Rock Paper Scissors” in Java

The challenge Let’s play Rock Paper Scissors! You have to return which player won! In case of a draw return Draw!. Examples: The rules of the game Rock Paper Scissors The rules of the game Rock Paper Scissors is quite simple. Rock beats scissors, scissors beats paper, and paper b … | Continue reading


@ao.gl | 3 years ago

Get the Mean of an Array in Java

The challenge It’s the academic year’s end, fateful moment of your school report. The averages must be calculated. All the students come to you and entreat you to calculate their average for them. Easy ! You just need to write a script. Return the average of the given array round … | Continue reading


@ao.gl | 3 years ago

Character with Longest Consecutive Repetition in Java

The challenge For a given string s find the character c (or C) with longest consecutive repetition and return: where l (or L) is the length of the repetition. If there are two or more characters with the same l return the first in order of appearance. For empty string return: Tes … | Continue reading


@ao.gl | 3 years ago

Check if List contains Item in Python

The challenge Create a method that accepts a list and an item, and returns true if the item belongs to the list, otherwise false. Test cases The solution in Python | Continue reading


@ao.gl | 3 years ago

How to Remove Vowels with Python

The challenge Create a function called shortcut to remove all the lowercase vowels in a given string. Examples Don’t worry about uppercase vowels. Test cases The solution in Python Option 1 (long way): Option 2 (using translate): Option 3 (using join): Option 4 (using lambda): Op … | Continue reading


@ao.gl | 3 years ago

How to Sort a List in Python

In this tutorial, you will learn how to sort a list in Python, by following the below three steps: Options to sort a list in Python What is the difference between “sort” and “sorted” An example of using “sort” An example of using “sorted” How to Sort a List in Reverse Sort a list … | Continue reading


@ao.gl | 3 years ago

How to Divide a Number in Python

The challenge Your task is to create functionisDivideBy (or is_divide_by) to check if an integer number is divisible by each out of two arguments. A few cases: Test cases Understanding how to solve this To resolve this problem, we need to understand how to find if a number can be … | Continue reading


@ao.gl | 3 years ago

Backspaces in String Challenge Using Java

The challenge Assume "#" is like a backspace in string. This means that string "a#bc#d" actually is "bd" Your task is to process a string with "#" symbols. Examples Test cases The solution in Java Option 1: Option 2 (using regex): Option 3 (using substring): | Continue reading


@ao.gl | 3 years ago

How to Write a Custom Comparator in Python

Generally, you want to use the built-in sorted() function which takes a custom comparator as its parameter. We need to pay attention to the fact that in Python 3 the parameter name and semantics have changed. How the custom comparator works When providing a custom comparator, it … | Continue reading


@ao.gl | 3 years ago

How to Sort an Integer in Python

Learn how to sort an integer in python with this quick tutorial. Use the ready-made function available to sort an integer ascending/descending! | Continue reading


@ao.gl | 3 years ago

Conway’s Game of Life – Unlimited Edition – In Python

What is this? Conways’s Game Of Life is a Cellular Automation Method created by John Conway. This game was created with Biology in mind but has been applied in various fields such as Graphics, terrain generation,etc.. geeksforgeeks.org How the game works Because the Game of Life … | Continue reading


@ao.gl | 3 years ago

Most frequently used words in a text with Python

The challenge Write a function that, given a string of text (possibly with punctuation and line-breaks), returns an array of the top-3 most occurring words, in descending order of the number of occurrences. Assumptions: A word is a string of letters (A to Z) optionally containing … | Continue reading


@ao.gl | 3 years ago

The SongDecoder Dubstep Challenge with Java

The challenge Polycarpus works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them. Let’s assume that a song consists of some number of words (that don … | Continue reading


@ao.gl | 3 years ago

The “Split Strings” Challenge Using Java

The challenge Complete the solution so that it splits the string into pairs of two characters. If the string contains an odd number of characters then it should replace the missing second character of the final pair with an underscore (‘_’). Examples: Test cases The solution in J … | Continue reading


@ao.gl | 3 years ago

Converting to PigLatin with Python

The challenge Move the first letter of each word to the end of it, then add “ay” to the end of the word. Leave punctuation marks untouched. Examples Test cases How to write the code in Python | Continue reading


@ao.gl | 3 years ago

Solving the “Double Cola” Challenge Using Java

The challenge Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a “Double Cola” drink vending machine; there are no other people in the queue. The first one in the queue (Sheldon) buys a can, drinks it and doubles! The resulting two Sheldons go to the end of the que … | Continue reading


@ao.gl | 3 years ago

Solving the “Mexican Wave” Challenge Using Java

The challenge Task Your task is to create a function that turns a string into a Mexican Wave. You will be passed a string and you must return that string in an array where an uppercase letter is a person standing up. Rules 1.  The input string will always be lowercase but may be … | Continue reading


@ao.gl | 3 years ago

Solving the “Catching Car Mileage Numbers” Challenge Using Python

The challenge “7777…8?!??!“, exclaimed Bob, “I missed it again! Argh!” Every time there’s an interesting number coming up, he notices and then promptly forgets. Who doesn’t like catching those one-off interesting mileage numbers? Let’s make it so Bob never misses another interest … | Continue reading


@ao.gl | 3 years ago

How to Convert Numeric Words into Numbers Using Python

Challenge Using Python, we want to convert words to numbers. In this challenge, we will explore how to convert a string into an integer. The strings simply represent the numbers in words. Examples: “one” => 1 “twenty” => 20 “two hundred forty-six” => 246 “seven hundred eighty-thr … | Continue reading


@ao.gl | 3 years ago

Solve the Triangle of Odd Numbers Using Python

The challenge Given the triangle of consecutive odd numbers: Calculate the row sums of this triangle from the row index (starting at index 1) e.g.: Test cases The solution in code While there are many ways to achieve this, the absolute most simple is to realise that the solution … | Continue reading


@ao.gl | 3 years ago

Get the next biggest number with the same digits using Python

The challenge Create a function that takes a positive integer and returns the next bigger number that can be formed by rearranging its digits. For example: If the digits can’t be rearranged to form a bigger number, return -1 (or nil in Swift): Test cases The solution in Python An … | Continue reading


@ao.gl | 3 years ago

Solving Tribonacci Sequence with Python

The challenge As the name may already reveal, it works basically like a Fibonacci, but summing the last 3 (instead of 2) numbers of the sequence to generate the next. So, if we are to start our Tribonacci sequence with [1, 1, 1] as a starting input (AKA signature), we have this s … | Continue reading


@ao.gl | 3 years ago

The Casino Chips Problem Solved with Python

The challenge You are given three piles of casino chips: white, green and black chips: the first pile contains only white chips the second pile contains only green chips the third pile contains only black chips Each day you take exactly two chips of different colors and head to t … | Continue reading


@ao.gl | 3 years ago

Find the Longest Common Prefix Using Python

The challenge Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1: Input: ["flower","flow","flight"] Output: "fl" Example 2: Input: ["dog","racecar","car"] Output: "" Explanation … | Continue reading


@ao.gl | 3 years ago

Check If Valid Sudoku Blocks in Java

The challenge of solving valid Sudoku blocks Determine if a 9×9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: Each row must contain the digits 1-9 without repetition. Each column must contain the digits 1-9 without repetition. … | Continue reading


@ao.gl | 3 years ago

Rotate an Array K Times in Python

The challenge Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate 1 steps to the right: [7,1,2,3,4,5,6] rotate 2 steps to the right: [6,7,1,2,3,4,5] rotate 3 … | Continue reading


@ao.gl | 3 years ago

Facebook’s Custom IPv6 Range

I noticed an interesting thing with a certain visitor after posting a blog post to Facebook. The IP address that the Facebook crawler uses to visit the site on callback to get meta-data has a custom IPv6 sub-range. Notice 2a03:2880:ff:1a::face:b00c How this is done The IPv4 addre … | Continue reading


@ao.gl | 3 years ago

How to use a Java HashSet by example

What is a HashSet A HashSet is an unordered collection containing unique elements. It has the standard collection operations Add, Remove, Contains, but since it uses a hash-based implementation, these operations are O(1) Learn with a Programming Question Given an integer array wi … | Continue reading


@ao.gl | 3 years ago

Finding Number Complements Using Java

The problem Given a positive integer num, output its complement number. The complement strategy is to flip the bits of its binary representation. Example 1: Input: num = 5 Output: 2 Explanation: The binary representation of 5 is 101 (no leading zero bits), and its complement is 0 … | Continue reading


@ao.gl | 3 years ago

Self Dividing Numbers Using Python

Introduction A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0. Also, a self-dividing number is not allowed to contain the digit zero. Given a lower and … | Continue reading


@ao.gl | 3 years ago

All About Distributed Databases

A database “is a structured collection of data. Card indices, printed catalogues of archaeological artefacts and telephone directories are all examples of databases”. We are going to examine databases that are prevalent in computer systems and go through the core differences betw … | Continue reading


@ao.gl | 3 years ago

Assessing Reusable Parts in a Software Architecture

During the Software Development Life Cycle (SDLC) the development team will come to realise that parts of any application have already been created before and there is the potential for those parts to be reused time and again going forward. In the last few years, the culture of s … | Continue reading


@ao.gl | 3 years ago

Functions of an Operating System

I am in a bit of an unusual situation where “I use” a combination of three different laptops, which each run different platforms. Namely; MacOS primarily at work with a combination of Linux servers and then Windows as well as Ubuntu on two separate home laptops that I switch betw … | Continue reading


@ao.gl | 3 years ago

Comparing Java and JavaScript

Perhaps the first thing that most people ask when they hear the names of these two programming languages are. “Why do they have the same name?” and “Are they the same thing?”. There is a general misconception that because Java and Javascript share a similar name to one another, t … | Continue reading


@ao.gl | 4 years ago

Entity and Referential Integrity in Relational Databases

Data integrity is the overall completeness, accuracy and consistency of data (Techopedia, n.d.). In order to achieve data integrity, it is important to analyse Entity and Referential integrity constraints. Entity Integrity Focuses on Primary keys. Each table should have a primary … | Continue reading


@ao.gl | 4 years ago

Learn Golang as a Python Developer

Learn the Golang programming language as a Python developer in this tutorial that gets you started in the right direction. | Continue reading


@ao.gl | 4 years ago

Data Warehouses vs. Data Marts

Although the terms “data warehouse” and “data mart” sound similar, they are quite different. It is important to first understand how they differ in order to define some characteristics and practical applications for each. Serra (2012) has a great explanation of data warehouses as … | Continue reading


@ao.gl | 4 years ago

Amazon’s custom Whois date entry

Whois is an online service that let’s you know registration information about a website or IP address. For the most part, Whois aggregations are not that standard, however, per gTLD (.com, .net, .yourkitchsink) they try their best to apply the same overall guidance and regulatory … | Continue reading


@ao.gl | 4 years ago

Graph Databases and Their Properties

The concept of a graph in mathematics is simply a collection of elements which are typically called Nodes and are joined together by Edges. Each Node represents a piece of information in the graph and each Edge represents some relationship or connection between any of the two Nod … | Continue reading


@ao.gl | 4 years ago

Apache Kafka’s Role in Big Data Streaming Analytics

The world of Big Data started out as a way of storing and querying obscene amounts of information by comparison to what yesteryears were able to achieve. However, most value in said data is primarily found in the real time or streaming information that is presented as it first en … | Continue reading


@ao.gl | 4 years ago

Overloading Operators in Java

As with many programming languages such as C, C++ and C# (known commonly as the C family), it is possible to “overload methods” (sometimes called functions if not used in classes, such as C) in order to take a different amount of parameters so that they can be used in multiple sc … | Continue reading


@ao.gl | 4 years ago

How to get the last element of a list in Python

Let’s say that you have a Python list with the following 5 foods: How do we go about getting the last item? Option 1 It’s actually really easy, you can select the index item by it’s total length minus one. Option 2 Python has some really fantastic functionality around making your … | Continue reading


@ao.gl | 4 years ago

How to Reorder Data in Log Files Using Python

Let’s say that you have an array or a list, or logs. Each of these logs is a space-delimited string of words. For example: logs = ["dig1 8 1 5 1","let1 art can","dig2 3 6","let2 own kit dig","let3 art zero"] The task is to reorder these logs and return them in the following accep … | Continue reading


@ao.gl | 4 years ago

How to implement a Queue using Stacks in Python

A common programming interview question, and for a change, one that you will actually be able to use in the job, is that of implementing a Queue by means of using Stacks in Python. The 5 common operations of a Queue Instantiation push(val) pop() peek() empty() What each operation … | Continue reading


@ao.gl | 4 years ago

How to make a Python script Pip-installable

As Python developers, we’ve all used pip to install applications, but speaking to other Python developers, it’s not always clear how to make your own application/script pip-installable. If you want to automatically publish your Python to PyPi, check out makepip automation tip Ste … | Continue reading


@ao.gl | 4 years ago

How to Host an AngularJS Site on AWS S3

Learn how to host an AngularJS website in AWS S3 and fix the common 404 or 403 errors by updating the Redirection rules directly. | Continue reading


@ao.gl | 4 years ago

Why Password Managers Are Not the Solution

Why a Password Manager? Password managers exist for two main reasons. Firstly, to generate strong passwords and secondly so that you don’t end up using the same password on all your websites or apps that you frequent. On the surface, that sounds like a pretty good idea. Imagine y … | Continue reading


@ao.gl | 4 years ago