Files
LeetCode-Questions-CompanyWise/yelp_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

4.1 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2599Minimum Index Sum of Two Lists50.7%Easy2.30819311902822https://leetcode.com/problems/minimum-index-sum-of-two-lists
3564Find the Closest Palindrome19.7%Hard1.686299975418363https://leetcode.com/problems/find-the-closest-palindrome
4273Integer to English Words27.1%Hard1.064406831808506https://leetcode.com/problems/integer-to-english-words
5332Reconstruct Itinerary36.7%Medium1.0408834009118708https://leetcode.com/problems/reconstruct-itinerary
6355Design Twitter30.3%Medium1.0346399906708852https://leetcode.com/problems/design-twitter
756Merge Intervals39.3%Medium0.987222928819735https://leetcode.com/problems/merge-intervals
849Group Anagrams56.9%Medium0.43750160048327236https://leetcode.com/problems/group-anagrams
9692Top K Frequent Words51.8%Medium0.43507396043031815https://leetcode.com/problems/top-k-frequent-words
10139Word Break40.1%Medium0.35781564515486297https://leetcode.com/problems/word-break
11218The Skyline Problem34.6%Hard0.3456466128972542https://leetcode.com/problems/the-skyline-problem
12347Top K Frequent Elements61.2%Medium0.3398753854298785https://leetcode.com/problems/top-k-frequent-elements
131126Active Businesses68.5%Medium0.3208150073042144https://leetcode.com/problems/active-businesses
14528Random Pick with Weight43.9%Medium0.31740043778091953https://leetcode.com/problems/random-pick-with-weight
15253Meeting Rooms II45.7%Medium0.29470460870072https://leetcode.com/problems/meeting-rooms-ii
16127Word Ladder29.6%Medium0.29067608666438566https://leetcode.com/problems/word-ladder
171333Filter Restaurants by Vegan-Friendly & Price and Distance54.6%Medium0.263911853117869https://leetcode.com/problems/filter-restaurants-by-vegan-friendly-price-and-distance
183Longest Substring Without Repeating Characters30.4%Medium0.20227578684440572https://leetcode.com/problems/longest-substring-without-repeating-characters
1914Longest Common Prefix35.4%Easy0.1714957284786035https://leetcode.com/problems/longest-common-prefix
20205Isomorphic Strings39.8%Easy0.1703978238463443https://leetcode.com/problems/isomorphic-strings
21126Word Ladder II22.1%Hard0.15135837956172798https://leetcode.com/problems/word-ladder-ii
221Two Sum45.6%Easy0.1394299376526441https://leetcode.com/problems/two-sum
2322Generate Parentheses62.7%Medium0.12417283375515446https://leetcode.com/problems/generate-parentheses
24207Course Schedule43.1%Medium0.11725761496207857https://leetcode.com/problems/course-schedule
25192Word Frequency25.8%Medium0.10186917331721722https://leetcode.com/problems/word-frequency
26380Insert Delete GetRandom O(1)47.5%Medium0.08509738264123867https://leetcode.com/problems/insert-delete-getrandom-o1
27784Letter Case Permutation64.6%Medium0.0787033338274549https://leetcode.com/problems/letter-case-permutation
2839Combination Sum56.1%Medium0.05030398316850793https://leetcode.com/problems/combination-sum
29239Sliding Window Maximum43.0%Hard0.031228142547585713https://leetcode.com/problems/sliding-window-maximum
30206Reverse Linked List62.5%Easy0.02086427467076072https://leetcode.com/problems/reverse-linked-list
31349Intersection of Two Arrays62.5%Easy0.016239981598488416https://leetcode.com/problems/intersection-of-two-arrays
32242Valid Anagram56.9%Easy0.009322628116274939https://leetcode.com/problems/valid-anagram
33394Decode String50.0%Medium0.008166644000272283https://leetcode.com/problems/decode-string
34151Reverse Words in a String21.9%Medium0.003456091915988908https://leetcode.com/problems/reverse-words-in-a-string
35381Insert Delete GetRandom O(1) - Duplicates allowed34.1%Hard0https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed
36443String Compression41.3%Easy0https://leetcode.com/problems/string-compression
371436Destination City77.3%Easy0https://leetcode.com/problems/destination-city
381455Check If a Word Occurs As a Prefix of Any Word in a Sentence64.6%Easy0https://leetcode.com/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence