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

2.7 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2706Design HashMap61.3%Easy0.03655310240265549https://leetcode.com/problems/design-hashmap
3653Two Sum IV - Input is a BST55.5%Easy0.02926276273740802https://leetcode.com/problems/two-sum-iv-input-is-a-bst
4867Transpose Matrix62.8%Easy0.028715904834557722https://leetcode.com/problems/transpose-matrix
5921Minimum Add to Make Parentheses Valid73.7%Medium0.021425565169310254https://leetcode.com/problems/minimum-add-to-make-parentheses-valid
61Two Sum45.6%Easy0.016487580637467636https://leetcode.com/problems/two-sum
71290Convert Binary Number in a Linked List to Integer80.4%Easy0.010568130061792257https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer
817Letter Combinations of a Phone Number46.8%Medium0.00987716546167603https://leetcode.com/problems/letter-combinations-of-a-phone-number
920Valid Parentheses39.0%Easy0.009170695326061695https://leetcode.com/problems/valid-parentheses
105Longest Palindromic Substring29.5%Medium0.009086325220960808https://leetcode.com/problems/longest-palindromic-substring
1149Group Anagrams56.9%Medium0.008538951314232168https://leetcode.com/problems/group-anagrams
1256Merge Intervals39.3%Medium0.007796972706004796https://leetcode.com/problems/merge-intervals
132Add Two Numbers33.9%Medium0.006737434951993369https://leetcode.com/problems/add-two-numbers
14127Word Ladder29.6%Medium0.005979091056058075https://leetcode.com/problems/word-ladder
15268Missing Number51.7%Easy0.0048804391649084865https://leetcode.com/problems/missing-number
16155Min Stack44.5%Easy0.00474891074128171https://leetcode.com/problems/min-stack
1742Trapping Rain Water48.9%Hard0.004350670338744988https://leetcode.com/problems/trapping-rain-water
18387First Unique Character in a String53.4%Easy0.00418541994270691https://leetcode.com/problems/first-unique-character-in-a-string
19242Valid Anagram56.9%Easy0.004154123743115972https://leetcode.com/problems/valid-anagram
20238Product of Array Except Self60.1%Medium0.003930436424724545https://leetcode.com/problems/product-of-array-except-self
21103Binary Tree Zigzag Level Order Traversal48.3%Medium0.003839922800048048https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
22344Reverse String68.5%Easy0.003269579502519813https://leetcode.com/problems/reverse-string
23200Number of Islands46.8%Medium0.0028897578265903614https://leetcode.com/problems/number-of-islands
24153Sum26.8%Medium0.0021990113314367685https://leetcode.com/problems/3sum
2526Remove Duplicates from Sorted Array45.1%Easy0.0019513153174351963https://leetcode.com/problems/remove-duplicates-from-sorted-array