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

3.9 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2991Broken Calculator45.6%Medium0.8343103907872829https://leetcode.com/problems/broken-calculator
31052Grumpy Bookstore Owner55.4%Medium0.6329062363392213https://leetcode.com/problems/grumpy-bookstore-owner
445Jump Game II30.6%Hard0.4315020818911597https://leetcode.com/problems/jump-game-ii
5457Circular Array Loop29.4%Medium0.31790921708384473https://leetcode.com/problems/circular-array-loop
6403Frog Jump39.7%Hard0.1519909531790461https://leetcode.com/problems/frog-jump
7402Remove K Digits28.4%Medium0.14242034004176865https://leetcode.com/problems/remove-k-digits
8826Most Profit Assigning Work38.5%Medium0.09287412500644375https://leetcode.com/problems/most-profit-assigning-work
9564Find the Closest Palindrome19.7%Hard0.0840831172105414https://leetcode.com/problems/find-the-closest-palindrome
10273Integer to English Words27.1%Hard0.04747257415466348https://leetcode.com/problems/integer-to-english-words
11703Kth Largest Element in a Stream49.7%Easy0.031004894819414507https://leetcode.com/problems/kth-largest-element-in-a-stream
12316Remove Duplicate Letters35.8%Hard0.030443751414723153https://leetcode.com/problems/remove-duplicate-letters
1333Search in Rotated Sorted Array34.5%Medium0.0287009496170278https://leetcode.com/problems/search-in-rotated-sorted-array
14202Happy Number50.4%Easy0.02483442856330386https://leetcode.com/problems/happy-number
1555Jump Game34.6%Medium0.01994084020351079https://leetcode.com/problems/jump-game
16253Meeting Rooms II45.7%Medium0.018087309810579388https://leetcode.com/problems/meeting-rooms-ii
1717Letter Combinations of a Phone Number46.8%Medium0.017492519932499718https://leetcode.com/problems/letter-combinations-of-a-phone-number
18238Product of Array Except Self60.1%Medium0.015629897160874744https://leetcode.com/problems/product-of-array-except-self
19210Course Schedule II40.7%Medium0.011869857339029215https://leetcode.com/problems/course-schedule-ii
20207Course Schedule43.1%Medium0.01113459480911671https://leetcode.com/problems/course-schedule
2122Generate Parentheses62.7%Medium0.009785877810632554https://leetcode.com/problems/generate-parentheses
2240Combination Sum II48.2%Medium0.009578617297069781https://leetcode.com/problems/combination-sum-ii
23208Implement Trie (Prefix Tree)49.4%Medium0.009105457856626612https://leetcode.com/problems/implement-trie-prefix-tree
24128Longest Consecutive Sequence45.1%Hard0.009051883485315484https://leetcode.com/problems/longest-consecutive-sequence
25977Squares of a Sorted Array72.1%Easy0.008733679968754604https://leetcode.com/problems/squares-of-a-sorted-array
26239Sliding Window Maximum43.0%Hard0.007898935224534491https://leetcode.com/problems/sliding-window-maximum
27116Populating Next Right Pointers in Each Node45.2%Medium0.007336790063854334https://leetcode.com/problems/populating-next-right-pointers-in-each-node
28200Number of Islands46.8%Medium0.006490251382779317https://leetcode.com/problems/number-of-islands
2976Minimum Window Substring34.6%Hard0.006231520398723243https://leetcode.com/problems/minimum-window-substring
30138Copy List with Random Pointer36.4%Medium0.006191011880825271https://leetcode.com/problems/copy-list-with-random-pointer
31621Task Scheduler50.1%Medium0.005261323957171611https://leetcode.com/problems/task-scheduler
32146LRU Cache33.2%Medium0.004600353139061353https://leetcode.com/problems/lru-cache
33234Palindrome Linked List39.3%Easy0.004533613114828982https://leetcode.com/problems/palindrome-linked-list
3449Group Anagrams56.9%Medium0.0038040939835560453https://leetcode.com/problems/group-anagrams
35283Move Zeroes57.8%Easy0.0028853803470673955https://leetcode.com/problems/move-zeroes
365Longest Palindromic Substring29.5%Medium0.002279333142507479https://leetcode.com/problems/longest-palindromic-substring