tech-test

command module
v0.0.0-...-7892412 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2022 License: MIT Imports: 2 Imported by: 0

README

Tech Test

Palindrome

validate if a given word is a palindrome

Two items

validate if two items of an array sum a specific value

String times

retrieve how many times a specific character is in a string

Anagrama

validate if a string is a permutation of another

Compactor/Decompactor

compact and optionally decompact a string

string = "aaaaabbbadddcc"

compactador(string) = "a5b2a1d3c2"

Maximum difference

the difference between the elements of a matrix is defined by a[j] - a[i] where i < j and a[i] < a[j] complete la funcion maximumDifference which has and integer array as an input and returns the maximum difference if the maximum difference cannot be calculated (for example, the elements are in descedent order) the function should return -1

example: [15, 3, 6, 10]

differences: 6 - 3 = 3 10 - 3 = 7 10 - 6 = 4

maximum difference = 7

Merge ordenado

In merge ordenado arrays are created and merged to create a new sorted array containing the values from both arrays

example: a=[1, 2, 3] b=[2, 5, 5] then c=[1, 2, 2, 3, 5, 5]

Merge arrays

Receives two sorted arrays and produce a new array with all the elements from the two arrays sorted in ascending order

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL