LeetCode-Questions-CompanyWise/citadel_1year.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.3 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2829Consecutive Numbers Sum37.5%Hard1.0192107113585394https://leetcode.com/problems/consecutive-numbers-sum
31048Longest String Chain54.7%Medium0.6021288528371614https://leetcode.com/problems/longest-string-chain
4285Inorder Successor in BST40.4%Medium0.1850469943157836https://leetcode.com/problems/inorder-successor-in-bst
5241Different Ways to Add Parentheses55.2%Medium0.14691814457724592https://leetcode.com/problems/different-ways-to-add-parentheses
6647Palindromic Substrings60.6%Medium0.1205091763778271https://leetcode.com/problems/palindromic-substrings
7935Knight Dialer45.2%Medium0.04445176257083384https://leetcode.com/problems/knight-dialer
832Longest Valid Parentheses28.4%Hard0.03595893038744387https://leetcode.com/problems/longest-valid-parentheses
9332Reconstruct Itinerary36.7%Medium0.030687713231237448https://leetcode.com/problems/reconstruct-itinerary
1020Valid Parentheses39.0%Easy0.02782373445001039https://leetcode.com/problems/valid-parentheses
1142Trapping Rain Water48.9%Hard0.02688623073425064https://leetcode.com/problems/trapping-rain-water
12221Maximal Square37.7%Medium0.022108490754203434https://leetcode.com/problems/maximal-square
13239Sliding Window Maximum43.0%Hard0.01768566434627554https://leetcode.com/problems/sliding-window-maximum
14240Search a 2D Matrix II43.2%Medium0.0169815401480941https://leetcode.com/problems/search-a-2d-matrix-ii
15628Maximum Product of Three Numbers47.1%Easy0.016529301951210565https://leetcode.com/problems/maximum-product-of-three-numbers
16225Implement Stack using Queues45.1%Easy0.01644097863345757https://leetcode.com/problems/implement-stack-using-queues
17340Longest Substring with At Most K Distinct Characters44.1%Hard0.016122880486563188https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters
1885Maximal Rectangle37.7%Hard0.013333530869465187https://leetcode.com/problems/maximal-rectangle
19232Implement Queue using Stacks49.6%Easy0.011242389348933884https://leetcode.com/problems/implement-queue-using-stacks
20146LRU Cache33.2%Medium0.010321192540274932https://leetcode.com/problems/lru-cache
21212Word Search II34.9%Hard0.009845021678804893https://leetcode.com/problems/word-search-ii
22295Find Median from Data Stream44.3%Hard0.00899893586856953https://leetcode.com/problems/find-median-from-data-stream
23253Meeting Rooms II45.7%Medium0.008079219870546493https://leetcode.com/problems/meeting-rooms-ii
24297Serialize and Deserialize Binary Tree47.5%Hard0.007077170374085099https://leetcode.com/problems/serialize-and-deserialize-binary-tree
25153Sum26.8%Medium0.004940992758742591https://leetcode.com/problems/3sum
26121Best Time to Buy and Sell Stock50.5%Easy0.0047725193990346675https://leetcode.com/problems/best-time-to-buy-and-sell-stock
2728Implement strStr()34.5%Easy0.003943222775040032https://leetcode.com/problems/implement-strstr
28200Number of Islands46.8%Medium0.0028897578265903614https://leetcode.com/problems/number-of-islands
2953Maximum Subarray46.5%Easy0.002167082872150794https://leetcode.com/problems/maximum-subarray
3070Climbing Stairs47.8%Easy0.0015084665529624085https://leetcode.com/problems/climbing-stairs