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,39 +1,40 @@
829,Consecutive Numbers Sum,37.5%,Hard,0.4198634169489928, https://leetcode.com/problems/consecutive-numbers-sum
761,Special Binary String,54.7%,Hard,0.3007541540191337, https://leetcode.com/problems/special-binary-string
1353,Maximum Number of Events That Can Be Attended,30.5%,Medium,0.29912265485367395, https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended
1,Two Sum,45.6%,Easy,0.18001339192381483, https://leetcode.com/problems/two-sum
42,Trapping Rain Water,48.9%,Hard,0.16908117464136005, https://leetcode.com/problems/trapping-rain-water
54,Spiral Matrix,34.1%,Medium,0.12572728493821236, https://leetcode.com/problems/spiral-matrix
20,Valid Parentheses,39.0%,Easy,0.10693122823835342, https://leetcode.com/problems/valid-parentheses
735,Asteroid Collision,41.0%,Medium,0.09542395191890234, https://leetcode.com/problems/asteroid-collision
377,Combination Sum IV,45.3%,Medium,0.08101594376008861, https://leetcode.com/problems/combination-sum-iv
697,Degree of an Array,53.8%,Easy,0.07117627846789498, https://leetcode.com/problems/degree-of-an-array
98,Validate Binary Search Tree,27.8%,Medium,0.057985181512132535, https://leetcode.com/problems/validate-binary-search-tree
200,Number of Islands,46.8%,Medium,0.05694938541936198, https://leetcode.com/problems/number-of-islands
362,Design Hit Counter,63.7%,Medium,0.05622967649867821, https://leetcode.com/problems/design-hit-counter
253,Meeting Rooms II,45.7%,Medium,0.04945628059066218, https://leetcode.com/problems/meeting-rooms-ii
1010,Pairs of Songs With Total Durations Divisible by 60,47.4%,Easy,0.04180336980436055, https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60
76,Minimum Window Substring,34.6%,Hard,0.038324739262994685, https://leetcode.com/problems/minimum-window-substring
238,Product of Array Except Self,60.1%,Medium,0.03482987258052727, https://leetcode.com/problems/product-of-array-except-self
15,3Sum,26.8%,Medium,0.0346167609048592, https://leetcode.com/problems/3sum
4,Median of Two Sorted Arrays,29.6%,Hard,0.034565653112280895, https://leetcode.com/problems/median-of-two-sorted-arrays
236,Lowest Common Ancestor of a Binary Tree,45.7%,Medium,0.029105663386885607, https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
146,LRU Cache,33.2%,Medium,0.028411001832779885, https://leetcode.com/problems/lru-cache
273,Integer to English Words,27.1%,Hard,0.026980053764546055, https://leetcode.com/problems/integer-to-english-words
322,Coin Change,35.5%,Medium,0.024924029676386045, https://leetcode.com/problems/coin-change
138,Copy List with Random Pointer,36.4%,Medium,0.02453734514188008, https://leetcode.com/problems/copy-list-with-random-pointer
49,Group Anagrams,56.9%,Medium,0.02354157682187747, https://leetcode.com/problems/group-anagrams
14,Longest Common Prefix,35.4%,Easy,0.02057347087022327, https://leetcode.com/problems/longest-common-prefix
53,Maximum Subarray,46.5%,Easy,0.019336728821707075, https://leetcode.com/problems/maximum-subarray
206,Reverse Linked List,62.5%,Easy,0.01453513961911317, https://leetcode.com/problems/reverse-linked-list
33,Search in Rotated Sorted Array,34.5%,Medium,0.012857779194289386, https://leetcode.com/problems/search-in-rotated-sorted-array
155,Min Stack,44.5%,Easy,0.010653509851791077, https://leetcode.com/problems/min-stack
380,Insert Delete GetRandom O(1),47.5%,Medium,0.009820849864094454, https://leetcode.com/problems/insert-delete-getrandom-o1
34,Find First and Last Position of Element in Sorted Array,36.2%,Medium,0.009531951009811851, https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
121,Best Time to Buy and Sell Stock,50.5%,Easy,0.00846879565300311, https://leetcode.com/problems/best-time-to-buy-and-sell-stock
56,Merge Intervals,39.3%,Medium,0.007796972706004796, https://leetcode.com/problems/merge-intervals
973,K Closest Points to Origin,63.8%,Medium,0.005773688094426333, https://leetcode.com/problems/k-closest-points-to-origin
21,Merge Two Sorted Lists,53.5%,Easy,0.005067007800877041, https://leetcode.com/problems/merge-two-sorted-lists
101,Symmetric Tree,46.8%,Easy,0.0034057078469827435, https://leetcode.com/problems/symmetric-tree
1025,Divisor Game,66.3%,Easy,0, https://leetcode.com/problems/divisor-game
1389,Create Target Array in the Given Order,84.2%,Easy,0, https://leetcode.com/problems/create-target-array-in-the-given-order
ID,Title,Acceptance,Difficulty,Frequency,Leetcode Question Link
829,Consecutive Numbers Sum,37.5%,Hard,0.4198634169489928, https://leetcode.com/problems/consecutive-numbers-sum
761,Special Binary String,54.7%,Hard,0.3007541540191337, https://leetcode.com/problems/special-binary-string
1353,Maximum Number of Events That Can Be Attended,30.5%,Medium,0.29912265485367395, https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended
1,Two Sum,45.6%,Easy,0.18001339192381483, https://leetcode.com/problems/two-sum
42,Trapping Rain Water,48.9%,Hard,0.16908117464136005, https://leetcode.com/problems/trapping-rain-water
54,Spiral Matrix,34.1%,Medium,0.12572728493821236, https://leetcode.com/problems/spiral-matrix
20,Valid Parentheses,39.0%,Easy,0.10693122823835342, https://leetcode.com/problems/valid-parentheses
735,Asteroid Collision,41.0%,Medium,0.09542395191890234, https://leetcode.com/problems/asteroid-collision
377,Combination Sum IV,45.3%,Medium,0.08101594376008861, https://leetcode.com/problems/combination-sum-iv
697,Degree of an Array,53.8%,Easy,0.07117627846789498, https://leetcode.com/problems/degree-of-an-array
98,Validate Binary Search Tree,27.8%,Medium,0.057985181512132535, https://leetcode.com/problems/validate-binary-search-tree
200,Number of Islands,46.8%,Medium,0.05694938541936198, https://leetcode.com/problems/number-of-islands
362,Design Hit Counter,63.7%,Medium,0.05622967649867821, https://leetcode.com/problems/design-hit-counter
253,Meeting Rooms II,45.7%,Medium,0.04945628059066218, https://leetcode.com/problems/meeting-rooms-ii
1010,Pairs of Songs With Total Durations Divisible by 60,47.4%,Easy,0.04180336980436055, https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60
76,Minimum Window Substring,34.6%,Hard,0.038324739262994685, https://leetcode.com/problems/minimum-window-substring
238,Product of Array Except Self,60.1%,Medium,0.03482987258052727, https://leetcode.com/problems/product-of-array-except-self
15,3Sum,26.8%,Medium,0.0346167609048592, https://leetcode.com/problems/3sum
4,Median of Two Sorted Arrays,29.6%,Hard,0.034565653112280895, https://leetcode.com/problems/median-of-two-sorted-arrays
236,Lowest Common Ancestor of a Binary Tree,45.7%,Medium,0.029105663386885607, https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
146,LRU Cache,33.2%,Medium,0.028411001832779885, https://leetcode.com/problems/lru-cache
273,Integer to English Words,27.1%,Hard,0.026980053764546055, https://leetcode.com/problems/integer-to-english-words
322,Coin Change,35.5%,Medium,0.024924029676386045, https://leetcode.com/problems/coin-change
138,Copy List with Random Pointer,36.4%,Medium,0.02453734514188008, https://leetcode.com/problems/copy-list-with-random-pointer
49,Group Anagrams,56.9%,Medium,0.02354157682187747, https://leetcode.com/problems/group-anagrams
14,Longest Common Prefix,35.4%,Easy,0.02057347087022327, https://leetcode.com/problems/longest-common-prefix
53,Maximum Subarray,46.5%,Easy,0.019336728821707075, https://leetcode.com/problems/maximum-subarray
206,Reverse Linked List,62.5%,Easy,0.01453513961911317, https://leetcode.com/problems/reverse-linked-list
33,Search in Rotated Sorted Array,34.5%,Medium,0.012857779194289386, https://leetcode.com/problems/search-in-rotated-sorted-array
155,Min Stack,44.5%,Easy,0.010653509851791077, https://leetcode.com/problems/min-stack
380,Insert Delete GetRandom O(1),47.5%,Medium,0.009820849864094454, https://leetcode.com/problems/insert-delete-getrandom-o1
34,Find First and Last Position of Element in Sorted Array,36.2%,Medium,0.009531951009811851, https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
121,Best Time to Buy and Sell Stock,50.5%,Easy,0.00846879565300311, https://leetcode.com/problems/best-time-to-buy-and-sell-stock
56,Merge Intervals,39.3%,Medium,0.007796972706004796, https://leetcode.com/problems/merge-intervals
973,K Closest Points to Origin,63.8%,Medium,0.005773688094426333, https://leetcode.com/problems/k-closest-points-to-origin
21,Merge Two Sorted Lists,53.5%,Easy,0.005067007800877041, https://leetcode.com/problems/merge-two-sorted-lists
101,Symmetric Tree,46.8%,Easy,0.0034057078469827435, https://leetcode.com/problems/symmetric-tree
1025,Divisor Game,66.3%,Easy,0, https://leetcode.com/problems/divisor-game
1389,Create Target Array in the Given Order,84.2%,Easy,0, https://leetcode.com/problems/create-target-array-in-the-given-order
1 829 ID Consecutive Numbers Sum Title 37.5% Acceptance Hard Difficulty 0.4198634169489928 Frequency https://leetcode.com/problems/consecutive-numbers-sum Leetcode Question Link
2 761 829 Special Binary String Consecutive Numbers Sum 54.7% 37.5% Hard Hard 0.3007541540191337 0.4198634169489928 https://leetcode.com/problems/special-binary-string https://leetcode.com/problems/consecutive-numbers-sum
3 1353 761 Maximum Number of Events That Can Be Attended Special Binary String 30.5% 54.7% Medium Hard 0.29912265485367395 0.3007541540191337 https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended https://leetcode.com/problems/special-binary-string
4 1 1353 Two Sum Maximum Number of Events That Can Be Attended 45.6% 30.5% Easy Medium 0.18001339192381483 0.29912265485367395 https://leetcode.com/problems/two-sum https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended
5 42 1 Trapping Rain Water Two Sum 48.9% 45.6% Hard Easy 0.16908117464136005 0.18001339192381483 https://leetcode.com/problems/trapping-rain-water https://leetcode.com/problems/two-sum
6 54 42 Spiral Matrix Trapping Rain Water 34.1% 48.9% Medium Hard 0.12572728493821236 0.16908117464136005 https://leetcode.com/problems/spiral-matrix https://leetcode.com/problems/trapping-rain-water
7 20 54 Valid Parentheses Spiral Matrix 39.0% 34.1% Easy Medium 0.10693122823835342 0.12572728493821236 https://leetcode.com/problems/valid-parentheses https://leetcode.com/problems/spiral-matrix
8 735 20 Asteroid Collision Valid Parentheses 41.0% 39.0% Medium Easy 0.09542395191890234 0.10693122823835342 https://leetcode.com/problems/asteroid-collision https://leetcode.com/problems/valid-parentheses
9 377 735 Combination Sum IV Asteroid Collision 45.3% 41.0% Medium Medium 0.08101594376008861 0.09542395191890234 https://leetcode.com/problems/combination-sum-iv https://leetcode.com/problems/asteroid-collision
10 697 377 Degree of an Array Combination Sum IV 53.8% 45.3% Easy Medium 0.07117627846789498 0.08101594376008861 https://leetcode.com/problems/degree-of-an-array https://leetcode.com/problems/combination-sum-iv
11 98 697 Validate Binary Search Tree Degree of an Array 27.8% 53.8% Medium Easy 0.057985181512132535 0.07117627846789498 https://leetcode.com/problems/validate-binary-search-tree https://leetcode.com/problems/degree-of-an-array
12 200 98 Number of Islands Validate Binary Search Tree 46.8% 27.8% Medium Medium 0.05694938541936198 0.057985181512132535 https://leetcode.com/problems/number-of-islands https://leetcode.com/problems/validate-binary-search-tree
13 362 200 Design Hit Counter Number of Islands 63.7% 46.8% Medium Medium 0.05622967649867821 0.05694938541936198 https://leetcode.com/problems/design-hit-counter https://leetcode.com/problems/number-of-islands
14 253 362 Meeting Rooms II Design Hit Counter 45.7% 63.7% Medium Medium 0.04945628059066218 0.05622967649867821 https://leetcode.com/problems/meeting-rooms-ii https://leetcode.com/problems/design-hit-counter
15 1010 253 Pairs of Songs With Total Durations Divisible by 60 Meeting Rooms II 47.4% 45.7% Easy Medium 0.04180336980436055 0.04945628059066218 https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60 https://leetcode.com/problems/meeting-rooms-ii
16 76 1010 Minimum Window Substring Pairs of Songs With Total Durations Divisible by 60 34.6% 47.4% Hard Easy 0.038324739262994685 0.04180336980436055 https://leetcode.com/problems/minimum-window-substring https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60
17 238 76 Product of Array Except Self Minimum Window Substring 60.1% 34.6% Medium Hard 0.03482987258052727 0.038324739262994685 https://leetcode.com/problems/product-of-array-except-self https://leetcode.com/problems/minimum-window-substring
18 15 238 3Sum Product of Array Except Self 26.8% 60.1% Medium Medium 0.0346167609048592 0.03482987258052727 https://leetcode.com/problems/3sum https://leetcode.com/problems/product-of-array-except-self
19 4 15 Median of Two Sorted Arrays 3Sum 29.6% 26.8% Hard Medium 0.034565653112280895 0.0346167609048592 https://leetcode.com/problems/median-of-two-sorted-arrays https://leetcode.com/problems/3sum
20 236 4 Lowest Common Ancestor of a Binary Tree Median of Two Sorted Arrays 45.7% 29.6% Medium Hard 0.029105663386885607 0.034565653112280895 https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree https://leetcode.com/problems/median-of-two-sorted-arrays
21 146 236 LRU Cache Lowest Common Ancestor of a Binary Tree 33.2% 45.7% Medium Medium 0.028411001832779885 0.029105663386885607 https://leetcode.com/problems/lru-cache https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
22 273 146 Integer to English Words LRU Cache 27.1% 33.2% Hard Medium 0.026980053764546055 0.028411001832779885 https://leetcode.com/problems/integer-to-english-words https://leetcode.com/problems/lru-cache
23 322 273 Coin Change Integer to English Words 35.5% 27.1% Medium Hard 0.024924029676386045 0.026980053764546055 https://leetcode.com/problems/coin-change https://leetcode.com/problems/integer-to-english-words
24 138 322 Copy List with Random Pointer Coin Change 36.4% 35.5% Medium Medium 0.02453734514188008 0.024924029676386045 https://leetcode.com/problems/copy-list-with-random-pointer https://leetcode.com/problems/coin-change
25 49 138 Group Anagrams Copy List with Random Pointer 56.9% 36.4% Medium Medium 0.02354157682187747 0.02453734514188008 https://leetcode.com/problems/group-anagrams https://leetcode.com/problems/copy-list-with-random-pointer
26 14 49 Longest Common Prefix Group Anagrams 35.4% 56.9% Easy Medium 0.02057347087022327 0.02354157682187747 https://leetcode.com/problems/longest-common-prefix https://leetcode.com/problems/group-anagrams
27 53 14 Maximum Subarray Longest Common Prefix 46.5% 35.4% Easy Easy 0.019336728821707075 0.02057347087022327 https://leetcode.com/problems/maximum-subarray https://leetcode.com/problems/longest-common-prefix
28 206 53 Reverse Linked List Maximum Subarray 62.5% 46.5% Easy Easy 0.01453513961911317 0.019336728821707075 https://leetcode.com/problems/reverse-linked-list https://leetcode.com/problems/maximum-subarray
29 33 206 Search in Rotated Sorted Array Reverse Linked List 34.5% 62.5% Medium Easy 0.012857779194289386 0.01453513961911317 https://leetcode.com/problems/search-in-rotated-sorted-array https://leetcode.com/problems/reverse-linked-list
30 155 33 Min Stack Search in Rotated Sorted Array 44.5% 34.5% Easy Medium 0.010653509851791077 0.012857779194289386 https://leetcode.com/problems/min-stack https://leetcode.com/problems/search-in-rotated-sorted-array
31 380 155 Insert Delete GetRandom O(1) Min Stack 47.5% 44.5% Medium Easy 0.009820849864094454 0.010653509851791077 https://leetcode.com/problems/insert-delete-getrandom-o1 https://leetcode.com/problems/min-stack
32 34 380 Find First and Last Position of Element in Sorted Array Insert Delete GetRandom O(1) 36.2% 47.5% Medium Medium 0.009531951009811851 0.009820849864094454 https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array https://leetcode.com/problems/insert-delete-getrandom-o1
33 121 34 Best Time to Buy and Sell Stock Find First and Last Position of Element in Sorted Array 50.5% 36.2% Easy Medium 0.00846879565300311 0.009531951009811851 https://leetcode.com/problems/best-time-to-buy-and-sell-stock https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
34 56 121 Merge Intervals Best Time to Buy and Sell Stock 39.3% 50.5% Medium Easy 0.007796972706004796 0.00846879565300311 https://leetcode.com/problems/merge-intervals https://leetcode.com/problems/best-time-to-buy-and-sell-stock
35 973 56 K Closest Points to Origin Merge Intervals 63.8% 39.3% Medium Medium 0.005773688094426333 0.007796972706004796 https://leetcode.com/problems/k-closest-points-to-origin https://leetcode.com/problems/merge-intervals
36 21 973 Merge Two Sorted Lists K Closest Points to Origin 53.5% 63.8% Easy Medium 0.005067007800877041 0.005773688094426333 https://leetcode.com/problems/merge-two-sorted-lists https://leetcode.com/problems/k-closest-points-to-origin
37 101 21 Symmetric Tree Merge Two Sorted Lists 46.8% 53.5% Easy Easy 0.0034057078469827435 0.005067007800877041 https://leetcode.com/problems/symmetric-tree https://leetcode.com/problems/merge-two-sorted-lists
38 1025 101 Divisor Game Symmetric Tree 66.3% 46.8% Easy Easy 0 0.0034057078469827435 https://leetcode.com/problems/divisor-game https://leetcode.com/problems/symmetric-tree
39 1389 1025 Create Target Array in the Given Order Divisor Game 84.2% 66.3% Easy Easy 0 0 https://leetcode.com/problems/create-target-array-in-the-given-order https://leetcode.com/problems/divisor-game
40 1389 Create Target Array in the Given Order 84.2% Easy 0 https://leetcode.com/problems/create-target-array-in-the-given-order