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

6.5 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
21473Paint House III48.1%Hard0.4201627490481727https://leetcode.com/problems/paint-house-iii
31041Robot Bounded In Circle49.6%Medium0.26986631760028884https://leetcode.com/problems/robot-bounded-in-circle
41497Check If Array Pairs Are Divisible by k41.1%Medium0.2357666456855048https://leetcode.com/problems/check-if-array-pairs-are-divisible-by-k
5243Shortest Word Distance61.0%Easy0.23122733458279973https://leetcode.com/problems/shortest-word-distance
6242Valid Anagram56.9%Easy0.08093090313491587https://leetcode.com/problems/valid-anagram
754Spiral Matrix34.1%Medium0.07792846120043545https://leetcode.com/problems/spiral-matrix
81297Maximum Number of Occurrences of a Substring47.3%Medium0.07770898432731625https://leetcode.com/problems/maximum-number-of-occurrences-of-a-substring
968Text Justification27.7%Hard0.06116036187169583https://leetcode.com/problems/text-justification
1056Merge Intervals39.3%Medium0.054167920212564245https://leetcode.com/problems/merge-intervals
11224Basic Calculator36.8%Hard0.046568165477211425https://leetcode.com/problems/basic-calculator
12532K-diff Pairs in an Array31.6%Easy0.041672696400568025https://leetcode.com/problems/k-diff-pairs-in-an-array
1325Reverse Nodes in k-Group42.1%Hard0.040236757867738004https://leetcode.com/problems/reverse-nodes-in-k-group
1453Maximum Subarray46.5%Easy0.03412208634661372https://leetcode.com/problems/maximum-subarray
15240Search a 2D Matrix II43.2%Medium0.02999287612403949https://leetcode.com/problems/search-a-2d-matrix-ii
16324Wiggle Sort II29.9%Medium0.02898753687325229https://leetcode.com/problems/wiggle-sort-ii
17146LRU Cache33.2%Medium0.028411001832779885https://leetcode.com/problems/lru-cache
1820Valid Parentheses39.0%Easy0.02782373445001039https://leetcode.com/problems/valid-parentheses
1973Set Matrix Zeroes43.1%Medium0.027769920533553028https://leetcode.com/problems/set-matrix-zeroes
20735Asteroid Collision41.0%Medium0.024723138086794758https://leetcode.com/problems/asteroid-collision
21128Longest Consecutive Sequence45.1%Hard0.020252717433212362https://leetcode.com/problems/longest-consecutive-sequence
2212Integer to Roman55.1%Medium0.019096697456456382https://leetcode.com/problems/integer-to-roman
23253Meeting Rooms II45.7%Medium0.018087309810579388https://leetcode.com/problems/meeting-rooms-ii
246ZigZag Conversion36.3%Medium0.01726827253226344https://leetcode.com/problems/zigzag-conversion
251Two Sum45.6%Easy0.016487580637467636https://leetcode.com/problems/two-sum
26977Squares of a Sorted Array72.1%Easy0.015474196582597383https://leetcode.com/problems/squares-of-a-sorted-array
27557Reverse Words in a String III69.8%Easy0.013731764001315941https://leetcode.com/problems/reverse-words-in-a-string-iii
28134Gas Station38.5%Medium0.01352742981715631https://leetcode.com/problems/gas-station
291047Remove All Adjacent Duplicates In String68.6%Easy0.013059277989179281https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string
3082Remove Duplicates from Sorted List II36.8%Medium0.01297035044262745https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii
31199Binary Tree Right Side View54.1%Medium0.01274082919906162https://leetcode.com/problems/binary-tree-right-side-view
32227Basic Calculator II36.9%Medium0.01239941490503826https://leetcode.com/problems/basic-calculator-ii
33273Integer to English Words27.1%Hard0.012081089250339716https://leetcode.com/problems/integer-to-english-words
3475Sort Colors47.3%Medium0.011198325310029539https://leetcode.com/problems/sort-colors
3572Edit Distance44.8%Hard0.010017614452317782https://leetcode.com/problems/edit-distance
3646Permutations63.5%Medium0.009461803137288448https://leetcode.com/problems/permutations
37189Rotate Array34.7%Easy0.00904437880665999https://leetcode.com/problems/rotate-array
38416Partition Equal Subset Sum43.7%Medium0.008686265255960345https://leetcode.com/problems/partition-equal-subset-sum
39876Middle of the Linked List68.4%Easy0.007624893975696915https://leetcode.com/problems/middle-of-the-linked-list
402Add Two Numbers33.9%Medium0.006737434951993369https://leetcode.com/problems/add-two-numbers
41283Move Zeroes57.8%Easy0.006480437425856766https://leetcode.com/problems/move-zeroes
42973K Closest Points to Origin63.8%Medium0.005773688094426333https://leetcode.com/problems/k-closest-points-to-origin
43167Two Sum II - Input array is sorted54.1%Easy0.005507380022589096https://leetcode.com/problems/two-sum-ii-input-array-is-sorted
44207Course Schedule43.1%Medium0.004964021114211758https://leetcode.com/problems/course-schedule
45153Sum26.8%Medium0.004940992758742591https://leetcode.com/problems/3sum
46236Lowest Common Ancestor of a Binary Tree45.7%Medium0.004714210262726446https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
47322Coin Change35.5%Medium0.004029826126500844https://leetcode.com/problems/coin-change
4828Implement strStr()34.5%Easy0.003943222775040032https://leetcode.com/problems/implement-strstr
49238Product of Array Except Self60.1%Medium0.003930436424724545https://leetcode.com/problems/product-of-array-except-self
50344Reverse String68.5%Easy0.003269579502519813https://leetcode.com/problems/reverse-string
5133Search in Rotated Sorted Array34.5%Medium0.003229976968332634https://leetcode.com/problems/search-in-rotated-sorted-array
52200Number of Islands46.8%Medium0.0028897578265903614https://leetcode.com/problems/number-of-islands
53104Maximum Depth of Binary Tree66.0%Easy0.002787846801433134https://leetcode.com/problems/maximum-depth-of-binary-tree
54206Reverse Linked List62.5%Easy0.0023398665252948926https://leetcode.com/problems/reverse-linked-list
555Longest Palindromic Substring29.5%Medium0.002279333142507479https://leetcode.com/problems/longest-palindromic-substring
5621Merge Two Sorted Lists53.5%Easy0.0022551737583973706https://leetcode.com/problems/merge-two-sorted-lists
57121Best Time to Buy and Sell Stock50.5%Easy0.0021239321954525975https://leetcode.com/problems/best-time-to-buy-and-sell-stock
58203Remove Linked List Elements38.6%Easy0.0016237064659255223https://leetcode.com/problems/remove-linked-list-elements
593Longest Substring Without Repeating Characters30.4%Medium0.0015556336509412823https://leetcode.com/problems/longest-substring-without-repeating-characters