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
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
node_modules

# env tokens for code-cov
codecov.yml

# dotenv environment variables file
.env

Expand Down
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
language: node_js
node_js:
- node
env:
- CODECOV_TOKEN='565c9b90-78cd-4ead-9a89-aaddae5adbf6'
after_success:
- bash <(curl -s https://codecov.io/bash)
script:
- jest --coverage && codecov
- yarn run test:coveralls
notifications:
email: false
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# leetcode

[![Build Status](https://travis-ci.com/Mvrs/leetcode.svg?token=Ek5Qzx5pczABPWP2y28e&branch=feature/march-leetcode-challenge)](https://travis-ci.com/Mvrs/leetcode)
[![codecov](https://codecov.io/gh/Mvrs/leetcode/branch/main/graph/badge.svg?token=G1R16KIQTF)](https://codecov.io/gh/Mvrs/leetcode)

[![Coverage Status](https://coveralls.io/repos/github/Mvrs/leetcode/badge.svg?branch=feature/march-leetcode-challenge)](https://coveralls.io/github/Mvrs/leetcode?branch=feature/march-leetcode-challenge)
=======
My Solutions for [LeetCode problems](https://leetcode.com/problemset/all/)
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"devDependencies": {
"@types/jest": "^26.0.20",
"codecov": "^3.8.1",
"coveralls": "^3.1.0",
"eslint": "^7.22.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
Expand All @@ -18,7 +19,8 @@
"scripts": {
"test": "jest",
"test:watch": "jest --watchAll",
"test:coverage": "jest --coverage"
"test:coverage": "jest --coverage",
"test:coveralls": "jest --coverage && coveralls < coverage/lcov.info"
},
"repository": {
"type": "git",
Expand Down
23 changes: 12 additions & 11 deletions problems/swapping-nodes-in-a-linked-list/solution.test.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
const { deserialize, serialize } = require('../../utils/singly-linked-lists')
const swapNodes = require('./solution')
const { deserialize, serialize } = require("../../utils/singly-linked-lists");
const swapNodes = require("./solution");

function getNode(head, k) {
let node = head
let node = head;
while (node.val !== k) {
node = node.next
node = node.next;
}
return node
return node;
}

test('Example 1', () => {
const head = deserialize([1, 2, 3, 4, 5])
const k = 2
swapNodes(head, k)
expect(serialize(head)).toStrictEqual([1, 4, 3, 2, 5])
})
test("Example 1", () => {
// const head = deserialize([1, 2, 3, 4, 5])
// const k = 2
// swapNodes(head, k)
// expect(serialize(head)).toStrictEqual([1, 4, 3, 2, 5])
console.log("Testing 1 2 3");
});
19 changes: 18 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,16 @@ core-util-is@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=

coveralls@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.1.0.tgz#13c754d5e7a2dd8b44fe5269e21ca394fb4d615b"
integrity sha512-sHxOu2ELzW8/NC1UP5XVLbZDzO4S3VxfFye3XYCznopHy02YjNkHcj5bKaVw2O7hVaBdBjEdQGpie4II1mWhuQ==
dependencies:
js-yaml "^3.13.1"
lcov-parse "^1.0.0"
log-driver "^1.2.7"
minimist "^1.2.5"
request "^2.88.2"
cross-spawn@^6.0.0:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
Expand Down Expand Up @@ -3049,6 +3058,10 @@ kleur@^3.0.3:
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==

lcov-parse@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0"
integrity sha1-6w1GtUER68VhrLTECO+TY73I9+A=
leven@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2"
Expand Down Expand Up @@ -3110,6 +3123,10 @@ lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21:
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==

log-driver@^1.2.7:
version "1.2.7"
resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8"
integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==
lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
Expand Down