Find the Longest Common Subsequence in Java
The challenge
from Wikipedia:
The longest common subsequence (LCS) problem is the problem of finding the longest subsequence common to all sequences …
In-depth guides, insights, and best practices for modern software engineering
from Wikipedia:
The longest common subsequence (LCS) problem is the problem of finding the longest subsequence common to all sequences …
Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.
If target is …
Given an integer n, return true if it is a power of three. Otherwise, return false.
An integer n is a power of three, if there exists an …
Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0’s and 1’s, and all the …
Ever wanted to generate a CSV (comma separated values) file directly from the browser, using Javascript? Instead of going to the server..
Look no …
Read Article →Complete the function that takes two integers (a, b, where a < b) and return an array of all integers between the input parameters, …
I have often needed to clone a table without it’s data in MySQL.
Oftentimes this has been because I have a continually growing temporary table …
Read Article →Given a grid of size m x n, calculate the total number of rectangles contained in this rectangle. All integer sizes and positions are …
Read Article →The vowel substrings in the word codewarriors are o, e, a, io. The longest of these has a length of 2.
Given a lowercase string that has …
Read Article →In this challenge, you will be given two strings a and b and your task will be to return the characters that are not common in the two …
In this simple exercise, you will create a program that will take two lists of integers, a and b. Each list will consist of 3 positive …
In this example you need to implement a function that sort a list of integers based on it’s binary representation.
The rules are …
Read Article →Write a program that can do some algebra. Write a function expand that takes in an expression with a single, one character variable, and …
You are given an array(list) strarr of strings and an integer k. Your task is to return the first longest string consisting of k …
Given a string of words, you need to find the highest scoring word.
Each letter of a word scores points according to its position in the …
Read Article →In John’s car the GPS records every s seconds the distance travelled from an origin (distances are measured in an arbitrary but …
Create an application that will display the number of kilometers per liter (output) based on the number of miles per imperial gallon …
Read Article →Given a non-negative integer, return an array / a list of the individual digits in order.
Examples:
123 => [1,2,3]
1 => [1] …
Read Article →
Find the greatest common divisor of two positive integers. The integers can be large, so you need to find a clever solution.
The inputs …
Read Article →Create a Circular List
A circular list is of finite size, but can infititely be asked for its previous and next elements. This is …
Read Article →You must guess a sequence and it has something to do with the number given.
x = 16
result = [1, 10, 11, 12, 13, 14, 15, 16, 2, …
Read Article →
Build a function that returns an array of integers from n to 1 where n>0.
Example : n=5 –> [5,4,3,2,1]
Take an integer n (n >= 0) and a digit d (0 <= d <= 9) as an integer. Square all numbers k (0 <= k <= n) between 0 and n. …
Create a function multiplyAll/multiply_all which takes an array of integers as an argument. This function must return another function, …