fetch latest from upstream

This commit is contained in:
s2ks
2022-07-08 01:35:20 +02:00
34 changed files with 141 additions and 104 deletions

View File

@@ -417,7 +417,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
{
desc: (arr: number[][]): string => {
return [
"Given the following array of array of numbers representing a list of",
"Given the following array of arrays of numbers representing a list of",
"intervals, merge all overlapping intervals.\n\n",
`[${convert2DArrayToString(arr)}]\n\n`,
"Example:\n\n",
@@ -1283,17 +1283,16 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
numTries: 10,
desc: (n: string): string => {
return [
"You are given the following encoded binary String: \n",
`'${n}' \n`,
"You are given the following encoded binary string: \n",
`'${n}' \n\n`,
"Treat it as an extended Hamming code with 1 'possible' error at a random index.\n",
"Find the 'possible' wrong bit, fix it and extract the decimal value, which is hidden inside the string.\n\n",
"Note: The length of the binary string is dynamic, but it's encoding/decoding follows Hamming's 'rule'\n",
"Note 2: Index 0 is an 'overall' parity bit. Watch the Hamming code video from 3Blue1Brown for more information\n",
"Note 3: There's a ~55% chance for an altered Bit. So... MAYBE there is an altered Bit 😉\n",
"Note: The endianness of the \
encoded decimal value is reversed in relation to the endianness of the Hamming code. Where \
the Hamming code is expressed as little-endian (LSB at index 0), the decimal value encoded in it is expressed as big-endian \
(MSB at index 0)\n",
"Note: The endianness of the encoded decimal value is reversed in relation to the endianness of the Hamming code. Where",
"the Hamming code is expressed as little-endian (LSB at index 0), the decimal value encoded in it is expressed as big-endian",
"(MSB at index 0).\n",
"Extra note for automation: return the decimal value as a string",
].join(" ");
},
@@ -1550,7 +1549,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
return [
"Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to",
"earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk",
"begins with a length L, encoded as a single ASCII digit from 1 - 9, followed by the chunk data,",
"begins with a length L, encoded as a single ASCII digit from 1 to 9, followed by the chunk data,",
"which is either:\n\n",
"1. Exactly L characters, which are to be copied directly into the uncompressed data.\n",
"2. A reference to an earlier part of the uncompressed data. To do this, the length is followed",
@@ -1585,7 +1584,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
return [
"Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to",
"earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk",
"begins with a length L, encoded as a single ASCII digit from 1 - 9, followed by the chunk data,",
"begins with a length L, encoded as a single ASCII digit from 1 to 9, followed by the chunk data,",
"which is either:\n\n",
"1. Exactly L characters, which are to be copied directly into the uncompressed data.\n",
"2. A reference to an earlier part of the uncompressed data. To do this, the length is followed",