Skip to content

Commit ae6cfdb

Browse files
authored
GH-140: Solve leetcode 347 (#163)
1 parent c0b3346 commit ae6cfdb

File tree

15 files changed

+242
-1
lines changed

15 files changed

+242
-1
lines changed

.vscode/launch.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4+
{
5+
"name": "Python: Current File",
6+
"type": "python",
7+
"request": "launch",
8+
"program": "${file}",
9+
"console": "integratedTerminal",
10+
"justMyCode": true
11+
},
12+
{
13+
"name": "Python: Craft",
14+
"type": "python",
15+
"request": "launch",
16+
"program": "${file}",
17+
"console": "integratedTerminal",
18+
"justMyCode": true,
19+
"args": ["leetcode", "347"]
20+
},
421
{
522
"name": "Debug C++",
623
"type": "cppdbg",
@@ -15,4 +32,4 @@
1532
"preLaunchTask": "C++: g++ build active file"
1633
}
1734
]
18-
}
35+
}

problems/leetcode347/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
solution

problems/leetcode347/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Leetcode Problem
2+
3+
## Usage
4+
5+
Run program with an example
6+
7+
```
8+
bazel run src/main:solution < data/1.in
9+
```
10+
11+
Test program
12+
13+
```
14+
# Run all tests
15+
bazel test --test_output=all tests:solution_test
16+
bazel test --test_output=all --cache_test_results=no tests:solution_test
17+
# Run test with pecific test id
18+
bazel test --test_output=all tests:solution_test --test_arg=1
19+
```

problems/leetcode347/data/1.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
6 2
2+
1 1 1 2 2 3

problems/leetcode347/data/1.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1 2

problems/leetcode347/data/2.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1 1
2+
1

problems/leetcode347/data/2.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

problems/leetcode347/data/3.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
7 2
2+
4 1 -1 2 -1 2 3

problems/leetcode347/data/3.out

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2
2+
1
3+
0
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "Leetcode 347. Top K Frequent Elements",
3+
"link": "https://leetcode.com/problems/top-k-frequent-elements/description/",
4+
"tags": [
5+
"Array",
6+
"Hash Table",
7+
"Divide and Conquer",
8+
"Sorting",
9+
"Heap (Priority Queue)",
10+
"Bucket Sort",
11+
"Counting",
12+
"Quickselect"
13+
]
14+
}

0 commit comments

Comments
 (0)