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

2.7 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2706Design HashMap61.3%Easy0.1171974903999194https://leetcode.com/problems/design-hashmap
3653Two Sum IV - Input is a BST55.5%Easy0.09078846984784666https://leetcode.com/problems/two-sum-iv-input-is-a-bst
41Two Sum45.6%Easy0.06437944929577392https://leetcode.com/problems/two-sum
520Valid Parentheses39.0%Easy0.055983722381420686https://leetcode.com/problems/valid-parentheses
6127Word Ladder29.6%Medium0.03679590970204585https://leetcode.com/problems/word-ladder
7238Product of Array Except Self60.1%Medium0.03482987258052727https://leetcode.com/problems/product-of-array-except-self
8867Transpose Matrix62.8%Easy0.031179454774354007https://leetcode.com/problems/transpose-matrix
917Letter Combinations of a Phone Number46.8%Medium0.027199239804368825https://leetcode.com/problems/letter-combinations-of-a-phone-number
101290Convert Binary Number in a Linked List to Integer80.4%Easy0.023623145763435913https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer
1156Merge Intervals39.3%Medium0.02150990613527447https://leetcode.com/problems/merge-intervals
12921Minimum Add to Make Parentheses Valid73.7%Medium0.021425565169310254https://leetcode.com/problems/minimum-add-to-make-parentheses-valid
135Longest Palindromic Substring29.5%Medium0.020329346568668867https://leetcode.com/problems/longest-palindromic-substring
14242Valid Anagram56.9%Easy0.016513947375674708https://leetcode.com/problems/valid-anagram
152Add Two Numbers33.9%Medium0.015095892173467356https://leetcode.com/problems/add-two-numbers
16153Sum26.8%Medium0.013665148419080968https://leetcode.com/problems/3sum
17200Number of Islands46.8%Medium0.011509262420590827https://leetcode.com/problems/number-of-islands
18155Min Stack44.5%Easy0.010653509851791077https://leetcode.com/problems/min-stack
19103Binary Tree Zigzag Level Order Traversal48.3%Medium0.01063025572799205https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
20387First Unique Character in a String53.4%Easy0.009392680199054166https://leetcode.com/problems/first-unique-character-in-a-string
2149Group Anagrams56.9%Medium0.008538951314232168https://leetcode.com/problems/group-anagrams
2226Remove Duplicates from Sorted Array45.1%Easy0.007782518973063169https://leetcode.com/problems/remove-duplicates-from-sorted-array
23268Missing Number51.7%Easy0.0048804391649084865https://leetcode.com/problems/missing-number
2442Trapping Rain Water48.9%Hard0.004350670338744988https://leetcode.com/problems/trapping-rain-water
25344Reverse String68.5%Easy0.003269579502519813https://leetcode.com/problems/reverse-string