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

3.2 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2256Paint House52.1%Easy0.8299890646199083https://leetcode.com/problems/paint-house
3780Reaching Points29.4%Hard0.6779561713749561https://leetcode.com/problems/reaching-points
4635Design Log Storage System58.6%Medium0.48162092276953306https://leetcode.com/problems/design-log-storage-system
557Insert Interval33.5%Hard0.28528567416411https://leetcode.com/problems/insert-interval
61326Minimum Number of Taps to Open to Water a Garden43.6%Hard0.2786048543006643https://leetcode.com/problems/minimum-number-of-taps-to-open-to-water-a-garden
7945Minimum Increment to Make Array Unique46.3%Medium0.27427904232444056https://leetcode.com/problems/minimum-increment-to-make-array-unique
8547Friend Circles58.6%Medium0.22246660738239243https://leetcode.com/problems/friend-circles
9532K-diff Pairs in an Array31.6%Easy0.15718558352241233https://leetcode.com/problems/k-diff-pairs-in-an-array
10647Palindromic Substrings60.6%Medium0.06329624434241725https://leetcode.com/problems/palindromic-substrings
11307Range Sum Query - Mutable34.6%Medium0.04935211978972769https://leetcode.com/problems/range-sum-query-mutable
12341Flatten Nested List Iterator52.9%Medium0.04440788848944038https://leetcode.com/problems/flatten-nested-list-iterator
13716Max Stack42.6%Easy0.042695919196489414https://leetcode.com/problems/max-stack
14161One Edit Distance32.3%Medium0.03626870773745257https://leetcode.com/problems/one-edit-distance
15528Random Pick with Weight43.9%Medium0.03306693626657339https://leetcode.com/problems/random-pick-with-weight
16496Next Greater Element I63.8%Easy0.029462032730316202https://leetcode.com/problems/next-greater-element-i
17981Time Based Key-Value Store53.1%Medium0.02226024024151985https://leetcode.com/problems/time-based-key-value-store
18540Single Element in a Sorted Array57.9%Medium0.0192128868599912https://leetcode.com/problems/single-element-in-a-sorted-array
19239Sliding Window Maximum43.0%Hard0.01768566434627554https://leetcode.com/problems/sliding-window-maximum
20706Design HashMap61.3%Easy0.01752893260576219https://leetcode.com/problems/design-hashmap
21767Reorganize String48.7%Medium0.01329806830463147https://leetcode.com/problems/reorganize-string
22269Alien Dictionary33.3%Hard0.012730916694039954https://leetcode.com/problems/alien-dictionary
2323Merge k Sorted Lists40.2%Hard0.009092808657599025https://leetcode.com/problems/merge-k-sorted-lists
2410Regular Expression Matching26.8%Hard0.0071865203293987245https://leetcode.com/problems/regular-expression-matching
25105Construct Binary Tree from Preorder and Inorder Traversal48.8%Medium0.005628268691614718https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal
26139Word Break40.1%Medium0.003894465052690167https://leetcode.com/problems/word-break
2756Merge Intervals39.3%Medium0.0034728286335985107https://leetcode.com/problems/merge-intervals
28210Course Schedule II40.7%Medium0.0019086707135282834https://leetcode.com/problems/course-schedule-ii
291Two Sum45.6%Easy0.0008206138651873125https://leetcode.com/problems/two-sum