We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 974fbd5 + 4988e54 commit 03d4c95Copy full SHA for 03d4c95
python/lc_libs/cpp_writer.py
@@ -248,6 +248,11 @@ def get_solution_code(
248
final_codes.extend(content[start_index:end_index].strip().split("\n"))
249
while final_codes and final_codes[0].strip() == "":
250
final_codes.popleft()
251
+ # special libs
252
+ if "#include <ranges>" in content:
253
+ # or " ranges::" in content or "std::ranges::" in content:
254
+ final_codes.appendleft("#include <ranges>\n")
255
+ logging.debug("Add special lib: <ranges>")
256
return "\n".join(final_codes), problem_id
257
258
@staticmethod
0 commit comments