Skip to content

Fix bug/update program to get desigred output #10366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
https://code.visualstudio.com/docs/devcontainers/tutorial
# Step by Step instructions for new user to use DevContainer

## Step 1: Install Visual Studio Code

Download and install **Visual Studio Code** from the [official website](https://code.visualstudio.com/).

## Step 2: Install Docker

Ensure **Docker** is installed on your machine. You can download it from the [official Docker website](https://docs.docker.com/get-docker/).

## Step 3: Open a Project in Visual Studio Code

Open the project you want to work on in **Visual Studio Code**.

## Step 4: Install the Remote Development Extension Pack

Install the **Remote Development** extension pack in **Visual Studio Code**. This pack includes extensions that enable you to work with development environments in containers, WSL, or SSH. You can find the extension pack [here](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack).

## Step 5: Open the Command Palette

Press `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (macOS) to open the **Command Palette**.

## Step 6: Choose a DevContainer Configuration

Type and select **"Remote-Containers: Add Development Container Configuration Files"** from the **Command Palette**. Choose a predefined configuration (e.g., Node.js, Python, etc.) or select **"Other"** to create a custom configuration.

## Step 7: Customize the DevContainer Configuration (Optional)

If you selected **"Other,"** customize the `devcontainer.json` file according to your project's needs, specifying the required tools, extensions, and settings for the DevContainer.

## Step 8: Reopen the Project in a DevContainer

Open the **Command Palette** again and select **"Remote-Containers: Reopen in Container."** Visual Studio Code will build the Docker image, set up the DevContainer, and reopen your project within the container.

## Step 9: Work in the DevContainer

You are now working within the **DevContainer.** Make your changes, write code, and use the integrated tools and extensions.

## Step 10: Save and Commit Your Work

Save your changes within the **DevContainer.** All changes are saved to your local workspace and are persistent across container restarts.

## Step 11: Stop or Restart the DevContainer

To stop the **DevContainer,** click on the bottom-left corner where it says **"DevContainer"** and choose **"Stop Container."** To restart, use **"Reopen in Container"** again.
12 changes: 8 additions & 4 deletions bit_manipulation/missing_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ def find_missing_number(nums: list[int]) -> int:
2
"""
n = len(nums)
missing_number = n

number = nums[0]
for i in range(n):
missing_number ^= i ^ nums[i]

if nums[i] != number:
missing_number = number
break
number += 1
return missing_number


# print(find_missing_number([0, 1, 3, 4]))