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

4.5 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
5647Palindromic Substrings60.6%Medium0.154673282399905https://leetcode.com/problems/palindromic-substrings
6241Different Ways to Add Parentheses55.2%Medium0.14691814457724592https://leetcode.com/problems/different-ways-to-add-parentheses
7935Knight Dialer45.2%Medium0.09737416402517636https://leetcode.com/problems/knight-dialer
832Longest Valid Parentheses28.4%Hard0.07916219339634281https://leetcode.com/problems/longest-valid-parentheses
9239Sliding Window Maximum43.0%Hard0.0483746857022364https://leetcode.com/problems/sliding-window-maximum
10240Search a 2D Matrix II43.2%Medium0.04647676584572884https://leetcode.com/problems/search-a-2d-matrix-ii
1120Valid Parentheses39.0%Easy0.045585204865984434https://leetcode.com/problems/valid-parentheses
12221Maximal Square37.7%Medium0.03897229680620825https://leetcode.com/problems/maximal-square
1342Trapping Rain Water48.9%Hard0.038490960607653675https://leetcode.com/problems/trapping-rain-water
14332Reconstruct Itinerary36.7%Medium0.030687713231237448https://leetcode.com/problems/reconstruct-itinerary
15622Design Circular Queue43.7%Medium0.02246023667974994https://leetcode.com/problems/design-circular-queue
16121Best Time to Buy and Sell Stock50.5%Easy0.018954919107260947https://leetcode.com/problems/best-time-to-buy-and-sell-stock
17628Maximum Product of Three Numbers47.1%Easy0.016529301951210565https://leetcode.com/problems/maximum-product-of-three-numbers
18225Implement Stack using Queues45.1%Easy0.01644097863345757https://leetcode.com/problems/implement-stack-using-queues
19340Longest Substring with At Most K Distinct Characters44.1%Hard0.016122880486563188https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters
20297Serialize and Deserialize Binary Tree47.5%Hard0.01585377577217724https://leetcode.com/problems/serialize-and-deserialize-binary-tree
21724Find Pivot Index44.0%Easy0.013850636933899008https://leetcode.com/problems/find-pivot-index
2285Maximal Rectangle37.7%Hard0.013333530869465187https://leetcode.com/problems/maximal-rectangle
23200Number of Islands46.8%Medium0.011509262420590827https://leetcode.com/problems/number-of-islands
24123Best Time to Buy and Sell Stock III37.5%Hard0.011261380272539033https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii
25232Implement Queue using Stacks49.6%Easy0.011242389348933884https://leetcode.com/problems/implement-queue-using-stacks
26146LRU Cache33.2%Medium0.010321192540274932https://leetcode.com/problems/lru-cache
27212Word Search II34.9%Hard0.009845021678804893https://leetcode.com/problems/word-search-ii
28295Find Median from Data Stream44.3%Hard0.00899893586856953https://leetcode.com/problems/find-median-from-data-stream
29253Meeting Rooms II45.7%Medium0.008079219870546493https://leetcode.com/problems/meeting-rooms-ii
30122Best Time to Buy and Sell Stock II57.0%Easy0.007532046655581962https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii
31199Binary Tree Right Side View54.1%Medium0.0056826406650506926https://leetcode.com/problems/binary-tree-right-side-view
32105Construct Binary Tree from Preorder and Inorder Traversal48.8%Medium0.005628268691614718https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal
33153Sum26.8%Medium0.004940992758742591https://leetcode.com/problems/3sum
3453Maximum Subarray46.5%Easy0.004869349014182134https://leetcode.com/problems/maximum-subarray
3528Implement strStr()34.5%Easy0.003943222775040032https://leetcode.com/problems/implement-strstr
368String to Integer (atoi)15.4%Medium0.0037925521897059712https://leetcode.com/problems/string-to-integer-atoi
37102Binary Tree Level Order Traversal54.6%Medium0.003639014205004082https://leetcode.com/problems/binary-tree-level-order-traversal
38151Reverse Words in a String21.9%Medium0.0015375156780384337https://leetcode.com/problems/reverse-words-in-a-string
3970Climbing Stairs47.8%Easy0.0015084665529624085https://leetcode.com/problems/climbing-stairs
401Two Sum45.6%Easy0.0008206138651873125https://leetcode.com/problems/two-sum