Introduction The distinction between regular and static variables in C++ is a such a confusing topic for many beginners including students and programers. In this short article, I am going to provide an brief explanation and hopefully remove the ambiguity. …

## Python Power Function

Syntax The power function in Python can be easily computed by importing the math module as follows: import math # This will print 8 which is 2 to the power 3 print pow(2, 3) You can alternatively use the ** …

## Python for loop

Introduction Any computer algorithm requires two control flow structures: iteration and selection. Our topic today is mainly about iteration using the Python for loop. The goal of this post is to achieve three objectives: Provide a beginner introduction to the …

## Amicable Numbers

Amicable Numbers Definition Two positive integer numbers (m, n) are amicable if the sum of the proper divisors of (m) is equal to (n) and the sum of the proper divisors of (n) is equal to (m). A proper divisor …

## Java Two Dimensional String Array Iterator

Problem Given the signature of the method below. It receives a two dimensional array of strings. Provide implementation that iterates through each string in each sub-array in the order they are provided but it skips null values public static Iterator …

## Java String Array of Iterators

Problem Given the Java method signature below. It receives an array of string iterators. The method should return a single string iterator that chains all iterators in order skipping null values public static Iterator iterateStrings(List<Iterator> stringIterators) Solution We wrap the …

## Java String Array Iterator Example

Problem Given the signature of the Java method below public static Iterator iterateStrings(String… strings) Provide implementation that iterates through each string in the order that they are provided but it skips null values Solution We implement the Iterable interface. We …