LeetCode-Questions-CompanyWise/cisco_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.1 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
21290Convert Binary Number in a Linked List to Integer80.4%Easy0.15748072194904283https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer
3394Decode String50.0%Medium0.1232801760013658https://leetcode.com/problems/decode-string
41235Maximum Profit in Job Scheduling44.0%Hard0.08907963005368878https://leetcode.com/problems/maximum-profit-in-job-scheduling
5909Snakes and Ladders38.4%Medium0.08392620769993404https://leetcode.com/problems/snakes-and-ladders
6198House Robber42.0%Easy0.07346911266426392https://leetcode.com/problems/house-robber
75Longest Palindromic Substring29.5%Medium0.05548042005986785https://leetcode.com/problems/longest-palindromic-substring
856Merge Intervals39.3%Medium0.054167920212564245https://leetcode.com/problems/merge-intervals
9241Different Ways to Add Parentheses55.2%Medium0.03880215185647971https://leetcode.com/problems/different-ways-to-add-parentheses
103Longest Substring Without Repeating Characters30.4%Medium0.03818277748849004https://leetcode.com/problems/longest-substring-without-repeating-characters
11905Sort Array By Parity74.1%Easy0.03787434929243582https://leetcode.com/problems/sort-array-by-parity
1291Decode Ways24.7%Medium0.03673102791879485https://leetcode.com/problems/decode-ways
131Two Sum45.6%Easy0.03409719244428431https://leetcode.com/problems/two-sum
14246Strobogrammatic Number45.0%Easy0.032549659510785https://leetcode.com/problems/strobogrammatic-number
1553Maximum Subarray46.5%Easy0.02622855485962836https://leetcode.com/problems/maximum-subarray
1625Reverse Nodes in k-Group42.1%Hard0.022832042042645793https://leetcode.com/problems/reverse-nodes-in-k-group
17450Delete Node in a BST43.1%Medium0.018536211907915243https://leetcode.com/problems/delete-node-in-a-bst
18146LRU Cache33.2%Medium0.01827577993873683https://leetcode.com/problems/lru-cache
19191Number of 1 Bits49.8%Easy0.01673523624045844https://leetcode.com/problems/number-of-1-bits
2048Rotate Image56.7%Medium0.011428695823622754https://leetcode.com/problems/rotate-image
21234Palindrome Linked List39.3%Easy0.010171877938733932https://leetcode.com/problems/palindrome-linked-list
22739Daily Temperatures63.3%Medium0.010032690121814417https://leetcode.com/problems/daily-temperatures
23212Word Search II34.9%Hard0.009845021678804893https://leetcode.com/problems/word-search-ii
2422Generate Parentheses62.7%Medium0.009785877810632554https://leetcode.com/problems/generate-parentheses
25279Perfect Squares47.4%Medium0.009216655104924008https://leetcode.com/problems/perfect-squares
2649Group Anagrams56.9%Medium0.008538951314232168https://leetcode.com/problems/group-anagrams
27102Binary Tree Level Order Traversal54.6%Medium0.008169238497129479https://leetcode.com/problems/binary-tree-level-order-traversal
2814Longest Common Prefix35.4%Easy0.00745530292090591https://leetcode.com/problems/longest-common-prefix
2988Merge Sorted Array39.4%Easy0.006760335218638243https://leetcode.com/problems/merge-sorted-array
3054Spiral Matrix34.1%Medium0.0065941551175130245https://leetcode.com/problems/spiral-matrix
31108Convert Sorted Array to Binary Search Tree57.9%Easy0.005554027051374908https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree
3220Valid Parentheses39.0%Easy0.005168860577665306https://leetcode.com/problems/valid-parentheses
33207Course Schedule43.1%Medium0.004964021114211758https://leetcode.com/problems/course-schedule
34125Valid Palindrome36.7%Easy0.0039805008274065926https://leetcode.com/problems/valid-palindrome
358String to Integer (atoi)15.4%Medium0.0037925521897059712https://leetcode.com/problems/string-to-integer-atoi
36344Reverse String68.5%Easy0.003269579502519813https://leetcode.com/problems/reverse-string
3721Merge Two Sorted Lists53.5%Easy0.0022551737583973706https://leetcode.com/problems/merge-two-sorted-lists
382Add Two Numbers33.9%Medium0.0016886191111440908https://leetcode.com/problems/add-two-numbers