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,37 +1,38 @@
146,LRU Cache,33.2%,Medium,0.17336380847901145, https://leetcode.com/problems/lru-cache
387,First Unique Character in a String,53.4%,Easy,0.15790706492146894, https://leetcode.com/problems/first-unique-character-in-a-string
236,Lowest Common Ancestor of a Binary Tree,45.7%,Medium,0.12961627631364242, https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
273,Integer to English Words,27.1%,Hard,0.11180303680851608, https://leetcode.com/problems/integer-to-english-words
449,Serialize and Deserialize BST,52.0%,Medium,0.08351224820068956, https://leetcode.com/problems/serialize-and-deserialize-bst
981,Time Based Key-Value Store,53.1%,Medium,0.08269171584511335, https://leetcode.com/problems/time-based-key-value-store
353,Design Snake Game,34.2%,Medium,0.05807146640389905, https://leetcode.com/problems/design-snake-game
443,String Compression,41.3%,Easy,0.052333720049023605, https://leetcode.com/problems/string-compression
437,Path Sum III,47.2%,Medium,0.04550116684579005, https://leetcode.com/problems/path-sum-iii
43,Multiply Strings,33.9%,Medium,0.034530836872391495, https://leetcode.com/problems/multiply-strings
362,Design Hit Counter,63.7%,Medium,0.024317307650706343, https://leetcode.com/problems/design-hit-counter
127,Word Ladder,29.6%,Medium,0.022731480259023204, https://leetcode.com/problems/word-ladder
739,Daily Temperatures,63.3%,Medium,0.02133793617365773, https://leetcode.com/problems/daily-temperatures
285,Inorder Successor in BST,40.4%,Medium,0.021266085846178402, https://leetcode.com/problems/inorder-successor-in-bst
113,Path Sum II,46.7%,Medium,0.020970013522095075, https://leetcode.com/problems/path-sum-ii
112,Path Sum,41.2%,Easy,0.0207557068297192, https://leetcode.com/problems/path-sum
289,Game of Life,54.5%,Medium,0.01662548684613402, https://leetcode.com/problems/game-of-life
299,Bulls and Cows,42.4%,Easy,0.015504186535965254, https://leetcode.com/problems/bulls-and-cows
4,Median of Two Sorted Arrays,29.6%,Hard,0.014786333530311531, https://leetcode.com/problems/median-of-two-sorted-arrays
150,Evaluate Reverse Polish Notation,36.3%,Medium,0.01355493475171521, https://leetcode.com/problems/evaluate-reverse-polish-notation
695,Max Area of Island,62.7%,Medium,0.012132390248237822, https://leetcode.com/problems/max-area-of-island
212,Word Search II,34.9%,Hard,0.009405195123101255, https://leetcode.com/problems/word-search-ii
20,Valid Parentheses,39.0%,Easy,0.008761898231759775, https://leetcode.com/problems/valid-parentheses
53,Maximum Subarray,46.5%,Easy,0.008272628741228982, https://leetcode.com/problems/maximum-subarray
33,Search in Rotated Sorted Array,34.5%,Medium,0.006961661779487692, https://leetcode.com/problems/search-in-rotated-sorted-array
79,Word Search,35.6%,Medium,0.006548007844690591, https://leetcode.com/problems/word-search
3,Longest Substring Without Repeating Characters,30.4%,Medium,0.005927699633275225, https://leetcode.com/problems/longest-substring-without-repeating-characters
268,Missing Number,51.7%,Easy,0.0046685425596334085, https://leetcode.com/problems/missing-number
121,Best Time to Buy and Sell Stock,50.5%,Easy,0.004580393778309264, https://leetcode.com/problems/best-time-to-buy-and-sell-stock
23,Merge k Sorted Lists,40.2%,Hard,0.0038759738446929853, https://leetcode.com/problems/merge-k-sorted-lists
139,Word Break,40.1%,Medium,0.003755167762323698, https://leetcode.com/problems/word-break
8,String to Integer (atoi),15.4%,Medium,0.003623192369420312, https://leetcode.com/problems/string-to-integer-atoi
13,Roman to Integer,55.7%,Easy,0.0032749333347487667, https://leetcode.com/problems/roman-to-integer
1,Two Sum,45.6%,Easy,0.003139596786381058, https://leetcode.com/problems/two-sum
283,Move Zeroes,57.8%,Easy,0.002758622439079723, https://leetcode.com/problems/move-zeroes
140,Word Break II,32.6%,Hard,0.0026759448668004808, https://leetcode.com/problems/word-break-ii
151,Reverse Words in a String,21.9%,Medium,0.0015260771341435947, https://leetcode.com/problems/reverse-words-in-a-string
ID,Title,Acceptance,Difficulty,Frequency,Leetcode Question Link
146,LRU Cache,33.2%,Medium,0.17336380847901145, https://leetcode.com/problems/lru-cache
387,First Unique Character in a String,53.4%,Easy,0.15790706492146894, https://leetcode.com/problems/first-unique-character-in-a-string
236,Lowest Common Ancestor of a Binary Tree,45.7%,Medium,0.12961627631364242, https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
273,Integer to English Words,27.1%,Hard,0.11180303680851608, https://leetcode.com/problems/integer-to-english-words
449,Serialize and Deserialize BST,52.0%,Medium,0.08351224820068956, https://leetcode.com/problems/serialize-and-deserialize-bst
981,Time Based Key-Value Store,53.1%,Medium,0.08269171584511335, https://leetcode.com/problems/time-based-key-value-store
353,Design Snake Game,34.2%,Medium,0.05807146640389905, https://leetcode.com/problems/design-snake-game
443,String Compression,41.3%,Easy,0.052333720049023605, https://leetcode.com/problems/string-compression
437,Path Sum III,47.2%,Medium,0.04550116684579005, https://leetcode.com/problems/path-sum-iii
43,Multiply Strings,33.9%,Medium,0.034530836872391495, https://leetcode.com/problems/multiply-strings
362,Design Hit Counter,63.7%,Medium,0.024317307650706343, https://leetcode.com/problems/design-hit-counter
127,Word Ladder,29.6%,Medium,0.022731480259023204, https://leetcode.com/problems/word-ladder
739,Daily Temperatures,63.3%,Medium,0.02133793617365773, https://leetcode.com/problems/daily-temperatures
285,Inorder Successor in BST,40.4%,Medium,0.021266085846178402, https://leetcode.com/problems/inorder-successor-in-bst
113,Path Sum II,46.7%,Medium,0.020970013522095075, https://leetcode.com/problems/path-sum-ii
112,Path Sum,41.2%,Easy,0.0207557068297192, https://leetcode.com/problems/path-sum
289,Game of Life,54.5%,Medium,0.01662548684613402, https://leetcode.com/problems/game-of-life
299,Bulls and Cows,42.4%,Easy,0.015504186535965254, https://leetcode.com/problems/bulls-and-cows
4,Median of Two Sorted Arrays,29.6%,Hard,0.014786333530311531, https://leetcode.com/problems/median-of-two-sorted-arrays
150,Evaluate Reverse Polish Notation,36.3%,Medium,0.01355493475171521, https://leetcode.com/problems/evaluate-reverse-polish-notation
695,Max Area of Island,62.7%,Medium,0.012132390248237822, https://leetcode.com/problems/max-area-of-island
212,Word Search II,34.9%,Hard,0.009405195123101255, https://leetcode.com/problems/word-search-ii
20,Valid Parentheses,39.0%,Easy,0.008761898231759775, https://leetcode.com/problems/valid-parentheses
53,Maximum Subarray,46.5%,Easy,0.008272628741228982, https://leetcode.com/problems/maximum-subarray
33,Search in Rotated Sorted Array,34.5%,Medium,0.006961661779487692, https://leetcode.com/problems/search-in-rotated-sorted-array
79,Word Search,35.6%,Medium,0.006548007844690591, https://leetcode.com/problems/word-search
3,Longest Substring Without Repeating Characters,30.4%,Medium,0.005927699633275225, https://leetcode.com/problems/longest-substring-without-repeating-characters
268,Missing Number,51.7%,Easy,0.0046685425596334085, https://leetcode.com/problems/missing-number
121,Best Time to Buy and Sell Stock,50.5%,Easy,0.004580393778309264, https://leetcode.com/problems/best-time-to-buy-and-sell-stock
23,Merge k Sorted Lists,40.2%,Hard,0.0038759738446929853, https://leetcode.com/problems/merge-k-sorted-lists
139,Word Break,40.1%,Medium,0.003755167762323698, https://leetcode.com/problems/word-break
8,String to Integer (atoi),15.4%,Medium,0.003623192369420312, https://leetcode.com/problems/string-to-integer-atoi
13,Roman to Integer,55.7%,Easy,0.0032749333347487667, https://leetcode.com/problems/roman-to-integer
1,Two Sum,45.6%,Easy,0.003139596786381058, https://leetcode.com/problems/two-sum
283,Move Zeroes,57.8%,Easy,0.002758622439079723, https://leetcode.com/problems/move-zeroes
140,Word Break II,32.6%,Hard,0.0026759448668004808, https://leetcode.com/problems/word-break-ii
151,Reverse Words in a String,21.9%,Medium,0.0015260771341435947, https://leetcode.com/problems/reverse-words-in-a-string
1 146 ID LRU Cache Title 33.2% Acceptance Medium Difficulty 0.17336380847901145 Frequency https://leetcode.com/problems/lru-cache Leetcode Question Link
2 387 146 First Unique Character in a String LRU Cache 53.4% 33.2% Easy Medium 0.15790706492146894 0.17336380847901145 https://leetcode.com/problems/first-unique-character-in-a-string https://leetcode.com/problems/lru-cache
3 236 387 Lowest Common Ancestor of a Binary Tree First Unique Character in a String 45.7% 53.4% Medium Easy 0.12961627631364242 0.15790706492146894 https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree https://leetcode.com/problems/first-unique-character-in-a-string
4 273 236 Integer to English Words Lowest Common Ancestor of a Binary Tree 27.1% 45.7% Hard Medium 0.11180303680851608 0.12961627631364242 https://leetcode.com/problems/integer-to-english-words https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
5 449 273 Serialize and Deserialize BST Integer to English Words 52.0% 27.1% Medium Hard 0.08351224820068956 0.11180303680851608 https://leetcode.com/problems/serialize-and-deserialize-bst https://leetcode.com/problems/integer-to-english-words
6 981 449 Time Based Key-Value Store Serialize and Deserialize BST 53.1% 52.0% Medium Medium 0.08269171584511335 0.08351224820068956 https://leetcode.com/problems/time-based-key-value-store https://leetcode.com/problems/serialize-and-deserialize-bst
7 353 981 Design Snake Game Time Based Key-Value Store 34.2% 53.1% Medium Medium 0.05807146640389905 0.08269171584511335 https://leetcode.com/problems/design-snake-game https://leetcode.com/problems/time-based-key-value-store
8 443 353 String Compression Design Snake Game 41.3% 34.2% Easy Medium 0.052333720049023605 0.05807146640389905 https://leetcode.com/problems/string-compression https://leetcode.com/problems/design-snake-game
9 437 443 Path Sum III String Compression 47.2% 41.3% Medium Easy 0.04550116684579005 0.052333720049023605 https://leetcode.com/problems/path-sum-iii https://leetcode.com/problems/string-compression
10 43 437 Multiply Strings Path Sum III 33.9% 47.2% Medium Medium 0.034530836872391495 0.04550116684579005 https://leetcode.com/problems/multiply-strings https://leetcode.com/problems/path-sum-iii
11 362 43 Design Hit Counter Multiply Strings 63.7% 33.9% Medium Medium 0.024317307650706343 0.034530836872391495 https://leetcode.com/problems/design-hit-counter https://leetcode.com/problems/multiply-strings
12 127 362 Word Ladder Design Hit Counter 29.6% 63.7% Medium Medium 0.022731480259023204 0.024317307650706343 https://leetcode.com/problems/word-ladder https://leetcode.com/problems/design-hit-counter
13 739 127 Daily Temperatures Word Ladder 63.3% 29.6% Medium Medium 0.02133793617365773 0.022731480259023204 https://leetcode.com/problems/daily-temperatures https://leetcode.com/problems/word-ladder
14 285 739 Inorder Successor in BST Daily Temperatures 40.4% 63.3% Medium Medium 0.021266085846178402 0.02133793617365773 https://leetcode.com/problems/inorder-successor-in-bst https://leetcode.com/problems/daily-temperatures
15 113 285 Path Sum II Inorder Successor in BST 46.7% 40.4% Medium Medium 0.020970013522095075 0.021266085846178402 https://leetcode.com/problems/path-sum-ii https://leetcode.com/problems/inorder-successor-in-bst
16 112 113 Path Sum Path Sum II 41.2% 46.7% Easy Medium 0.0207557068297192 0.020970013522095075 https://leetcode.com/problems/path-sum https://leetcode.com/problems/path-sum-ii
17 289 112 Game of Life Path Sum 54.5% 41.2% Medium Easy 0.01662548684613402 0.0207557068297192 https://leetcode.com/problems/game-of-life https://leetcode.com/problems/path-sum
18 299 289 Bulls and Cows Game of Life 42.4% 54.5% Easy Medium 0.015504186535965254 0.01662548684613402 https://leetcode.com/problems/bulls-and-cows https://leetcode.com/problems/game-of-life
19 4 299 Median of Two Sorted Arrays Bulls and Cows 29.6% 42.4% Hard Easy 0.014786333530311531 0.015504186535965254 https://leetcode.com/problems/median-of-two-sorted-arrays https://leetcode.com/problems/bulls-and-cows
20 150 4 Evaluate Reverse Polish Notation Median of Two Sorted Arrays 36.3% 29.6% Medium Hard 0.01355493475171521 0.014786333530311531 https://leetcode.com/problems/evaluate-reverse-polish-notation https://leetcode.com/problems/median-of-two-sorted-arrays
21 695 150 Max Area of Island Evaluate Reverse Polish Notation 62.7% 36.3% Medium Medium 0.012132390248237822 0.01355493475171521 https://leetcode.com/problems/max-area-of-island https://leetcode.com/problems/evaluate-reverse-polish-notation
22 212 695 Word Search II Max Area of Island 34.9% 62.7% Hard Medium 0.009405195123101255 0.012132390248237822 https://leetcode.com/problems/word-search-ii https://leetcode.com/problems/max-area-of-island
23 20 212 Valid Parentheses Word Search II 39.0% 34.9% Easy Hard 0.008761898231759775 0.009405195123101255 https://leetcode.com/problems/valid-parentheses https://leetcode.com/problems/word-search-ii
24 53 20 Maximum Subarray Valid Parentheses 46.5% 39.0% Easy Easy 0.008272628741228982 0.008761898231759775 https://leetcode.com/problems/maximum-subarray https://leetcode.com/problems/valid-parentheses
25 33 53 Search in Rotated Sorted Array Maximum Subarray 34.5% 46.5% Medium Easy 0.006961661779487692 0.008272628741228982 https://leetcode.com/problems/search-in-rotated-sorted-array https://leetcode.com/problems/maximum-subarray
26 79 33 Word Search Search in Rotated Sorted Array 35.6% 34.5% Medium Medium 0.006548007844690591 0.006961661779487692 https://leetcode.com/problems/word-search https://leetcode.com/problems/search-in-rotated-sorted-array
27 3 79 Longest Substring Without Repeating Characters Word Search 30.4% 35.6% Medium Medium 0.005927699633275225 0.006548007844690591 https://leetcode.com/problems/longest-substring-without-repeating-characters https://leetcode.com/problems/word-search
28 268 3 Missing Number Longest Substring Without Repeating Characters 51.7% 30.4% Easy Medium 0.0046685425596334085 0.005927699633275225 https://leetcode.com/problems/missing-number https://leetcode.com/problems/longest-substring-without-repeating-characters
29 121 268 Best Time to Buy and Sell Stock Missing Number 50.5% 51.7% Easy Easy 0.004580393778309264 0.0046685425596334085 https://leetcode.com/problems/best-time-to-buy-and-sell-stock https://leetcode.com/problems/missing-number
30 23 121 Merge k Sorted Lists Best Time to Buy and Sell Stock 40.2% 50.5% Hard Easy 0.0038759738446929853 0.004580393778309264 https://leetcode.com/problems/merge-k-sorted-lists https://leetcode.com/problems/best-time-to-buy-and-sell-stock
31 139 23 Word Break Merge k Sorted Lists 40.1% 40.2% Medium Hard 0.003755167762323698 0.0038759738446929853 https://leetcode.com/problems/word-break https://leetcode.com/problems/merge-k-sorted-lists
32 8 139 String to Integer (atoi) Word Break 15.4% 40.1% Medium Medium 0.003623192369420312 0.003755167762323698 https://leetcode.com/problems/string-to-integer-atoi https://leetcode.com/problems/word-break
33 13 8 Roman to Integer String to Integer (atoi) 55.7% 15.4% Easy Medium 0.0032749333347487667 0.003623192369420312 https://leetcode.com/problems/roman-to-integer https://leetcode.com/problems/string-to-integer-atoi
34 1 13 Two Sum Roman to Integer 45.6% 55.7% Easy Easy 0.003139596786381058 0.0032749333347487667 https://leetcode.com/problems/two-sum https://leetcode.com/problems/roman-to-integer
35 283 1 Move Zeroes Two Sum 57.8% 45.6% Easy Easy 0.002758622439079723 0.003139596786381058 https://leetcode.com/problems/move-zeroes https://leetcode.com/problems/two-sum
36 140 283 Word Break II Move Zeroes 32.6% 57.8% Hard Easy 0.0026759448668004808 0.002758622439079723 https://leetcode.com/problems/word-break-ii https://leetcode.com/problems/move-zeroes
37 151 140 Reverse Words in a String Word Break II 21.9% 32.6% Medium Hard 0.0015260771341435947 0.0026759448668004808 https://leetcode.com/problems/reverse-words-in-a-string https://leetcode.com/problems/word-break-ii
38 151 Reverse Words in a String 21.9% Medium 0.0015260771341435947 https://leetcode.com/problems/reverse-words-in-a-string