{% extends "base.html" %} {% import "_partials.html" as ui %} {# Chrome, tab set, pane split, action bar and console follow two-sum-desktop / two-sum-mobile. The right pane is a plain textarea editor, not a copy of the source editor component. #} {% block title %}{{ question.number }}. {{ question.title }} - LeetCode{% endblock %} {% block main %}
{{ ui.logo(false) }} Problem List ‹ ›
00:00:00 {% if member %} {{ member.username }}
{% else %} Register Log in {% endif %} Premium
{% if tab == 'description' %}

{{ question.number }}. {{ question.title }}

{{ question.difficulty }}
Topics
    {% for topic in question.topics %}
  • {{ topic }}
  • {% else %}
  • No topic tag
  • {% endfor %}
Companies {% if question.hints %}
Hint
    {% for hint in question.hints %}
  1. Hint {{ loop.index }}{{ hint }}
  2. {% endfor %}
{% endif %}
{% if question.workspace_ready %}

{{ question.summary }}

{% for line in question.details %}

{{ line }}

{% endfor %} {% for example in question.examples %}

Example {{ loop.index }}:

Input: {{ example.input }}
Output: {{ example.output }}{% if example.explanation %}
Explanation: {{ example.explanation }}{% endif %}
{% endfor %} {% if question.constraints %}

Constraints:

    {% for constraint in question.constraints %}
  • {{ constraint }}
  • {% endfor %}
{% endif %} {% if question.follow_up %}

Follow-up: {{ question.follow_up }}

{% endif %}
{% else %}

{{ no_workspace_notice }}

The catalogue row for this question — its number, title, difficulty and acceptance rate — comes from the captured problem-set page. Its statement was not captured, and inventing one would not be an honest reconstruction.

Open 1. Two Sum, the question this clone reproduces in full.

{% endif %} {% if question.accepted_display %}
Accepted
{{ question.accepted_display }}/{{ question.submissions_display }}
Acceptance Rate
{{ '%.1f'|format(question.acceptance) }}%
{% else %}
Acceptance Rate
{{ '%.1f'|format(question.acceptance) }}%
{% endif %} {% if similar %}

Similar Questions

    {% for item in similar %}
  • {% if item.available %} {{ item.title }} {% else %} {{ item.title }} {% endif %} {{ item.difficulty }}
  • {% endfor %}
{% endif %} {# The captured page closes the Description tab with a Discussion section: a heading carrying the thread count, a compose row, and the site's own posting rules. The individual comments below it are visitor-written content by named people and are not reproduced. #} {% if question.discussion_display %}

Discussion ({{ question.discussion_display }})

Choose a type Comment

Discussion Rules

  1. Please don’t post any solutions in this discussion.
  2. The problem discussion is for asking questions about the problem or for sharing tips - anything except for solutions.
  3. If you’d like to share your solution for feedback and ideas, please head to the solutions tab and post it there.

The captured thread is visitor-written content attributed to named accounts, so this clone reproduces the section and its rules but none of the posts.

{% endif %} {% elif tab == 'editorial' %}

Editorial

{% if question.editorial_title %}

{{ question.editorial_title }}

{% for paragraph in question.editorial_body %}

{{ paragraph }}

{% endfor %} {% for lang, code in question.editorial_code.items() %}

{{ lang|language_label }}

{{ code }}
{% endfor %}

This editorial was written for the offline clone. The source editorial is behind a Premium subscription and was not captured.

{% else %}

No editorial is reproduced for this question.

{% endif %} {% elif tab == 'solutions' %}

Solutions

{% if question.community_solutions %}
    {% for entry in question.community_solutions %}
  • {{ entry.title }}

    {{ entry.author }} · {{ entry.language }} · {{ entry.votes }} votes

  • {% endfor %}

These entries are local fixture data. The source community solutions were not captured.

{% else %}

No community solution is reproduced for this question.

{% endif %} {% else %}

Submissions

{% if member %} {% if question_submissions %} {% for entry in question_submissions %} {% endfor %}
StatusLanguageRuntimeMemorySubmitted
{{ entry.status }} {{ entry.language|language_label }} {% if entry.runtime_ms is not none %}{{ entry.runtime_ms }} ms{% else %}N/A{% endif %} {% if entry.memory_mb is not none %}{{ entry.memory_mb }} MB{% else %}N/A{% endif %} {{ entry.created_at }}
{% else %}

You have not submitted a solution to this question yet.

{% endif %} {% else %}

You need to log in to see your submissions.

{% endif %} {% endif %}
Code
Auto
{{ saved_label }} Ln 1, Col 1
{% if not member %}

{{ auth_notice|replace('log in / sign up', '') }} log in / sign up to run or submit

{% endif %}
{% if cases %}
{% for case in cases %} {% endfor %}
{% for case in cases %}
{% if question.case_labels %} {# The source shows one labelled field per parameter. #} {% for label in question.case_labels %} {% endfor %} {% else %} {% endif %}
{% endfor %} {% if not supports_custom_input %}

This question runs against its own fixed data set.

{% endif %} {% else %}

No test case is reproduced for this question.

{% endif %}
{% include "_result.html" %}
{% endblock %} {% block scripts %}{% endblock %}