Chore: Add headers to all the files (#54)

## Description
- Add headers to all the CSV files

## Script used
```py
import csv
import os

# Set the path of the folder containing the CSV files
folder_path = "./LeetCode-Questions-CompanyWise"
headers = [
    "ID",
    "Title",
    "Acceptance",
    "Difficulty",
    "Frequency",
    "Leetcode Question Link",
]

# Loop through all the CSV files in the folder
for file_name in os.listdir(folder_path):
    if file_name.endswith(".csv"):
        # Read the CSV file into a list of rows
        file_path = os.path.join(folder_path, file_name)
        with open(file_path, "r") as f:
            reader = csv.reader(f)
            rows = list(reader)

        has_headers = False
        if len(rows) > 0 and rows[0] == headers:
            has_headers = True

        if not has_headers:
            rows.insert(0, headers)

            # Write the list of rows back to the CSV file
            with open(file_path, "w", newline="") as f:
                writer = csv.writer(f)
                writer.writerows(rows)

```
This commit is contained in:
Krishna Kumar Dey
2023-04-01 11:07:49 +05:30
committed by GitHub
parent 0aeadbd612
commit fb5f78b55e
534 changed files with 20291 additions and 19757 deletions

View File

@@ -1,35 +1,36 @@
991,Broken Calculator,45.6%,Medium,0.8343103907872829, https://leetcode.com/problems/broken-calculator
1052,Grumpy Bookstore Owner,55.4%,Medium,0.6329062363392213, https://leetcode.com/problems/grumpy-bookstore-owner
45,Jump Game II,30.6%,Hard,0.4315020818911597, https://leetcode.com/problems/jump-game-ii
457,Circular Array Loop,29.4%,Medium,0.31790921708384473, https://leetcode.com/problems/circular-array-loop
403,Frog Jump,39.7%,Hard,0.1519909531790461, https://leetcode.com/problems/frog-jump
402,Remove K Digits,28.4%,Medium,0.14242034004176865, https://leetcode.com/problems/remove-k-digits
826,Most Profit Assigning Work,38.5%,Medium,0.09287412500644375, https://leetcode.com/problems/most-profit-assigning-work
564,Find the Closest Palindrome,19.7%,Hard,0.0840831172105414, https://leetcode.com/problems/find-the-closest-palindrome
273,Integer to English Words,27.1%,Hard,0.04747257415466348, https://leetcode.com/problems/integer-to-english-words
703,Kth Largest Element in a Stream,49.7%,Easy,0.031004894819414507, https://leetcode.com/problems/kth-largest-element-in-a-stream
316,Remove Duplicate Letters,35.8%,Hard,0.030443751414723153, https://leetcode.com/problems/remove-duplicate-letters
33,Search in Rotated Sorted Array,34.5%,Medium,0.0287009496170278, https://leetcode.com/problems/search-in-rotated-sorted-array
202,Happy Number,50.4%,Easy,0.02483442856330386, https://leetcode.com/problems/happy-number
55,Jump Game,34.6%,Medium,0.01994084020351079, https://leetcode.com/problems/jump-game
253,Meeting Rooms II,45.7%,Medium,0.018087309810579388, https://leetcode.com/problems/meeting-rooms-ii
17,Letter Combinations of a Phone Number,46.8%,Medium,0.017492519932499718, https://leetcode.com/problems/letter-combinations-of-a-phone-number
238,Product of Array Except Self,60.1%,Medium,0.015629897160874744, https://leetcode.com/problems/product-of-array-except-self
210,Course Schedule II,40.7%,Medium,0.011869857339029215, https://leetcode.com/problems/course-schedule-ii
207,Course Schedule,43.1%,Medium,0.01113459480911671, https://leetcode.com/problems/course-schedule
22,Generate Parentheses,62.7%,Medium,0.009785877810632554, https://leetcode.com/problems/generate-parentheses
40,Combination Sum II,48.2%,Medium,0.009578617297069781, https://leetcode.com/problems/combination-sum-ii
208,Implement Trie (Prefix Tree),49.4%,Medium,0.009105457856626612, https://leetcode.com/problems/implement-trie-prefix-tree
128,Longest Consecutive Sequence,45.1%,Hard,0.009051883485315484, https://leetcode.com/problems/longest-consecutive-sequence
977,Squares of a Sorted Array,72.1%,Easy,0.008733679968754604, https://leetcode.com/problems/squares-of-a-sorted-array
239,Sliding Window Maximum,43.0%,Hard,0.007898935224534491, https://leetcode.com/problems/sliding-window-maximum
116,Populating Next Right Pointers in Each Node,45.2%,Medium,0.007336790063854334, https://leetcode.com/problems/populating-next-right-pointers-in-each-node
200,Number of Islands,46.8%,Medium,0.006490251382779317, https://leetcode.com/problems/number-of-islands
76,Minimum Window Substring,34.6%,Hard,0.006231520398723243, https://leetcode.com/problems/minimum-window-substring
138,Copy List with Random Pointer,36.4%,Medium,0.006191011880825271, https://leetcode.com/problems/copy-list-with-random-pointer
621,Task Scheduler,50.1%,Medium,0.005261323957171611, https://leetcode.com/problems/task-scheduler
146,LRU Cache,33.2%,Medium,0.004600353139061353, https://leetcode.com/problems/lru-cache
234,Palindrome Linked List,39.3%,Easy,0.004533613114828982, https://leetcode.com/problems/palindrome-linked-list
49,Group Anagrams,56.9%,Medium,0.0038040939835560453, https://leetcode.com/problems/group-anagrams
283,Move Zeroes,57.8%,Easy,0.0028853803470673955, https://leetcode.com/problems/move-zeroes
5,Longest Palindromic Substring,29.5%,Medium,0.002279333142507479, https://leetcode.com/problems/longest-palindromic-substring
ID,Title,Acceptance,Difficulty,Frequency,Leetcode Question Link
991,Broken Calculator,45.6%,Medium,0.8343103907872829, https://leetcode.com/problems/broken-calculator
1052,Grumpy Bookstore Owner,55.4%,Medium,0.6329062363392213, https://leetcode.com/problems/grumpy-bookstore-owner
45,Jump Game II,30.6%,Hard,0.4315020818911597, https://leetcode.com/problems/jump-game-ii
457,Circular Array Loop,29.4%,Medium,0.31790921708384473, https://leetcode.com/problems/circular-array-loop
403,Frog Jump,39.7%,Hard,0.1519909531790461, https://leetcode.com/problems/frog-jump
402,Remove K Digits,28.4%,Medium,0.14242034004176865, https://leetcode.com/problems/remove-k-digits
826,Most Profit Assigning Work,38.5%,Medium,0.09287412500644375, https://leetcode.com/problems/most-profit-assigning-work
564,Find the Closest Palindrome,19.7%,Hard,0.0840831172105414, https://leetcode.com/problems/find-the-closest-palindrome
273,Integer to English Words,27.1%,Hard,0.04747257415466348, https://leetcode.com/problems/integer-to-english-words
703,Kth Largest Element in a Stream,49.7%,Easy,0.031004894819414507, https://leetcode.com/problems/kth-largest-element-in-a-stream
316,Remove Duplicate Letters,35.8%,Hard,0.030443751414723153, https://leetcode.com/problems/remove-duplicate-letters
33,Search in Rotated Sorted Array,34.5%,Medium,0.0287009496170278, https://leetcode.com/problems/search-in-rotated-sorted-array
202,Happy Number,50.4%,Easy,0.02483442856330386, https://leetcode.com/problems/happy-number
55,Jump Game,34.6%,Medium,0.01994084020351079, https://leetcode.com/problems/jump-game
253,Meeting Rooms II,45.7%,Medium,0.018087309810579388, https://leetcode.com/problems/meeting-rooms-ii
17,Letter Combinations of a Phone Number,46.8%,Medium,0.017492519932499718, https://leetcode.com/problems/letter-combinations-of-a-phone-number
238,Product of Array Except Self,60.1%,Medium,0.015629897160874744, https://leetcode.com/problems/product-of-array-except-self
210,Course Schedule II,40.7%,Medium,0.011869857339029215, https://leetcode.com/problems/course-schedule-ii
207,Course Schedule,43.1%,Medium,0.01113459480911671, https://leetcode.com/problems/course-schedule
22,Generate Parentheses,62.7%,Medium,0.009785877810632554, https://leetcode.com/problems/generate-parentheses
40,Combination Sum II,48.2%,Medium,0.009578617297069781, https://leetcode.com/problems/combination-sum-ii
208,Implement Trie (Prefix Tree),49.4%,Medium,0.009105457856626612, https://leetcode.com/problems/implement-trie-prefix-tree
128,Longest Consecutive Sequence,45.1%,Hard,0.009051883485315484, https://leetcode.com/problems/longest-consecutive-sequence
977,Squares of a Sorted Array,72.1%,Easy,0.008733679968754604, https://leetcode.com/problems/squares-of-a-sorted-array
239,Sliding Window Maximum,43.0%,Hard,0.007898935224534491, https://leetcode.com/problems/sliding-window-maximum
116,Populating Next Right Pointers in Each Node,45.2%,Medium,0.007336790063854334, https://leetcode.com/problems/populating-next-right-pointers-in-each-node
200,Number of Islands,46.8%,Medium,0.006490251382779317, https://leetcode.com/problems/number-of-islands
76,Minimum Window Substring,34.6%,Hard,0.006231520398723243, https://leetcode.com/problems/minimum-window-substring
138,Copy List with Random Pointer,36.4%,Medium,0.006191011880825271, https://leetcode.com/problems/copy-list-with-random-pointer
621,Task Scheduler,50.1%,Medium,0.005261323957171611, https://leetcode.com/problems/task-scheduler
146,LRU Cache,33.2%,Medium,0.004600353139061353, https://leetcode.com/problems/lru-cache
234,Palindrome Linked List,39.3%,Easy,0.004533613114828982, https://leetcode.com/problems/palindrome-linked-list
49,Group Anagrams,56.9%,Medium,0.0038040939835560453, https://leetcode.com/problems/group-anagrams
283,Move Zeroes,57.8%,Easy,0.0028853803470673955, https://leetcode.com/problems/move-zeroes
5,Longest Palindromic Substring,29.5%,Medium,0.002279333142507479, https://leetcode.com/problems/longest-palindromic-substring
1 991 ID Broken Calculator Title 45.6% Acceptance Medium Difficulty 0.8343103907872829 Frequency https://leetcode.com/problems/broken-calculator Leetcode Question Link
2 1052 991 Grumpy Bookstore Owner Broken Calculator 55.4% 45.6% Medium Medium 0.6329062363392213 0.8343103907872829 https://leetcode.com/problems/grumpy-bookstore-owner https://leetcode.com/problems/broken-calculator
3 45 1052 Jump Game II Grumpy Bookstore Owner 30.6% 55.4% Hard Medium 0.4315020818911597 0.6329062363392213 https://leetcode.com/problems/jump-game-ii https://leetcode.com/problems/grumpy-bookstore-owner
4 457 45 Circular Array Loop Jump Game II 29.4% 30.6% Medium Hard 0.31790921708384473 0.4315020818911597 https://leetcode.com/problems/circular-array-loop https://leetcode.com/problems/jump-game-ii
5 403 457 Frog Jump Circular Array Loop 39.7% 29.4% Hard Medium 0.1519909531790461 0.31790921708384473 https://leetcode.com/problems/frog-jump https://leetcode.com/problems/circular-array-loop
6 402 403 Remove K Digits Frog Jump 28.4% 39.7% Medium Hard 0.14242034004176865 0.1519909531790461 https://leetcode.com/problems/remove-k-digits https://leetcode.com/problems/frog-jump
7 826 402 Most Profit Assigning Work Remove K Digits 38.5% 28.4% Medium Medium 0.09287412500644375 0.14242034004176865 https://leetcode.com/problems/most-profit-assigning-work https://leetcode.com/problems/remove-k-digits
8 564 826 Find the Closest Palindrome Most Profit Assigning Work 19.7% 38.5% Hard Medium 0.0840831172105414 0.09287412500644375 https://leetcode.com/problems/find-the-closest-palindrome https://leetcode.com/problems/most-profit-assigning-work
9 273 564 Integer to English Words Find the Closest Palindrome 27.1% 19.7% Hard Hard 0.04747257415466348 0.0840831172105414 https://leetcode.com/problems/integer-to-english-words https://leetcode.com/problems/find-the-closest-palindrome
10 703 273 Kth Largest Element in a Stream Integer to English Words 49.7% 27.1% Easy Hard 0.031004894819414507 0.04747257415466348 https://leetcode.com/problems/kth-largest-element-in-a-stream https://leetcode.com/problems/integer-to-english-words
11 316 703 Remove Duplicate Letters Kth Largest Element in a Stream 35.8% 49.7% Hard Easy 0.030443751414723153 0.031004894819414507 https://leetcode.com/problems/remove-duplicate-letters https://leetcode.com/problems/kth-largest-element-in-a-stream
12 33 316 Search in Rotated Sorted Array Remove Duplicate Letters 34.5% 35.8% Medium Hard 0.0287009496170278 0.030443751414723153 https://leetcode.com/problems/search-in-rotated-sorted-array https://leetcode.com/problems/remove-duplicate-letters
13 202 33 Happy Number Search in Rotated Sorted Array 50.4% 34.5% Easy Medium 0.02483442856330386 0.0287009496170278 https://leetcode.com/problems/happy-number https://leetcode.com/problems/search-in-rotated-sorted-array
14 55 202 Jump Game Happy Number 34.6% 50.4% Medium Easy 0.01994084020351079 0.02483442856330386 https://leetcode.com/problems/jump-game https://leetcode.com/problems/happy-number
15 253 55 Meeting Rooms II Jump Game 45.7% 34.6% Medium Medium 0.018087309810579388 0.01994084020351079 https://leetcode.com/problems/meeting-rooms-ii https://leetcode.com/problems/jump-game
16 17 253 Letter Combinations of a Phone Number Meeting Rooms II 46.8% 45.7% Medium Medium 0.017492519932499718 0.018087309810579388 https://leetcode.com/problems/letter-combinations-of-a-phone-number https://leetcode.com/problems/meeting-rooms-ii
17 238 17 Product of Array Except Self Letter Combinations of a Phone Number 60.1% 46.8% Medium Medium 0.015629897160874744 0.017492519932499718 https://leetcode.com/problems/product-of-array-except-self https://leetcode.com/problems/letter-combinations-of-a-phone-number
18 210 238 Course Schedule II Product of Array Except Self 40.7% 60.1% Medium Medium 0.011869857339029215 0.015629897160874744 https://leetcode.com/problems/course-schedule-ii https://leetcode.com/problems/product-of-array-except-self
19 207 210 Course Schedule Course Schedule II 43.1% 40.7% Medium Medium 0.01113459480911671 0.011869857339029215 https://leetcode.com/problems/course-schedule https://leetcode.com/problems/course-schedule-ii
20 22 207 Generate Parentheses Course Schedule 62.7% 43.1% Medium Medium 0.009785877810632554 0.01113459480911671 https://leetcode.com/problems/generate-parentheses https://leetcode.com/problems/course-schedule
21 40 22 Combination Sum II Generate Parentheses 48.2% 62.7% Medium Medium 0.009578617297069781 0.009785877810632554 https://leetcode.com/problems/combination-sum-ii https://leetcode.com/problems/generate-parentheses
22 208 40 Implement Trie (Prefix Tree) Combination Sum II 49.4% 48.2% Medium Medium 0.009105457856626612 0.009578617297069781 https://leetcode.com/problems/implement-trie-prefix-tree https://leetcode.com/problems/combination-sum-ii
23 128 208 Longest Consecutive Sequence Implement Trie (Prefix Tree) 45.1% 49.4% Hard Medium 0.009051883485315484 0.009105457856626612 https://leetcode.com/problems/longest-consecutive-sequence https://leetcode.com/problems/implement-trie-prefix-tree
24 977 128 Squares of a Sorted Array Longest Consecutive Sequence 72.1% 45.1% Easy Hard 0.008733679968754604 0.009051883485315484 https://leetcode.com/problems/squares-of-a-sorted-array https://leetcode.com/problems/longest-consecutive-sequence
25 239 977 Sliding Window Maximum Squares of a Sorted Array 43.0% 72.1% Hard Easy 0.007898935224534491 0.008733679968754604 https://leetcode.com/problems/sliding-window-maximum https://leetcode.com/problems/squares-of-a-sorted-array
26 116 239 Populating Next Right Pointers in Each Node Sliding Window Maximum 45.2% 43.0% Medium Hard 0.007336790063854334 0.007898935224534491 https://leetcode.com/problems/populating-next-right-pointers-in-each-node https://leetcode.com/problems/sliding-window-maximum
27 200 116 Number of Islands Populating Next Right Pointers in Each Node 46.8% 45.2% Medium Medium 0.006490251382779317 0.007336790063854334 https://leetcode.com/problems/number-of-islands https://leetcode.com/problems/populating-next-right-pointers-in-each-node
28 76 200 Minimum Window Substring Number of Islands 34.6% 46.8% Hard Medium 0.006231520398723243 0.006490251382779317 https://leetcode.com/problems/minimum-window-substring https://leetcode.com/problems/number-of-islands
29 138 76 Copy List with Random Pointer Minimum Window Substring 36.4% 34.6% Medium Hard 0.006191011880825271 0.006231520398723243 https://leetcode.com/problems/copy-list-with-random-pointer https://leetcode.com/problems/minimum-window-substring
30 621 138 Task Scheduler Copy List with Random Pointer 50.1% 36.4% Medium Medium 0.005261323957171611 0.006191011880825271 https://leetcode.com/problems/task-scheduler https://leetcode.com/problems/copy-list-with-random-pointer
31 146 621 LRU Cache Task Scheduler 33.2% 50.1% Medium Medium 0.004600353139061353 0.005261323957171611 https://leetcode.com/problems/lru-cache https://leetcode.com/problems/task-scheduler
32 234 146 Palindrome Linked List LRU Cache 39.3% 33.2% Easy Medium 0.004533613114828982 0.004600353139061353 https://leetcode.com/problems/palindrome-linked-list https://leetcode.com/problems/lru-cache
33 49 234 Group Anagrams Palindrome Linked List 56.9% 39.3% Medium Easy 0.0038040939835560453 0.004533613114828982 https://leetcode.com/problems/group-anagrams https://leetcode.com/problems/palindrome-linked-list
34 283 49 Move Zeroes Group Anagrams 57.8% 56.9% Easy Medium 0.0028853803470673955 0.0038040939835560453 https://leetcode.com/problems/move-zeroes https://leetcode.com/problems/group-anagrams
35 5 283 Longest Palindromic Substring Move Zeroes 29.5% 57.8% Medium Easy 0.002279333142507479 0.0028853803470673955 https://leetcode.com/problems/longest-palindromic-substring https://leetcode.com/problems/move-zeroes
36 5 Longest Palindromic Substring 29.5% Medium 0.002279333142507479 https://leetcode.com/problems/longest-palindromic-substring