Teaching Kids Programming: Videos on Data Structures and Algorithms Given a list of integers nums, return the number of sublists where the first element and the last element have …
We can compute the Greatest Common Divisor (GCD) using Iterative Divide/Remainder Method. The following is the GCD implementation in BASH Programming: #!/bin/bash function gcd() { local x=$1 local y=$2 …
Teaching Kids Programming: Videos on Data Structures and Algorithms You are given integers n, a and b. You are standing in a line of n people. You don’t know …
Given a string s, return true if s is a good string, or false otherwise. A string s is good if all the characters that appear in s have …
Teaching Kids Programming: Videos on Data Structures and Algorithms Given a square matrix mat, return the sum of the matrix diagonals. Only include the sum of all the elements …
We sometimes need in BASH script to display messages with different format/colour to terminal console. For example, the warnings messages are blue, and error messages are red. We can …