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

2.8 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
21290Convert Binary Number in a Linked List to Integer80.4%Easy0.06956650156993308https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer
31235Maximum Profit in Job Scheduling44.0%Hard0.06732797308883445https://leetcode.com/problems/maximum-profit-in-job-scheduling
4909Snakes and Ladders38.4%Medium0.06217455073507972https://leetcode.com/problems/snakes-and-ladders
5394Decode String50.0%Medium0.04945278932693729https://leetcode.com/problems/decode-string
691Decode Ways24.7%Medium0.03673102791879485https://leetcode.com/problems/decode-ways
7198House Robber42.0%Easy0.033320991026093004https://leetcode.com/problems/house-robber
8246Strobogrammatic Number45.0%Easy0.032549659510785https://leetcode.com/problems/strobogrammatic-number
956Merge Intervals39.3%Medium0.02150990613527447https://leetcode.com/problems/merge-intervals
1053Maximum Subarray46.5%Easy0.019336728821707075https://leetcode.com/problems/maximum-subarray
11450Delete Node in a BST43.1%Medium0.018536211907915243https://leetcode.com/problems/delete-node-in-a-bst
12191Number of 1 Bits49.8%Easy0.01673523624045844https://leetcode.com/problems/number-of-1-bits
135Longest Palindromic Substring29.5%Medium0.01416133329402493https://leetcode.com/problems/longest-palindromic-substring
1448Rotate Image56.7%Medium0.011428695823622754https://leetcode.com/problems/rotate-image
15739Daily Temperatures63.3%Medium0.010032690121814417https://leetcode.com/problems/daily-temperatures
16212Word Search II34.9%Hard0.009845021678804893https://leetcode.com/problems/word-search-ii
17905Sort Array By Parity74.1%Easy0.009603915354180344https://leetcode.com/problems/sort-array-by-parity
1849Group Anagrams56.9%Medium0.008538951314232168https://leetcode.com/problems/group-anagrams
191Two Sum45.6%Easy0.0051178232035212715https://leetcode.com/problems/two-sum
20207Course Schedule43.1%Medium0.004964021114211758https://leetcode.com/problems/course-schedule
21234Palindrome Linked List39.3%Easy0.004533613114828982https://leetcode.com/problems/palindrome-linked-list
2222Generate Parentheses62.7%Medium0.0043611059090124735https://leetcode.com/problems/generate-parentheses
238String to Integer (atoi)15.4%Medium0.0037925521897059712https://leetcode.com/problems/string-to-integer-atoi
24102Binary Tree Level Order Traversal54.6%Medium0.003639014205004082https://leetcode.com/problems/binary-tree-level-order-traversal
253Longest Substring Without Repeating Characters30.4%Medium0.003496778759264278https://leetcode.com/problems/longest-substring-without-repeating-characters
2620Valid Parentheses39.0%Easy0.0023005704055949323https://leetcode.com/problems/valid-parentheses