Files
LeetCode-Questions-CompanyWise/mathworks_alltime.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.5 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
21130Minimum Cost Tree From Leaf Values66.1%Medium2.445077590079096https://leetcode.com/problems/minimum-cost-tree-from-leaf-values
3255Verify Preorder Sequence in Binary Search Tree45.7%Medium1.9602473122017205https://leetcode.com/problems/verify-preorder-sequence-in-binary-search-tree
41163Last Substring in Lexicographical Order33.9%Hard1.4754170343243447https://leetcode.com/problems/last-substring-in-lexicographical-order
525Reverse Nodes in k-Group42.1%Hard1.2885884475283234https://leetcode.com/problems/reverse-nodes-in-k-group
6526Beautiful Arrangement57.8%Medium0.995199193294679https://leetcode.com/problems/beautiful-arrangement
7500Keyboard Row64.7%Easy0.9589833161754686https://leetcode.com/problems/keyboard-row
8317Shortest Distance from All Buildings41.4%Hard0.7748252115742125https://leetcode.com/problems/shortest-distance-from-all-buildings
9206Reverse Linked List62.5%Easy0.6128482175082197https://leetcode.com/problems/reverse-linked-list
10697Degree of an Array53.8%Easy0.5986563371390229https://leetcode.com/problems/degree-of-an-array
11319Bulb Switcher45.4%Medium0.3156951086794549https://leetcode.com/problems/bulb-switcher
12741Cherry Pickup33.9%Hard0.309961111072881https://leetcode.com/problems/cherry-pickup
1363Unique Paths II34.6%Medium0.2738591247074177https://leetcode.com/problems/unique-paths-ii
1420Valid Parentheses39.0%Easy0.226282513205836https://leetcode.com/problems/valid-parentheses
15199Binary Tree Right Side View54.1%Medium0.18661020557359304https://leetcode.com/problems/binary-tree-right-side-view
162593Sum Smaller47.6%Medium0.18485641239714268https://leetcode.com/problems/3sum-smaller
17232Implement Queue using Stacks49.6%Easy0.12970837911872232https://leetcode.com/problems/implement-queue-using-stacks
18338Counting Bits69.5%Medium0.12580669538551648https://leetcode.com/problems/counting-bits
19200Number of Islands46.8%Medium0.06985103785996453https://leetcode.com/problems/number-of-islands
20225Implement Stack using Queues45.1%Easy0.06420174665671244https://leetcode.com/problems/implement-stack-using-queues
21115Distinct Subsequences38.3%Hard0.061494781607806234https://leetcode.com/problems/distinct-subsequences
2262Unique Paths54.1%Medium0.055187969852649885https://leetcode.com/problems/unique-paths
23133Clone Graph34.8%Medium0.049801168649527466https://leetcode.com/problems/clone-graph
241319Number of Operations to Make Network Connected53.1%Medium0.04587960575069364https://leetcode.com/problems/number-of-operations-to-make-network-connected
2549Group Anagrams56.9%Medium0.045631752563977224https://leetcode.com/problems/group-anagrams
26314Binary Tree Vertical Order Traversal45.3%Medium0.04007660092703385https://leetcode.com/problems/binary-tree-vertical-order-traversal
271Two Sum45.6%Easy0.024530411623017775https://leetcode.com/problems/two-sum
28836Rectangle Overlap48.6%Easy0.024228925974379843https://leetcode.com/problems/rectangle-overlap
29647Palindromic Substrings60.6%Medium0.023250853650202817https://leetcode.com/problems/palindromic-substrings
302Add Two Numbers33.9%Medium0.020491663368639005https://leetcode.com/problems/add-two-numbers
3198Validate Binary Search Tree27.8%Medium0.01825801101705589https://leetcode.com/problems/validate-binary-search-tree
32509Fibonacci Number67.2%Easy0.01593518138579736https://leetcode.com/problems/fibonacci-number
33404Sum of Left Leaves50.9%Easy0.013981353230340547https://leetcode.com/problems/sum-of-left-leaves
34153Sum26.8%Medium0.013665148419080968https://leetcode.com/problems/3sum
35695Max Area of Island62.7%Medium0.012686500631003836https://leetcode.com/problems/max-area-of-island
3643Multiply Strings33.9%Medium0.009145011150062768https://leetcode.com/problems/multiply-strings
37106Construct Binary Tree from Inorder and Postorder Traversal47.2%Medium0.005258250021550252https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal
385Longest Palindromic Substring29.5%Medium0.005121212968082452https://leetcode.com/problems/longest-palindromic-substring
3923Merge k Sorted Lists40.2%Hard0.004051459000748015https://leetcode.com/problems/merge-k-sorted-lists
40102Binary Tree Level Order Traversal54.6%Medium0.003639014205004082https://leetcode.com/problems/binary-tree-level-order-traversal
41566Reshape the Matrix60.5%Easy0https://leetcode.com/problems/reshape-the-matrix