From 132ad736309b67397bc5e7a9c5370db9d5aa5813 Mon Sep 17 00:00:00 2001 From: vishal-cs24 Date: Sun, 8 Oct 2023 19:40:36 +0530 Subject: [PATCH 1/7] Addition of instructions in .devcontainer/README.md file --- .devcontainer/README.md | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index ec3cdb61de7a..7edde36a9651 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -1 +1,38 @@ -https://code.visualstudio.com/docs/devcontainers/tutorial +Using DevContainers in Visual Studio Code: Quick step by step Start Guide + +Step 1: Install Visual Studio Code +Download and install Visual Studio Code from the official website: Visual Studio Code. + +Step 2: Install Docker +Ensure Docker is installed on your machine. You can download it from the official Docker website: 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. + +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. + + + + From 5f8324e47149267c3e71ed9fc242defb2e69a6d4 Mon Sep 17 00:00:00 2001 From: vishal-cs24 Date: Sun, 8 Oct 2023 19:47:15 +0530 Subject: [PATCH 2/7] Addition of instructions for a beginner --- .devcontainer/README.md | 53 +++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 7edde36a9651..5422a1356245 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -1,38 +1,45 @@ -Using DevContainers in Visual Studio Code: Quick step by step Start Guide +# Using DevContainers in Visual Studio Code: Quick Start Guide -Step 1: Install Visual Studio Code -Download and install Visual Studio Code from the official website: Visual Studio Code. +## Step 1: Install Visual Studio Code -Step 2: Install Docker -Ensure Docker is installed on your machine. You can download it from the official Docker website: Docker. +Download and install **Visual Studio Code** from the [official website](https://code.visualstudio.com/). -Step 3: Open a Project in Visual Studio Code -Open the project you want to work on in Visual Studio Code. +## Step 2: Install Docker -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. +Ensure **Docker** is installed on your machine. You can download it from the [official Docker website](https://docs.docker.com/get-docker/). -Step 5: Open the Command Palette -Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) to open the Command Palette. +## Step 3: Open a Project in Visual Studio Code -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. +Open the project you want to work on in **Visual Studio Code**. -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 4: Install the Remote Development Extension Pack -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. +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 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 5: Open the Command Palette -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. +Press `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (macOS) to open the **Command Palette**. -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. +## 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. From 107796624d48096f2326905c428bace0f73ef4cb Mon Sep 17 00:00:00 2001 From: vishal-cs24 Date: Sun, 8 Oct 2023 20:05:05 +0530 Subject: [PATCH 3/7] Revert "Addition of instructions for a beginner" need to create new branch This reverts commit 5f8324e47149267c3e71ed9fc242defb2e69a6d4. --- .devcontainer/README.md | 53 ++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 5422a1356245..7edde36a9651 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -1,45 +1,38 @@ -# Using DevContainers in Visual Studio Code: Quick Start Guide +Using DevContainers in Visual Studio Code: Quick step by step Start Guide -## Step 1: Install Visual Studio Code +Step 1: Install Visual Studio Code +Download and install Visual Studio Code from the official website: 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: Docker. -## Step 2: Install Docker +Step 3: Open a Project in Visual Studio Code +Open the project you want to work on in Visual Studio Code. -Ensure **Docker** is installed on your machine. You can download it from the [official Docker website](https://docs.docker.com/get-docker/). +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. -## Step 3: Open a Project in Visual Studio Code +Step 5: Open the Command Palette +Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) to open the Command Palette. -Open the project you want to work on in **Visual Studio Code**. +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 4: Install the Remote Development Extension Pack +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. -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 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 5: Open the Command Palette +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. -Press `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (macOS) to open the **Command Palette**. +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 6: Choose a DevContainer Configuration +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. -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. From eadda00c17f6ce80f5eb2260a8d769ce2aa9f26f Mon Sep 17 00:00:00 2001 From: vishal-cs24 Date: Sun, 8 Oct 2023 20:49:19 +0530 Subject: [PATCH 4/7] Add instructions for using DevContainer --- .devcontainer/README.md | 53 +++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 7edde36a9651..65aac30d4cfb 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -1,38 +1,45 @@ -Using DevContainers in Visual Studio Code: Quick step by step Start Guide +# Step by Step instructions for using DevContainer -Step 1: Install Visual Studio Code -Download and install Visual Studio Code from the official website: Visual Studio Code. +## Step 1: Install Visual Studio Code -Step 2: Install Docker -Ensure Docker is installed on your machine. You can download it from the official Docker website: Docker. +Download and install **Visual Studio Code** from the [official website](https://code.visualstudio.com/). -Step 3: Open a Project in Visual Studio Code -Open the project you want to work on in Visual Studio Code. +## Step 2: Install Docker -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. +Ensure **Docker** is installed on your machine. You can download it from the [official Docker website](https://docs.docker.com/get-docker/). -Step 5: Open the Command Palette -Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) to open the Command Palette. +## Step 3: Open a Project in Visual Studio Code -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. +Open the project you want to work on in **Visual Studio Code**. -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 4: Install the Remote Development Extension Pack -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. +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 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 5: Open the Command Palette -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. +Press `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (macOS) to open the **Command Palette**. -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. +## 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. From d8ade5bf663e771099d925c96b8b16a066318d70 Mon Sep 17 00:00:00 2001 From: vishal-cs24 Date: Sun, 8 Oct 2023 23:26:17 +0530 Subject: [PATCH 5/7] Add instructions for using DevContainer --- .devcontainer/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 65aac30d4cfb..2c2ab20fa906 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -1,4 +1,4 @@ -# Step by Step instructions for using DevContainer +# Step by Step instructions for new user to use DevContainer ## Step 1: Install Visual Studio Code From 329a014430945348f8671f0f6c9ea056cbd6f72a Mon Sep 17 00:00:00 2001 From: vishal-cs24 Date: Fri, 13 Oct 2023 17:22:52 +0530 Subject: [PATCH 6/7] fixed bug to get desigred output --- bit_manipulation/missing_number.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bit_manipulation/missing_number.py b/bit_manipulation/missing_number.py index 92502a778ace..b5376603c565 100644 --- a/bit_manipulation/missing_number.py +++ b/bit_manipulation/missing_number.py @@ -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])) From efe0386476d347b7be03da042e7f3da62992e7fe Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:59:55 +0000 Subject: [PATCH 7/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .devcontainer/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 2c2ab20fa906..7a2d7f4fe758 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -1,4 +1,4 @@ -# Step by Step instructions for new user to use DevContainer +# Step by Step instructions for new user to use DevContainer ## Step 1: Install Visual Studio Code