LeetCode-Questions-CompanyWise/citadel_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.8 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2829Consecutive Numbers Sum37.5%Hard1.7290600615878309https://leetcode.com/problems/consecutive-numbers-sum
31048Longest String Chain54.7%Medium1.016830261064837https://leetcode.com/problems/longest-string-chain
4241Different Ways to Add Parentheses55.2%Medium0.304600460541843https://leetcode.com/problems/different-ways-to-add-parentheses
5647Palindromic Substrings60.6%Medium0.19203205445944416https://leetcode.com/problems/palindromic-substrings
6285Inorder Successor in BST40.4%Medium0.1850469943157836https://leetcode.com/problems/inorder-successor-in-bst
732Longest Valid Parentheses28.4%Hard0.13667290598927465https://leetcode.com/problems/longest-valid-parentheses
8935Knight Dialer45.2%Medium0.09737416402517636https://leetcode.com/problems/knight-dialer
9121Best Time to Buy and Sell Stock50.5%Easy0.08602309667191627https://leetcode.com/problems/best-time-to-buy-and-sell-stock
1042Trapping Rain Water48.9%Hard0.08461041545209161https://leetcode.com/problems/trapping-rain-water
11122Best Time to Buy and Sell Stock II57.0%Easy0.06582927042348097https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii
12221Maximal Square37.7%Medium0.060244665945199054https://leetcode.com/problems/maximal-square
1320Valid Parentheses39.0%Easy0.055983722381420686https://leetcode.com/problems/valid-parentheses
14295Find Median from Data Stream44.3%Hard0.05495888428075748https://leetcode.com/problems/find-median-from-data-stream
15622Design Circular Queue43.7%Medium0.049844204077291364https://leetcode.com/problems/design-circular-queue
16239Sliding Window Maximum43.0%Hard0.0483746857022364https://leetcode.com/problems/sliding-window-maximum
17240Search a 2D Matrix II43.2%Medium0.04647676584572884https://leetcode.com/problems/search-a-2d-matrix-ii
18146LRU Cache33.2%Medium0.040660598211268925https://leetcode.com/problems/lru-cache
19724Find Pivot Index44.0%Easy0.03089844155123413https://leetcode.com/problems/find-pivot-index
20332Reconstruct Itinerary36.7%Medium0.030687713231237448https://leetcode.com/problems/reconstruct-itinerary
21123Best Time to Buy and Sell Stock III37.5%Hard0.02516207671950806https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii
22199Binary Tree Right Side View54.1%Medium0.022539339846061532https://leetcode.com/problems/binary-tree-right-side-view
23105Construct Binary Tree from Preorder and Inorder Traversal48.8%Medium0.022325470299025416https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal
24628Maximum Product of Three Numbers47.1%Easy0.016529301951210565https://leetcode.com/problems/maximum-product-of-three-numbers
251Two Sum45.6%Easy0.016487580637467636https://leetcode.com/problems/two-sum
26225Implement Stack using Queues45.1%Easy0.01644097863345757https://leetcode.com/problems/implement-stack-using-queues
27340Longest Substring with At Most K Distinct Characters44.1%Hard0.016122880486563188https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters
28297Serialize and Deserialize Binary Tree47.5%Hard0.01585377577217724https://leetcode.com/problems/serialize-and-deserialize-binary-tree
29153Sum26.8%Medium0.013665148419080968https://leetcode.com/problems/3sum
3053Maximum Subarray46.5%Easy0.013467854269413949https://leetcode.com/problems/maximum-subarray
3185Maximal Rectangle37.7%Hard0.013333530869465187https://leetcode.com/problems/maximal-rectangle
32200Number of Islands46.8%Medium0.011509262420590827https://leetcode.com/problems/number-of-islands
33232Implement Queue using Stacks49.6%Easy0.011242389348933884https://leetcode.com/problems/implement-queue-using-stacks
34212Word Search II34.9%Hard0.009845021678804893https://leetcode.com/problems/word-search-ii
3570Climbing Stairs47.8%Easy0.009390798483527519https://leetcode.com/problems/climbing-stairs
3628Implement strStr()34.5%Easy0.008850485542574548https://leetcode.com/problems/implement-strstr
37253Meeting Rooms II45.7%Medium0.008079219870546493https://leetcode.com/problems/meeting-rooms-ii
38151Reverse Words in a String21.9%Medium0.0061359296669270605https://leetcode.com/problems/reverse-words-in-a-string
398String to Integer (atoi)15.4%Medium0.0037925521897059712https://leetcode.com/problems/string-to-integer-atoi
40102Binary Tree Level Order Traversal54.6%Medium0.003639014205004082https://leetcode.com/problems/binary-tree-level-order-traversal
41718Maximum Length of Repeated Subarray49.4%Medium0https://leetcode.com/problems/maximum-length-of-repeated-subarray
421515Best Position for a Service Centre35.9%Hard0https://leetcode.com/problems/best-position-for-a-service-centre