Solve LeetCode problems in Visual Studio Code

Install the leetcode extension in VS Code

Image

  1. Login to leetcode from Google Chrome
  2. In Chrome, Inspect -> Network -> Fetch/XHR
  3. Click on any button in leetcode page, and in Inspector to the right under the “Name” tab find and select bottom “graphql” and under Headers tab and in “Request Headers” portion, select and copy the entire cookie string starting from “__cfduid” and ending with “_gat=1”
  4. Paste the cookie string in VS Code leetcode login prompt.

Image

Enjoy coding in VS Code

Image

Reference