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

4.4 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2366Find Leaves of Binary Tree70.6%Medium0.22834203521080285https://leetcode.com/problems/find-leaves-of-binary-tree
3860Lemonade Change51.6%Easy0.18866903222469833https://leetcode.com/problems/lemonade-change
4362Design Hit Counter63.7%Medium0.1489960292385938https://leetcode.com/problems/design-hit-counter
5981Time Based Key-Value Store53.1%Medium0.1316303182973487https://leetcode.com/problems/time-based-key-value-store
61120Maximum Average Subtree61.9%Medium0.12879510820557039https://leetcode.com/problems/maximum-average-subtree
71071Greatest Common Divisor of Strings52.9%Easy0.12182344519338843https://leetcode.com/problems/greatest-common-divisor-of-strings
817Letter Combinations of a Phone Number46.8%Medium0.1046212990833672https://leetcode.com/problems/letter-combinations-of-a-phone-number
91223Dice Roll Simulation45.6%Medium0.10212949507637983https://leetcode.com/problems/dice-roll-simulation
101366Rank Teams by Votes53.8%Medium0.07223355735937158https://leetcode.com/problems/rank-teams-by-votes
11706Design HashMap61.3%Easy0.0683442674369718https://leetcode.com/problems/design-hashmap
12300Longest Increasing Subsequence42.6%Medium0.06265630749555627https://leetcode.com/problems/longest-increasing-subsequence
13359Logger Rate Limiter70.8%Easy0.0467617659080393https://leetcode.com/problems/logger-rate-limiter
14150Evaluate Reverse Polish Notation36.3%Medium0.031526253646773944https://leetcode.com/problems/evaluate-reverse-polish-notation
15284Peeking Iterator45.7%Medium0.03110670713225487https://leetcode.com/problems/peeking-iterator
16547Friend Circles58.6%Medium0.027307522052851193https://leetcode.com/problems/friend-circles
1798Validate Binary Search Tree27.8%Medium0.026187123416340663https://leetcode.com/problems/validate-binary-search-tree
1831Next Permutation32.6%Medium0.023747034562878154https://leetcode.com/problems/next-permutation
19540Single Element in a Sorted Array57.9%Medium0.0192128868599912https://leetcode.com/problems/single-element-in-a-sorted-array
20872Leaf-Similar Trees64.5%Easy0.01752125418714782https://leetcode.com/problems/leaf-similar-trees
2123Merge k Sorted Lists40.2%Hard0.016108271385328228https://leetcode.com/problems/merge-k-sorted-lists
22701Insert into a Binary Search Tree77.7%Medium0.015522236371561826https://leetcode.com/problems/insert-into-a-binary-search-tree
23528Random Pick with Weight43.9%Medium0.014831565905995232https://leetcode.com/problems/random-pick-with-weight
2420Valid Parentheses39.0%Easy0.014292491180025941https://leetcode.com/problems/valid-parentheses
25123Best Time to Buy and Sell Stock III37.5%Hard0.011261380272539033https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii
26647Palindromic Substrings60.6%Medium0.010400509768078022https://leetcode.com/problems/palindromic-substrings
2746Permutations63.5%Medium0.009461803137288448https://leetcode.com/problems/permutations
28173Binary Search Tree Iterator56.6%Medium0.008489015324911316https://leetcode.com/problems/binary-search-tree-iterator
29394Decode String50.0%Medium0.008166644000272283https://leetcode.com/problems/decode-string
30200Number of Islands46.8%Medium0.006490251382779317https://leetcode.com/problems/number-of-islands
31543Diameter of Binary Tree48.4%Easy0.005305755914149804https://leetcode.com/problems/diameter-of-binary-tree
32236Lowest Common Ancestor of a Binary Tree45.7%Medium0.004714210262726446https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
3322Generate Parentheses62.7%Medium0.0043611059090124735https://leetcode.com/problems/generate-parentheses
3478Subsets62.0%Medium0.00368765975195334https://leetcode.com/problems/subsets
35102Binary Tree Level Order Traversal54.6%Medium0.003639014205004082https://leetcode.com/problems/binary-tree-level-order-traversal
363Longest Substring Without Repeating Characters30.4%Medium0.003496778759264278https://leetcode.com/problems/longest-substring-without-repeating-characters
37101Symmetric Tree46.8%Easy0.0034057078469827435https://leetcode.com/problems/symmetric-tree
3853Maximum Subarray46.5%Easy0.002167082872150794https://leetcode.com/problems/maximum-subarray
39121Best Time to Buy and Sell Stock50.5%Easy0.0021239321954525975https://leetcode.com/problems/best-time-to-buy-and-sell-stock