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

4.4 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
21130Minimum Cost Tree From Leaf Values66.1%Medium2.354986953663386https://leetcode.com/problems/minimum-cost-tree-from-leaf-values
3255Verify Preorder Sequence in Binary Search Tree45.7%Medium1.6804984402728165https://leetcode.com/problems/verify-preorder-sequence-in-binary-search-tree
425Reverse Nodes in k-Group42.1%Hard1.0060099268822469https://leetcode.com/problems/reverse-nodes-in-k-group
51163Last Substring in Lexicographical Order33.9%Hard0.9532793012434956https://leetcode.com/problems/last-substring-in-lexicographical-order
6317Shortest Distance from All Buildings41.4%Hard0.4817811959810462https://leetcode.com/problems/shortest-distance-from-all-buildings
7697Degree of an Array53.8%Easy0.4217256289799447https://leetcode.com/problems/degree-of-an-array
8500Keyboard Row64.7%Easy0.3911791508606879https://leetcode.com/problems/keyboard-row
9206Reverse Linked List62.5%Easy0.3555322708386157https://leetcode.com/problems/reverse-linked-list
10526Beautiful Arrangement57.8%Medium0.29031019485805043https://leetcode.com/problems/beautiful-arrangement
1163Unique Paths II34.6%Medium0.2738591247074177https://leetcode.com/problems/unique-paths-ii
122593Sum Smaller47.6%Medium0.18485641239714268https://leetcode.com/problems/3sum-smaller
13741Cherry Pickup33.9%Hard0.12293768624504794https://leetcode.com/problems/cherry-pickup
14199Binary Tree Right Side View54.1%Medium0.06748154336946242https://leetcode.com/problems/binary-tree-right-side-view
15338Counting Bits69.5%Medium0.06616169008990747https://leetcode.com/problems/counting-bits
16319Bulb Switcher45.4%Medium0.06595796779179743https://leetcode.com/problems/bulb-switcher
17115Distinct Subsequences38.3%Hard0.061494781607806234https://leetcode.com/problems/distinct-subsequences
181319Number of Operations to Make Network Connected53.1%Medium0.04587960575069364https://leetcode.com/problems/number-of-operations-to-make-network-connected
19232Implement Queue using Stacks49.6%Easy0.04423053722733957https://leetcode.com/problems/implement-queue-using-stacks
2062Unique Paths54.1%Medium0.04084052144450833https://leetcode.com/problems/unique-paths
21225Implement Stack using Queues45.1%Easy0.03661922580674248https://leetcode.com/problems/implement-stack-using-queues
22200Number of Islands46.8%Medium0.025712029212602353https://leetcode.com/problems/number-of-islands
23836Rectangle Overlap48.6%Easy0.024228925974379843https://leetcode.com/problems/rectangle-overlap
2449Group Anagrams56.9%Medium0.02354157682187747https://leetcode.com/problems/group-anagrams
25314Binary Tree Vertical Order Traversal45.3%Medium0.018010392274465332https://leetcode.com/problems/binary-tree-vertical-order-traversal
26404Sum of Left Leaves50.9%Easy0.013981353230340547https://leetcode.com/problems/sum-of-left-leaves
27695Max Area of Island62.7%Medium0.012686500631003836https://leetcode.com/problems/max-area-of-island
28647Palindromic Substrings60.6%Medium0.010400509768078022https://leetcode.com/problems/palindromic-substrings
2943Multiply Strings33.9%Medium0.009145011150062768https://leetcode.com/problems/multiply-strings
30133Clone Graph34.8%Medium0.008136741393061732https://leetcode.com/problems/clone-graph
31509Fibonacci Number67.2%Easy0.007113670403855555https://leetcode.com/problems/fibonacci-number
3220Valid Parentheses39.0%Easy0.005168860577665306https://leetcode.com/problems/valid-parentheses
33153Sum26.8%Medium0.004940992758742591https://leetcode.com/problems/3sum
3423Merge k Sorted Lists40.2%Hard0.004051459000748015https://leetcode.com/problems/merge-k-sorted-lists
352Add Two Numbers33.9%Medium0.00379539105290024https://leetcode.com/problems/add-two-numbers
36102Binary Tree Level Order Traversal54.6%Medium0.003639014205004082https://leetcode.com/problems/binary-tree-level-order-traversal
371Two Sum45.6%Easy0.003278422738041615https://leetcode.com/problems/two-sum
3898Validate Binary Search Tree27.8%Medium0.002943776044013381https://leetcode.com/problems/validate-binary-search-tree
39106Construct Binary Tree from Inorder and Postorder Traversal47.2%Medium0.00234041415121758https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal
405Longest Palindromic Substring29.5%Medium0.002279333142507479https://leetcode.com/problems/longest-palindromic-substring