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

6.0 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2366Find Leaves of Binary Tree70.6%Medium0.4396812191548194https://leetcode.com/problems/find-leaves-of-binary-tree
3860Lemonade Change51.6%Easy0.34144324934323333https://leetcode.com/problems/lemonade-change
4821Shortest Distance to a Character66.9%Easy0.24320527953164725https://leetcode.com/problems/shortest-distance-to-a-character
5981Time Based Key-Value Store53.1%Medium0.1844764271644963https://leetcode.com/problems/time-based-key-value-store
6362Design Hit Counter63.7%Medium0.1489960292385938https://leetcode.com/problems/design-hit-counter
71120Maximum Average Subtree61.9%Medium0.12879510820557039https://leetcode.com/problems/maximum-average-subtree
817Letter Combinations of a Phone Number46.8%Medium0.12526693997901697https://leetcode.com/problems/letter-combinations-of-a-phone-number
91071Greatest Common Divisor of Strings52.9%Easy0.12182344519338843https://leetcode.com/problems/greatest-common-divisor-of-strings
101223Dice Roll Simulation45.6%Medium0.10212949507637983https://leetcode.com/problems/dice-roll-simulation
111366Rank Teams by Votes53.8%Medium0.07223355735937158https://leetcode.com/problems/rank-teams-by-votes
12706Design HashMap61.3%Easy0.0683442674369718https://leetcode.com/problems/design-hashmap
13300Longest Increasing Subsequence42.6%Medium0.06265630749555627https://leetcode.com/problems/longest-increasing-subsequence
14359Logger Rate Limiter70.8%Easy0.0467617659080393https://leetcode.com/problems/logger-rate-limiter
15200Number of Islands46.8%Medium0.04526299408355752https://leetcode.com/problems/number-of-islands
16540Single Element in a Sorted Array57.9%Medium0.042721256704769804https://leetcode.com/problems/single-element-in-a-sorted-array
17844Backspace String Compare46.4%Easy0.041499730906752734https://leetcode.com/problems/backspace-string-compare
18394Decode String50.0%Medium0.03227387813668991https://leetcode.com/problems/decode-string
19253Meeting Rooms II45.7%Medium0.03193246767820989https://leetcode.com/problems/meeting-rooms-ii
20150Evaluate Reverse Polish Notation36.3%Medium0.031526253646773944https://leetcode.com/problems/evaluate-reverse-polish-notation
21284Peeking Iterator45.7%Medium0.03110670713225487https://leetcode.com/problems/peeking-iterator
2220Valid Parentheses39.0%Easy0.02782373445001039https://leetcode.com/problems/valid-parentheses
23547Friend Circles58.6%Medium0.027307522052851193https://leetcode.com/problems/friend-circles
2498Validate Binary Search Tree27.8%Medium0.026187123416340663https://leetcode.com/problems/validate-binary-search-tree
25713Subarray Product Less Than K39.1%Medium0.02473842915612247https://leetcode.com/problems/subarray-product-less-than-k
2631Next Permutation32.6%Medium0.023747034562878154https://leetcode.com/problems/next-permutation
27647Palindromic Substrings60.6%Medium0.023250853650202817https://leetcode.com/problems/palindromic-substrings
28341Flatten Nested List Iterator52.9%Medium0.019980684690483426https://leetcode.com/problems/flatten-nested-list-iterator
29872Leaf-Similar Trees64.5%Easy0.01752125418714782https://leetcode.com/problems/leaf-similar-trees
3046Permutations63.5%Medium0.016759583649075344https://leetcode.com/problems/permutations
3123Merge k Sorted Lists40.2%Hard0.016108271385328228https://leetcode.com/problems/merge-k-sorted-lists
32701Insert into a Binary Search Tree77.7%Medium0.015522236371561826https://leetcode.com/problems/insert-into-a-binary-search-tree
33528Random Pick with Weight43.9%Medium0.014831565905995232https://leetcode.com/problems/random-pick-with-weight
34101Symmetric Tree46.8%Easy0.013553786479814183https://leetcode.com/problems/symmetric-tree
35227Basic Calculator II36.9%Medium0.01239941490503826https://leetcode.com/problems/basic-calculator-ii
36123Best Time to Buy and Sell Stock III37.5%Hard0.011261380272539033https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii
373Longest Substring Without Repeating Characters30.4%Medium0.009683242444739549https://leetcode.com/problems/longest-substring-without-repeating-characters
38295Find Median from Data Stream44.3%Hard0.00899893586856953https://leetcode.com/problems/find-median-from-data-stream
3953Maximum Subarray46.5%Easy0.008640295679602939https://leetcode.com/problems/maximum-subarray
40173Binary Search Tree Iterator56.6%Medium0.008489015324911316https://leetcode.com/problems/binary-search-tree-iterator
41692Top K Frequent Words51.8%Medium0.007516006820935329https://leetcode.com/problems/top-k-frequent-words
42680Valid Palindrome II36.6%Easy0.007288662004705285https://leetcode.com/problems/valid-palindrome-ii
43199Binary Tree Right Side View54.1%Medium0.0056826406650506926https://leetcode.com/problems/binary-tree-right-side-view
44543Diameter of Binary Tree48.4%Easy0.005305755914149804https://leetcode.com/problems/diameter-of-binary-tree
45121Best Time to Buy and Sell Stock50.5%Easy0.0047725193990346675https://leetcode.com/problems/best-time-to-buy-and-sell-stock
46236Lowest Common Ancestor of a Binary Tree45.7%Medium0.004714210262726446https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
4722Generate Parentheses62.7%Medium0.0043611059090124735https://leetcode.com/problems/generate-parentheses
48215Kth Largest Element in an Array55.4%Medium0.003902443976931749https://leetcode.com/problems/kth-largest-element-in-an-array
4978Subsets62.0%Medium0.00368765975195334https://leetcode.com/problems/subsets
50102Binary Tree Level Order Traversal54.6%Medium0.003639014205004082https://leetcode.com/problems/binary-tree-level-order-traversal
5156Merge Intervals39.3%Medium0.0034728286335985107https://leetcode.com/problems/merge-intervals
52136Single Number65.5%Easy0.002869648285357666https://leetcode.com/problems/single-number
5321Merge Two Sorted Lists53.5%Easy0.0022551737583973706https://leetcode.com/problems/merge-two-sorted-lists