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

8.5 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
21Two Sum45.6%Easy0.1532849790864647https://leetcode.com/problems/two-sum
32Add Two Numbers33.9%Medium0.10270361758692534https://leetcode.com/problems/add-two-numbers
421Merge Two Sorted Lists53.5%Easy0.09110919511165776https://leetcode.com/problems/merge-two-sorted-lists
537Sudoku Solver43.6%Hard0.040527833612118376https://leetcode.com/problems/sudoku-solver
6706Design HashMap61.3%Easy0.039016652342451774https://leetcode.com/problems/design-hashmap
7153Sum26.8%Medium0.0346167609048592https://leetcode.com/problems/3sum
83Longest Substring Without Repeating Characters30.4%Medium0.031039352871947277https://leetcode.com/problems/longest-substring-without-repeating-characters
9368Largest Divisible Subset38.0%Medium0.030351343424138456https://leetcode.com/problems/largest-divisible-subset
10219Contains Duplicate II37.7%Easy0.028500979167549973https://leetcode.com/problems/contains-duplicate-ii
11115Distinct Subsequences38.3%Hard0.027798871362742988https://leetcode.com/problems/distinct-subsequences
12343Integer Break50.4%Medium0.027157133968907482https://leetcode.com/problems/integer-break
1322Generate Parentheses62.7%Medium0.026949997964496694https://leetcode.com/problems/generate-parentheses
14202Happy Number50.4%Easy0.02483442856330386https://leetcode.com/problems/happy-number
15206Reverse Linked List62.5%Easy0.02086427467076072https://leetcode.com/problems/reverse-linked-list
16525Contiguous Array42.8%Medium0.01975372873623256https://leetcode.com/problems/contiguous-array
1712Integer to Roman55.1%Medium0.019096697456456382https://leetcode.com/problems/integer-to-roman
18993Cousins in Binary Tree52.0%Easy0.017414458368636587https://leetcode.com/problems/cousins-in-binary-tree
19994Rotting Oranges49.2%Medium0.017087941897195622https://leetcode.com/problems/rotting-oranges
207Reverse Integer25.8%Easy0.016627790608488954https://leetcode.com/problems/reverse-integer
21315Count of Smaller Numbers After Self41.5%Hard0.014352596574956585https://leetcode.com/problems/count-of-smaller-numbers-after-self
225Longest Palindromic Substring29.5%Medium0.01416133329402493https://leetcode.com/problems/longest-palindromic-substring
2376Minimum Window Substring34.6%Hard0.013966707481708198https://leetcode.com/problems/minimum-window-substring
24703Kth Largest Element in a Stream49.7%Easy0.013898764390814973https://leetcode.com/problems/kth-largest-element-in-a-stream
2582Remove Duplicates from Sorted List II36.8%Medium0.01297035044262745https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii
26137Single Number II52.4%Medium0.012527567532662891https://leetcode.com/problems/single-number-ii
2711Container With Most Water50.8%Medium0.012214824746492168https://leetcode.com/problems/container-with-most-water
28300Longest Increasing Subsequence42.6%Medium0.011806512586989004https://leetcode.com/problems/longest-increasing-subsequence
29987Vertical Order Traversal of a Binary Tree36.6%Medium0.011601058182762062https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree
30200Number of Islands46.8%Medium0.011509262420590827https://leetcode.com/problems/number-of-islands
3155Jump Game34.6%Medium0.011265609194218986https://leetcode.com/problems/jump-game
32236Lowest Common Ancestor of a Binary Tree45.7%Medium0.010575891759058162https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
3325Reverse Nodes in k-Group42.1%Hard0.01021198560502829https://leetcode.com/problems/reverse-nodes-in-k-group
34739Daily Temperatures63.3%Medium0.010032690121814417https://leetcode.com/problems/daily-temperatures
3561Rotate List30.0%Medium0.009925639799969955https://leetcode.com/problems/rotate-list
36184Sum33.7%Medium0.00984259914419414https://leetcode.com/problems/4sum
37113Path Sum II46.7%Medium0.009784813879998279https://leetcode.com/problems/path-sum-ii
38560Subarray Sum Equals K43.9%Medium0.009603146783199741https://leetcode.com/problems/subarray-sum-equals-k
3945Jump Game II30.6%Hard0.009546611883579968https://leetcode.com/problems/jump-game-ii
4096Unique Binary Search Trees52.9%Medium0.009242209964820877https://leetcode.com/problems/unique-binary-search-trees
41279Perfect Squares47.4%Medium0.009216655104924008https://leetcode.com/problems/perfect-squares
42239Sliding Window Maximum43.0%Hard0.007898935224534491https://leetcode.com/problems/sliding-window-maximum
436ZigZag Conversion36.3%Medium0.0077116248757144665https://leetcode.com/problems/zigzag-conversion
44175Combine Two Tables60.8%Easy0.007696786120491369https://leetcode.com/problems/combine-two-tables
45176Second Highest Salary31.6%Easy0.007393749024938284https://leetcode.com/problems/second-highest-salary
4610Regular Expression Matching26.8%Hard0.0071865203293987245https://leetcode.com/problems/regular-expression-matching
471365How Many Numbers Are Smaller Than the Current Number85.6%Easy0.007109877088701047https://leetcode.com/problems/how-many-numbers-are-smaller-than-the-current-number
48204Count Primes31.5%Easy0.007072165261362441https://leetcode.com/problems/count-primes
49110Balanced Binary Tree43.5%Easy0.007027435807456887https://leetcode.com/problems/balanced-binary-tree
50114Flatten Binary Tree to Linked List49.3%Medium0.006896579059060353https://leetcode.com/problems/flatten-binary-tree-to-linked-list
5188Merge Sorted Array39.4%Easy0.006760335218638243https://leetcode.com/problems/merge-sorted-array
5283Remove Duplicates from Sorted List45.4%Easy0.006353261522609498https://leetcode.com/problems/remove-duplicates-from-sorted-list
5324Swap Nodes in Pairs50.4%Medium0.0062218275061505365https://leetcode.com/problems/swap-nodes-in-pairs
5431Next Permutation32.6%Medium0.005989835219179644https://leetcode.com/problems/next-permutation
55152Maximum Product Subarray31.7%Medium0.005590510716885066https://leetcode.com/problems/maximum-product-subarray
56112Path Sum41.2%Easy0.00546972510956646https://leetcode.com/problems/path-sum
57543Diameter of Binary Tree48.4%Easy0.005305755914149804https://leetcode.com/problems/diameter-of-binary-tree
58237Delete Node in a Linked List63.8%Easy0.005144705881237697https://leetcode.com/problems/delete-node-in-a-linked-list
5953Maximum Subarray46.5%Easy0.004869349014182134https://leetcode.com/problems/maximum-subarray
60169Majority Element58.7%Easy0.004706444738837472https://leetcode.com/problems/majority-element
6135Search Insert Position42.6%Easy0.004646848510375352https://leetcode.com/problems/search-insert-position
62146LRU Cache33.2%Medium0.004600353139061353https://leetcode.com/problems/lru-cache
63234Palindrome Linked List39.3%Easy0.004533613114828982https://leetcode.com/problems/palindrome-linked-list
641470Shuffle the Array88.9%Easy0.004527967890154029https://leetcode.com/problems/shuffle-the-array
6542Trapping Rain Water48.9%Hard0.004350670338744988https://leetcode.com/problems/trapping-rain-water
66387First Unique Character in a String53.4%Easy0.00418541994270691https://leetcode.com/problems/first-unique-character-in-a-string
6723Merge k Sorted Lists40.2%Hard0.004051459000748015https://leetcode.com/problems/merge-k-sorted-lists
684Median of Two Sorted Arrays29.6%Hard0.003900160950094767https://leetcode.com/problems/median-of-two-sorted-arrays
69977Squares of a Sorted Array72.1%Easy0.003891055492966611https://leetcode.com/problems/squares-of-a-sorted-array
7049Group Anagrams56.9%Medium0.0038040939835560453https://leetcode.com/problems/group-anagrams
71217Contains Duplicate56.0%Easy0.0037979536727587773https://leetcode.com/problems/contains-duplicate
72198House Robber42.0%Easy0.0037576371128333645https://leetcode.com/problems/house-robber
73141Linked List Cycle41.1%Easy0.0034937584669245472https://leetcode.com/problems/linked-list-cycle
7456Merge Intervals39.3%Medium0.0034728286335985107https://leetcode.com/problems/merge-intervals
7513Roman to Integer55.7%Easy0.003428770717317083https://leetcode.com/problems/roman-to-integer
76344Reverse String68.5%Easy0.003269579502519813https://leetcode.com/problems/reverse-string
7766Plus One43.0%Easy0.00326211347832938https://leetcode.com/problems/plus-one
78104Maximum Depth of Binary Tree66.0%Easy0.002787846801433134https://leetcode.com/problems/maximum-depth-of-binary-tree
7920Valid Parentheses39.0%Easy0.0023005704055949323https://leetcode.com/problems/valid-parentheses