Closed
Description
2523. Closest Prime Numbers in Range caused the bot to send out content of <style>
tag. After investigation, it is found that API returned style tag in data.activeDailyCodingChallengeQuestion.question.content
of API response.
Full response attached below:
{
"data": {
"activeDailyCodingChallengeQuestion": {
"date": "2025-03-07",
"userStatus": "NotStart",
"link": "/problems/closest-prime-numbers-in-range/",
"question": {
"titleSlug": "closest-prime-numbers-in-range",
"title": "Closest Prime Numbers in Range",
"content": "<p>Given two positive integers <code>left</code> and <code>right</code>, find the two integers <code>num1</code> and <code>num2</code> such that:</p>\n\n<ul>\n\t<li><code>left <= num1 < num2 <= right </code>.</li>\n\t<li>Both <code>num1</code> and <code>num2</code> are <span data-keyword=\"prime-number\">prime numbers</span>.</li>\n\t<li><code>num2 - num1</code> is the <strong>minimum</strong> amongst all other pairs satisfying the above conditions.</li>\n</ul>\n\n<p>Return the positive integer array <code>ans = [num1, num2]</code>. If there are multiple pairs satisfying these conditions, return the one with the <strong>smallest</strong> <code>num1</code> value. If no such numbers exist, return <code>[-1, -1]</code><em>.</em></p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> left = 10, right = 19\n<strong>Output:</strong> [11,13]\n<strong>Explanation:</strong> The prime numbers between 10 and 19 are 11, 13, 17, and 19.\nThe closest gap between any pair is 2, which can be achieved by [11,13] or [17,19].\nSince 11 is smaller than 17, we return the first pair.\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> left = 4, right = 6\n<strong>Output:</strong> [-1,-1]\n<strong>Explanation:</strong> There exists only one prime number in the given range, so the conditions cannot be satisfied.\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>1 <= left <= right <= 10<sup>6</sup></code></li>\n</ul>\n\n<p> </p>\n<style type=\"text/css\">.spoilerbutton {display:block; border:dashed; padding: 0px 0px; margin:10px 0px; font-size:150%; font-weight: bold; color:#000000; background-color:cyan; outline:0; \n}\n.spoiler {overflow:hidden;}\n.spoiler > div {-webkit-transition: all 0s ease;-moz-transition: margin 0s ease;-o-transition: all 0s ease;transition: margin 0s ease;}\n.spoilerbutton[value=\"Show Message\"] + .spoiler > div {margin-top:-500%;}\n.spoilerbutton[value=\"Hide Message\"] + .spoiler {padding:5px;}\n</style>\n",
"translatedTitle": null,
"acRate": 46.54254591236281,
"difficulty": "Medium",
"freqBar": null,
"frontendQuestionId": "2523",
"isFavor": false,
"paidOnly": false,
"status": null,
"hasVideoSolution": false,
"hasSolution": true,
"topicTags": [
{
"name": "Math",
"id": "VG9waWNUYWdOb2RlOjg=",
"slug": "math"
},
{
"name": "Number Theory",
"id": "VG9waWNUYWdOb2RlOjYxMDY3",
"slug": "number-theory"
}
]
}
}
}
}
Extra filtering on <style>
tag should be added to markdown conversion logic.
Metadata
Metadata
Assignees
Labels
No labels