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

40 lines
4.4 KiB
CSV

ID,Title,Acceptance,Difficulty,Frequency,Leetcode Question Link
366,Find Leaves of Binary Tree,70.6%,Medium,0.22834203521080285, https://leetcode.com/problems/find-leaves-of-binary-tree
860,Lemonade Change,51.6%,Easy,0.18866903222469833, https://leetcode.com/problems/lemonade-change
362,Design Hit Counter,63.7%,Medium,0.1489960292385938, https://leetcode.com/problems/design-hit-counter
981,Time Based Key-Value Store,53.1%,Medium,0.1316303182973487, https://leetcode.com/problems/time-based-key-value-store
1120,Maximum Average Subtree,61.9%,Medium,0.12879510820557039, https://leetcode.com/problems/maximum-average-subtree
1071,Greatest Common Divisor of Strings,52.9%,Easy,0.12182344519338843, https://leetcode.com/problems/greatest-common-divisor-of-strings
17,Letter Combinations of a Phone Number,46.8%,Medium,0.1046212990833672, https://leetcode.com/problems/letter-combinations-of-a-phone-number
1223,Dice Roll Simulation,45.6%,Medium,0.10212949507637983, https://leetcode.com/problems/dice-roll-simulation
1366,Rank Teams by Votes,53.8%,Medium,0.07223355735937158, https://leetcode.com/problems/rank-teams-by-votes
706,Design HashMap,61.3%,Easy,0.0683442674369718, https://leetcode.com/problems/design-hashmap
300,Longest Increasing Subsequence,42.6%,Medium,0.06265630749555627, https://leetcode.com/problems/longest-increasing-subsequence
359,Logger Rate Limiter,70.8%,Easy,0.0467617659080393, https://leetcode.com/problems/logger-rate-limiter
150,Evaluate Reverse Polish Notation,36.3%,Medium,0.031526253646773944, https://leetcode.com/problems/evaluate-reverse-polish-notation
284,Peeking Iterator,45.7%,Medium,0.03110670713225487, https://leetcode.com/problems/peeking-iterator
547,Friend Circles,58.6%,Medium,0.027307522052851193, https://leetcode.com/problems/friend-circles
98,Validate Binary Search Tree,27.8%,Medium,0.026187123416340663, https://leetcode.com/problems/validate-binary-search-tree
31,Next Permutation,32.6%,Medium,0.023747034562878154, https://leetcode.com/problems/next-permutation
540,Single Element in a Sorted Array,57.9%,Medium,0.0192128868599912, https://leetcode.com/problems/single-element-in-a-sorted-array
872,Leaf-Similar Trees,64.5%,Easy,0.01752125418714782, https://leetcode.com/problems/leaf-similar-trees
23,Merge k Sorted Lists,40.2%,Hard,0.016108271385328228, https://leetcode.com/problems/merge-k-sorted-lists
701,Insert into a Binary Search Tree,77.7%,Medium,0.015522236371561826, https://leetcode.com/problems/insert-into-a-binary-search-tree
528,Random Pick with Weight,43.9%,Medium,0.014831565905995232, https://leetcode.com/problems/random-pick-with-weight
20,Valid Parentheses,39.0%,Easy,0.014292491180025941, https://leetcode.com/problems/valid-parentheses
123,Best Time to Buy and Sell Stock III,37.5%,Hard,0.011261380272539033, https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii
647,Palindromic Substrings,60.6%,Medium,0.010400509768078022, https://leetcode.com/problems/palindromic-substrings
46,Permutations,63.5%,Medium,0.009461803137288448, https://leetcode.com/problems/permutations
173,Binary Search Tree Iterator,56.6%,Medium,0.008489015324911316, https://leetcode.com/problems/binary-search-tree-iterator
394,Decode String,50.0%,Medium,0.008166644000272283, https://leetcode.com/problems/decode-string
200,Number of Islands,46.8%,Medium,0.006490251382779317, https://leetcode.com/problems/number-of-islands
543,Diameter of Binary Tree,48.4%,Easy,0.005305755914149804, https://leetcode.com/problems/diameter-of-binary-tree
236,Lowest Common Ancestor of a Binary Tree,45.7%,Medium,0.004714210262726446, https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
22,Generate Parentheses,62.7%,Medium,0.0043611059090124735, https://leetcode.com/problems/generate-parentheses
78,Subsets,62.0%,Medium,0.00368765975195334, https://leetcode.com/problems/subsets
102,Binary Tree Level Order Traversal,54.6%,Medium,0.003639014205004082, https://leetcode.com/problems/binary-tree-level-order-traversal
3,Longest Substring Without Repeating Characters,30.4%,Medium,0.003496778759264278, https://leetcode.com/problems/longest-substring-without-repeating-characters
101,Symmetric Tree,46.8%,Easy,0.0034057078469827435, https://leetcode.com/problems/symmetric-tree
53,Maximum Subarray,46.5%,Easy,0.002167082872150794, https://leetcode.com/problems/maximum-subarray
121,Best Time to Buy and Sell Stock,50.5%,Easy,0.0021239321954525975, https://leetcode.com/problems/best-time-to-buy-and-sell-stock