Files
LeetCode-Questions-CompanyWise/jpmorgan_alltime.csv
Krishna Kumar Dey fb5f78b55e 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)

```
2023-04-01 11:07:49 +05:30

2.4 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2202Happy Number50.4%Easy3.472501931831341https://leetcode.com/problems/happy-number
320Valid Parentheses39.0%Easy2.091183527592892https://leetcode.com/problems/valid-parentheses
4322Coin Change35.5%Medium0.7098651233544434https://leetcode.com/problems/coin-change
5121Best Time to Buy and Sell Stock50.5%Easy0.24778819384825912https://leetcode.com/problems/best-time-to-buy-and-sell-stock
61328Break a Palindrome43.3%Medium0.21795507637539235https://leetcode.com/problems/break-a-palindrome
731Next Permutation32.6%Medium0.11480808652664298https://leetcode.com/problems/next-permutation
8273Integer to English Words27.1%Hard0.10380963271229693https://leetcode.com/problems/integer-to-english-words
99Palindrome Number48.4%Easy0.08804403243108966https://leetcode.com/problems/palindrome-number
101Two Sum45.6%Easy0.07889903801250679https://leetcode.com/problems/two-sum
117Reverse Integer25.8%Easy0.054824382173728654https://leetcode.com/problems/reverse-integer
1217Letter Combinations of a Phone Number46.8%Medium0.052632421620123555https://leetcode.com/problems/letter-combinations-of-a-phone-number
13200Number of Islands46.8%Medium0.04526299408355752https://leetcode.com/problems/number-of-islands
1453Maximum Subarray46.5%Easy0.04299340685592046https://leetcode.com/problems/maximum-subarray
155Longest Palindromic Substring29.5%Medium0.035860192879893796https://leetcode.com/problems/longest-palindromic-substring
164Median of Two Sorted Arrays29.6%Hard0.034565653112280895https://leetcode.com/problems/median-of-two-sorted-arrays
1733Search in Rotated Sorted Array34.5%Medium0.0287009496170278https://leetcode.com/problems/search-in-rotated-sorted-array
18146LRU Cache33.2%Medium0.028411001832779885https://leetcode.com/problems/lru-cache
19349Intersection of Two Arrays62.5%Easy0.016239981598488416https://leetcode.com/problems/intersection-of-two-arrays
2079Word Search35.6%Medium0.014883688014740005https://leetcode.com/problems/word-search
21215Kth Largest Element in an Array55.4%Medium0.008759180089881562https://leetcode.com/problems/kth-largest-element-in-an-array
2239Combination Sum56.1%Medium0.005715934396440999https://leetcode.com/problems/combination-sum
23387First Unique Character in a String53.4%Easy0.00418541994270691https://leetcode.com/problems/first-unique-character-in-a-string