LeetCode-Questions-CompanyWise/atlassian_6months.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.7 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
21071Greatest Common Divisor of Strings52.9%Easy0.11954237676819192https://leetcode.com/problems/greatest-common-divisor-of-strings
3366Find Leaves of Binary Tree70.6%Medium0.1180240366638968https://leetcode.com/problems/find-leaves-of-binary-tree
41223Dice Roll Simulation45.6%Medium0.10212949507637983https://leetcode.com/problems/dice-roll-simulation
5362Design Hit Counter63.7%Medium0.09787757530957068https://leetcode.com/problems/design-hit-counter
6981Time Based Key-Value Store53.1%Medium0.08621383525234454https://leetcode.com/problems/time-based-key-value-store
71366Rank Teams by Votes53.8%Medium0.07223355735937158https://leetcode.com/problems/rank-teams-by-votes
8300Longest Increasing Subsequence42.6%Medium0.06265630749555627https://leetcode.com/problems/longest-increasing-subsequence
9359Logger Rate Limiter70.8%Easy0.0467617659080393https://leetcode.com/problems/logger-rate-limiter
1017Letter Combinations of a Phone Number46.8%Medium0.03893646375009422https://leetcode.com/problems/letter-combinations-of-a-phone-number
11150Evaluate Reverse Polish Notation36.3%Medium0.031526253646773944https://leetcode.com/problems/evaluate-reverse-polish-notation
12284Peeking Iterator45.7%Medium0.03110670713225487https://leetcode.com/problems/peeking-iterator
1331Next Permutation32.6%Medium0.023747034562878154https://leetcode.com/problems/next-permutation
14540Single Element in a Sorted Array57.9%Medium0.0192128868599912https://leetcode.com/problems/single-element-in-a-sorted-array
1598Validate Binary Search Tree27.8%Medium0.01825801101705589https://leetcode.com/problems/validate-binary-search-tree
16706Design HashMap61.3%Easy0.01752893260576219https://leetcode.com/problems/design-hashmap
17872Leaf-Similar Trees64.5%Easy0.01752125418714782https://leetcode.com/problems/leaf-similar-trees
18173Binary Search Tree Iterator56.6%Medium0.008489015324911316https://leetcode.com/problems/binary-search-tree-iterator
19236Lowest Common Ancestor of a Binary Tree45.7%Medium0.004714210262726446https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
2022Generate Parentheses62.7%Medium0.0043611059090124735https://leetcode.com/problems/generate-parentheses
2146Permutations63.5%Medium0.004216302230139218https://leetcode.com/problems/permutations
22102Binary Tree Level Order Traversal54.6%Medium0.003639014205004082https://leetcode.com/problems/binary-tree-level-order-traversal
233Longest Substring Without Repeating Characters30.4%Medium0.0015556336509412823https://leetcode.com/problems/longest-substring-without-repeating-characters