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

4.3 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
21052Grumpy Bookstore Owner55.4%Medium0.8402346949345842https://leetcode.com/problems/grumpy-bookstore-owner
3991Broken Calculator45.6%Medium0.7270526032311205https://leetcode.com/problems/broken-calculator
445Jump Game II30.6%Hard0.5749144034972855https://leetcode.com/problems/jump-game-ii
5457Circular Array Loop29.4%Medium0.4310822724784647https://leetcode.com/problems/circular-array-loop
6403Frog Jump39.7%Hard0.2789440727446297https://leetcode.com/problems/frog-jump
7402Remove K Digits28.4%Medium0.24067603007585034https://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
10316Remove Duplicate Letters35.8%Hard0.067239661116769https://leetcode.com/problems/remove-duplicate-letters
11202Happy Number50.4%Easy0.05503451923624455https://leetcode.com/problems/happy-number
1233Search in Rotated Sorted Array34.5%Medium0.05046797817178903https://leetcode.com/problems/search-in-rotated-sorted-array
13273Integer to English Words27.1%Hard0.04747257415466348https://leetcode.com/problems/integer-to-english-words
14238Product of Array Except Self60.1%Medium0.04711503937510501https://leetcode.com/problems/product-of-array-except-self
15253Meeting Rooms II45.7%Medium0.03193246767820989https://leetcode.com/problems/meeting-rooms-ii
16703Kth Largest Element in a Stream49.7%Easy0.031004894819414507https://leetcode.com/problems/kth-largest-element-in-a-stream
17146LRU Cache33.2%Medium0.028411001832779885https://leetcode.com/problems/lru-cache
1840Combination Sum II48.2%Medium0.021424290044083395https://leetcode.com/problems/combination-sum-ii
19128Longest Consecutive Sequence45.1%Hard0.020252717433212362https://leetcode.com/problems/longest-consecutive-sequence
2055Jump Game34.6%Medium0.01994084020351079https://leetcode.com/problems/jump-game
21200Number of Islands46.8%Medium0.017925481766054456https://leetcode.com/problems/number-of-islands
22239Sliding Window Maximum43.0%Hard0.01768566434627554https://leetcode.com/problems/sliding-window-maximum
2317Letter Combinations of a Phone Number46.8%Medium0.017492519932499718https://leetcode.com/problems/letter-combinations-of-a-phone-number
24116Populating Next Right Pointers in Each Node45.2%Medium0.016432723251567683https://leetcode.com/problems/populating-next-right-pointers-in-each-node
25977Squares of a Sorted Array72.1%Easy0.015474196582597383https://leetcode.com/problems/squares-of-a-sorted-array
26621Task Scheduler50.1%Medium0.014546980601820143https://leetcode.com/problems/task-scheduler
2776Minimum Window Substring34.6%Hard0.013966707481708198https://leetcode.com/problems/minimum-window-substring
28138Copy List with Random Pointer36.4%Medium0.013876263355766411https://leetcode.com/problems/copy-list-with-random-pointer
29210Course Schedule II40.7%Medium0.011869857339029215https://leetcode.com/problems/course-schedule-ii
30283Move Zeroes57.8%Easy0.01149190266804209https://leetcode.com/problems/move-zeroes
31207Course Schedule43.1%Medium0.01113459480911671https://leetcode.com/problems/course-schedule
32234Palindrome Linked List39.3%Easy0.010171877938733932https://leetcode.com/problems/palindrome-linked-list
3322Generate Parentheses62.7%Medium0.009785877810632554https://leetcode.com/problems/generate-parentheses
34208Implement Trie (Prefix Tree)49.4%Medium0.009105457856626612https://leetcode.com/problems/implement-trie-prefix-tree
355Longest Palindromic Substring29.5%Medium0.005121212968082452https://leetcode.com/problems/longest-palindromic-substring
3649Group Anagrams56.9%Medium0.0038040939835560453https://leetcode.com/problems/group-anagrams
371003Check If Word Is Valid After Substitutions55.3%Medium0https://leetcode.com/problems/check-if-word-is-valid-after-substitutions
381156Swap For Longest Repeated Character Substring49.0%Medium0https://leetcode.com/problems/swap-for-longest-repeated-character-substring
391157Online Majority Element In Subarray39.0%Hard0https://leetcode.com/problems/online-majority-element-in-subarray