Daily Articles: February 27, 2016

SolveIt – Detect the Domain Name

You will be provided with a fragment of HTML code. Your task is to identify unique potential domain names from the links or URLs which are present in that code fragment. For example, if the link http://www.phpdrill.com is present in the markup, you should detect the domain: phpdrill.com. If second-level…

Read More

February 27th, 2016 Javascript, PHP, SolveIt

SolveIt – K-subsequences ( Given a large list of n positive integers, count the number of k-subsequences.)

A k-subsequence is defined as follows: It is a subsequence of consecutive elements. The sum of its elements, s, is evenly divisible by k (i.e.: s % k = 0). Complete a function called kSub with two parameters: an integer, k, and an array of integers, nums, of size n.…

Read More

February 27th, 2016 Javascript, PHP, SolveIt

SolveIt – Find out Maximum Difference in an Array

The maximum difference for a pair of elements in some array a is defined as the largest difference between any a[i] and a[j] where i < j and a[i] < a[j]. Create a Function maxDifference to find the maximum difference from array a. Output Format Your maxDifference function should return…

Read More

February 27th, 2016 Javascript, PHP, SolveIt