From 4382f860db84bb2e9e5e6d14a3a64d912a8e5243 Mon Sep 17 00:00:00 2001
From: catloversg <152669316+catloversg@users.noreply.github.com>
Date: Sun, 16 Jun 2024 06:37:14 +0700
Subject: [PATCH] CCT: Clarify empty string solution in UI (#1400)
---
src/data/codingcontracttypes.ts | 12 ++++++------
src/ui/React/CodingContractModal.tsx | 4 ++++
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/data/codingcontracttypes.ts b/src/data/codingcontracttypes.ts
index a8df8cc52..b27513a5a 100644
--- a/src/data/codingcontracttypes.ts
+++ b/src/data/codingcontracttypes.ts
@@ -339,7 +339,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
"\n\nAssuming you are initially positioned",
"at the start of the array, determine whether you are",
"able to reach the last index.\n\n",
- "Your answer should be submitted as 1 or 0, representing true and false respectively",
+ "Your answer should be submitted as 1 or 0, representing true and false respectively.",
].join(" ");
},
difficulty: 2.5,
@@ -561,7 +561,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
"Determine the maximum possible profit you can earn using at most",
"one transaction (i.e. you can only buy and sell the stock once). If no profit can be made",
"then the answer should be 0. Note",
- "that you have to buy the stock before you can sell it",
+ "that you have to buy the stock before you can sell it.",
].join(" ");
},
difficulty: 1,
@@ -601,7 +601,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
"and then selling one share of the stock. Note that you cannot",
"engage in multiple transactions at once. In other words, you",
"must sell the stock before you buy it again.\n\n",
- "If no profit can be made, then the answer should be 0",
+ "If no profit can be made, then the answer should be 0.",
].join(" ");
},
difficulty: 2,
@@ -639,7 +639,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
"and then selling one share of the stock. Note that you cannot",
"engage in multiple transactions at once. In other words, you",
"must sell the stock before you buy it again.\n\n",
- "If no profit can be made, then the answer should be 0",
+ "If no profit can be made, then the answer should be 0.",
].join(" ");
},
difficulty: 5,
@@ -954,7 +954,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
" [[0,1],\n",
" [1,0]]\n",
"\n",
- "Answer: ''\n\n",
+ "Answer: ''",
].join(" ");
},
difficulty: 7,
@@ -1535,7 +1535,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
" aaaaabccc -> 5a1b3c\n",
" aAaAaA -> 1a1A1a1A1a1A\n",
" 111112333 -> 511233\n",
- " zzzzzzzzzzzzzzzzzzz -> 9z9z1z (or 9z8z2z, etc.)\n",
+ " zzzzzzzzzzzzzzzzzzz -> 9z9z1z (or 9z8z2z, etc.)",
].join(" ");
},
gen: (): string => {
diff --git a/src/ui/React/CodingContractModal.tsx b/src/ui/React/CodingContractModal.tsx
index dc64d9d66..0dfcba364 100644
--- a/src/ui/React/CodingContractModal.tsx
+++ b/src/ui/React/CodingContractModal.tsx
@@ -68,6 +68,10 @@ export function CodingContractModal(): React.ReactElement {
{description}
+
+ If your solution is an empty string, you must leave the text box empty. Do not use "", '', or ``.
+
+