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