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

7.6 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2780Reaching Points29.4%Hard0.33832960242595933https://leetcode.com/problems/reaching-points
3146LRU Cache33.2%Medium0.2585885798043696https://leetcode.com/problems/lru-cache
41283Find the Smallest Divisor Given a Threshold47.6%Medium0.17884755718277986https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold
5706Design HashMap61.3%Easy0.1476880076475794https://leetcode.com/problems/design-hashmap
6460LFU Cache34.2%Hard0.11848160362052347https://leetcode.com/problems/lfu-cache
7532K-diff Pairs in an Array31.6%Easy0.111723209445655https://leetcode.com/problems/k-diff-pairs-in-an-array
882Remove Duplicates from Sorted List II36.8%Medium0.1110882064011508https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii
956Merge Intervals39.3%Medium0.10005860920617055https://leetcode.com/problems/merge-intervals
10251Flatten 2D Vector45.7%Medium0.06635933243696077https://leetcode.com/problems/flatten-2d-vector
11353Design Snake Game34.2%Medium0.06053284922884233https://leetcode.com/problems/design-snake-game
12384Shuffle an Array52.8%Medium0.05965241992885116https://leetcode.com/problems/shuffle-an-array
13218The Skyline Problem34.6%Hard0.0564413109049518https://leetcode.com/problems/the-skyline-problem
1483Remove Duplicates from Sorted List45.4%Easy0.055776537457411894https://leetcode.com/problems/remove-duplicates-from-sorted-list
15642Design Search Autocomplete System44.7%Hard0.04334372921647208https://leetcode.com/problems/design-search-autocomplete-system
16895Maximum Frequency Stack60.6%Hard0.04329680575332419https://leetcode.com/problems/maximum-frequency-stack
1717Letter Combinations of a Phone Number46.8%Medium0.03893646375009422https://leetcode.com/problems/letter-combinations-of-a-phone-number
18179Largest Number28.8%Medium0.03093030069135863https://leetcode.com/problems/largest-number
19724Find Pivot Index44.0%Easy0.03089844155123413https://leetcode.com/problems/find-pivot-index
20135Candy31.6%Hard0.029764101906453892https://leetcode.com/problems/candy
21348Design Tic-Tac-Toe54.3%Medium0.024214258120594613https://leetcode.com/problems/design-tic-tac-toe
22127Word Ladder29.6%Medium0.023704813655166343https://leetcode.com/problems/word-ladder
23211Add and Search Word - Data structure design38.1%Medium0.02333525640896379https://leetcode.com/problems/add-and-search-word-data-structure-design
24207Course Schedule43.1%Medium0.019709926055136454https://leetcode.com/problems/course-schedule
25314Binary Tree Vertical Order Traversal45.3%Medium0.018010392274465332https://leetcode.com/problems/binary-tree-vertical-order-traversal
26692Top K Frequent Words51.8%Medium0.016832265743172113https://leetcode.com/problems/top-k-frequent-words
2771Simplify Path32.6%Medium0.016260520871780308https://leetcode.com/problems/simplify-path
2823Merge k Sorted Lists40.2%Hard0.016108271385328228https://leetcode.com/problems/merge-k-sorted-lists
2941First Missing Positive32.0%Hard0.014368063266920193https://leetcode.com/problems/first-missing-positive
3020Valid Parentheses39.0%Easy0.014292491180025941https://leetcode.com/problems/valid-parentheses
31557Reverse Words in a String III69.8%Easy0.013731764001315941https://leetcode.com/problems/reverse-words-in-a-string-iii
32287Find the Duplicate Number55.5%Medium0.012335682739188652https://leetcode.com/problems/find-the-duplicate-number
33547Friend Circles58.6%Medium0.012228828639434596https://leetcode.com/problems/friend-circles
3498Validate Binary Search Tree27.8%Medium0.01172346369605921https://leetcode.com/problems/validate-binary-search-tree
35205Isomorphic Strings39.8%Easy0.011544139746865315https://leetcode.com/problems/isomorphic-strings
3648Rotate Image56.7%Medium0.011428695823622754https://leetcode.com/problems/rotate-image
37232Implement Queue using Stacks49.6%Easy0.011242389348933884https://leetcode.com/problems/implement-queue-using-stacks
38236Lowest Common Ancestor of a Binary Tree45.7%Medium0.010575891759058162https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
39212Word Search II34.9%Hard0.009845021678804893https://leetcode.com/problems/word-search-ii
40380Insert Delete GetRandom O(1)47.5%Medium0.009820849864094454https://leetcode.com/problems/insert-delete-getrandom-o1
4142Trapping Rain Water48.9%Hard0.009762524655659178https://leetcode.com/problems/trapping-rain-water
42295Find Median from Data Stream44.3%Hard0.00899893586856953https://leetcode.com/problems/find-median-from-data-stream
4312Integer to Roman55.1%Medium0.008532474973720734https://leetcode.com/problems/integer-to-roman
44153Find Minimum in Rotated Sorted Array45.1%Medium0.008430963288799368https://leetcode.com/problems/find-minimum-in-rotated-sorted-array
45394Decode String50.0%Medium0.008166644000272283https://leetcode.com/problems/decode-string
46240Search a 2D Matrix II43.2%Medium0.0075829747244553335https://leetcode.com/problems/search-a-2d-matrix-ii
4736Valid Sudoku48.7%Medium0.007258242715805398https://leetcode.com/problems/valid-sudoku
48412Fizz Buzz62.3%Easy0.007165921026143679https://leetcode.com/problems/fizz-buzz
49297Serialize and Deserialize Binary Tree47.5%Hard0.007077170374085099https://leetcode.com/problems/serialize-and-deserialize-binary-tree
5073Set Matrix Zeroes43.1%Medium0.0070151111959223245https://leetcode.com/problems/set-matrix-zeroes
51200Number of Islands46.8%Medium0.006490251382779317https://leetcode.com/problems/number-of-islands
5276Minimum Window Substring34.6%Hard0.006231520398723243https://leetcode.com/problems/minimum-window-substring
53226Invert Binary Tree65.0%Easy0.005508138409792252https://leetcode.com/problems/invert-binary-tree
54300Longest Increasing Subsequence42.6%Medium0.005264555460003242https://leetcode.com/problems/longest-increasing-subsequence
55350Intersection of Two Arrays II51.4%Easy0.005210380421193978https://leetcode.com/problems/intersection-of-two-arrays-ii
5622Generate Parentheses62.7%Medium0.0043611059090124735https://leetcode.com/problems/generate-parentheses
5746Permutations63.5%Medium0.004216302230139218https://leetcode.com/problems/permutations
58238Product of Array Except Self60.1%Medium0.003930436424724545https://leetcode.com/problems/product-of-array-except-self
59215Kth Largest Element in an Array55.4%Medium0.003902443976931749https://leetcode.com/problems/kth-largest-element-in-an-array
60139Word Break40.1%Medium0.003894465052690167https://leetcode.com/problems/word-break
6149Group Anagrams56.9%Medium0.0038040939835560453https://leetcode.com/problems/group-anagrams
62151Reverse Words in a String21.9%Medium0.003456091915988908https://leetcode.com/problems/reverse-words-in-a-string
63101Symmetric Tree46.8%Easy0.0034057078469827435https://leetcode.com/problems/symmetric-tree
641Two Sum45.6%Easy0.003278422738041615https://leetcode.com/problems/two-sum
6533Search in Rotated Sorted Array34.5%Medium0.003229976968332634https://leetcode.com/problems/search-in-rotated-sorted-array
66153Sum26.8%Medium0.0021990113314367685https://leetcode.com/problems/3sum
6753Maximum Subarray46.5%Easy0.002167082872150794https://leetcode.com/problems/maximum-subarray
682Add Two Numbers33.9%Medium0.0016886191111440908https://leetcode.com/problems/add-two-numbers
693Longest Substring Without Repeating Characters30.4%Medium0.0015556336509412823https://leetcode.com/problems/longest-substring-without-repeating-characters