Skip to content
Merged
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
17 changes: 0 additions & 17 deletions .github/workflows/deno.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@
# Ignore all bazel-* symlinks. There is no full list since this can change
# based on the name of the directory bazel is cloned into.
bazel-*

node_modules
35 changes: 35 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
workspace(
# How this workspace would be referenced with absolute labels from another workspace
name = "leetcode",
# Map the @npm bazel workspace to the node_modules directory.
# This lets Bazel use the same node_modules as other local tooling.
managed_directories = {
"@npm": ["node_modules"],
# "@website_npm": ["website/node_modules"],
},
)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")


http_archive(
name = "com_google_googletest",
urls = ["https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip"],
Expand All @@ -13,8 +25,31 @@ http_archive(
strip_prefix = "rules_cc-40548a2974f1aea06215272d9c2b47a14a24e556",
)

# Fetch rules_nodejs so we can install our npm dependencies
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "0fa2d443571c9e02fcb7363a74ae591bdcce2dd76af8677a95965edf329d778a",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.6.0/rules_nodejs-3.6.0.tar.gz"],
)

git_repository(
name = "com_google_absl",
remote = "https://github.com/abseil/abseil-cpp.git",
tag = "20200225.2",
)

load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories", "npm_install")

node_repositories(
node_version = "16.2.0",
package_json = ["//:package.json"],
)

npm_install(
# Name this npm so that Bazel Label references look like @npm//package
name = "npm",
package_json = "//:package.json",
package_lock_json = "//:package-lock.json",
patch_args = ["-p1"]
)

6 changes: 2 additions & 4 deletions cpp/0020_valid_parentheses/0020_valid_parentheses.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@ using std::unordered_map;
bool Solution::isValid(string s) {
unordered_map<char, char> dict({{'(', ')'}, {'[', ']'}, {'{', '}'}});
stack<char> stack;
std::cout << "heyyy" << "\n";

for (const char &letter : s) {
std::cout << "heyyy" << "\n";
if (dict.find(letter) != dict.end()) {
stack.push(dict[letter]);
continue;
}

if (stack.empty()) {
return false;
return false;
}

const char& popped = stack.top();
const char &popped = stack.top();

if (letter != popped) {
return false;
Expand Down
Loading