First, update the package list and upgrade existing packages:
sudo apt update
// Define core services | |
class TimeTravelService { | |
constructor( | |
private timelineAnalyzer: TimelineAnalyzer, | |
private dataVault: DataVault, | |
private encryptionService: EncryptionService, | |
private transporter: Transporter, | |
private auditor: Auditor | |
) {} |
const mergeWord = (word1: string, word2: string) => { | |
let shorterWord = '' | |
let longerWord = '' | |
let accu = '' | |
if (word1.length < word2.length) { | |
shorterWord = word1 | |
longerWord = word2 | |
} else if (word2.length < word1.length) { | |
shorterWord = word2 | |
longerWord = word1 |
function isMonotonic(arr: Number[]): Boolean { | |
let monoLeft = true; | |
let monoRight = true; | |
// loop thru the arr and check for the side by side items that makes the array non-monotonic | |
for (let i = 0; i < arr.length - 1; i++) { | |
// To check if | |
// array is not increasing | |
if (arr[i] > arr[i + 1]) { | |
monoLeft = false; |