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

6.6 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
21086High Five79.7%Easy1.3586699801761455https://leetcode.com/problems/high-five
3780Reaching Points29.4%Hard1.054860335368066https://leetcode.com/problems/reaching-points
442Trapping Rain Water48.9%Hard0.9988138361152376https://leetcode.com/problems/trapping-rain-water
51041Robot Bounded In Circle49.6%Medium0.695004191307158https://leetcode.com/problems/robot-bounded-in-circle
6209Minimum Size Subarray Sum38.2%Medium0.612452943971577https://leetcode.com/problems/minimum-size-subarray-sum
71163Last Substring in Lexicographical Order33.9%Hard0.6115111972698513https://leetcode.com/problems/last-substring-in-lexicographical-order
8387First Unique Character in a String53.4%Easy0.32101462511769185https://leetcode.com/problems/first-unique-character-in-a-string
94Median of Two Sorted Arrays29.6%Hard0.24868407775398862https://leetcode.com/problems/median-of-two-sorted-arrays
10524Longest Word in Dictionary through Deleting48.4%Medium0.24560650857731212https://leetcode.com/problems/longest-word-in-dictionary-through-deleting
11166Fraction to Recurring Decimal21.6%Medium0.22263451592525935https://leetcode.com/problems/fraction-to-recurring-decimal
12443String Compression41.3%Easy0.15834355808729428https://leetcode.com/problems/string-compression
13592Fraction Addition and Subtraction49.0%Medium0.15718558352241233https://leetcode.com/problems/fraction-addition-and-subtraction
14532K-diff Pairs in an Array31.6%Easy0.15718558352241233https://leetcode.com/problems/k-diff-pairs-in-an-array
15862Shortest Subarray with Sum at Least K24.6%Hard0.09793753498670578https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k
1664Minimum Path Sum54.5%Medium0.09380040794039024https://leetcode.com/problems/minimum-path-sum
1749Group Anagrams56.9%Medium0.09101320494254857https://leetcode.com/problems/group-anagrams
18688Knight Probability in Chessboard48.9%Medium0.08392620769993404https://leetcode.com/problems/knight-probability-in-chessboard
19939Minimum Area Rectangle51.8%Medium0.08361414004113359https://leetcode.com/problems/minimum-area-rectangle
20547Friend Circles58.6%Medium0.07408600065076033https://leetcode.com/problems/friend-circles
211051Height Checker71.1%Easy0.06960783038095686https://leetcode.com/problems/height-checker
22289Game of Life54.5%Medium0.06756473699960104https://leetcode.com/problems/game-of-life
231395Count Number of Teams82.0%Medium0.056405927913552076https://leetcode.com/problems/count-number-of-teams
24647Palindromic Substrings60.6%Medium0.040968350772541844https://leetcode.com/problems/palindromic-substrings
25706Design HashMap61.3%Easy0.039016652342451774https://leetcode.com/problems/design-hashmap
26657Robot Return to Origin73.5%Easy0.03896596853338373https://leetcode.com/problems/robot-return-to-origin
27993Cousins in Binary Tree52.0%Easy0.03876454345024432https://leetcode.com/problems/cousins-in-binary-tree
28942DI String Match72.6%Easy0.03865215443427916https://leetcode.com/problems/di-string-match
29322Coin Change35.5%Medium0.024924029676386045https://leetcode.com/problems/coin-change
308String to Integer (atoi)15.4%Medium0.023470848345506903https://leetcode.com/problems/string-to-integer-atoi
31326Power of Three42.1%Easy0.023341308632796296https://leetcode.com/problems/power-of-three
321209Remove All Adjacent Duplicates in String II56.9%Medium0.02324334737232728https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii
3399Recover Binary Search Tree39.7%Hard0.02310905839365837https://leetcode.com/problems/recover-binary-search-tree
34146LRU Cache33.2%Medium0.01827577993873683https://leetcode.com/problems/lru-cache
35200Number of Islands46.8%Medium0.017925481766054456https://leetcode.com/problems/number-of-islands
36560Subarray Sum Equals K43.9%Medium0.017009020666013328https://leetcode.com/problems/subarray-sum-equals-k
37153Find Minimum in Rotated Sorted Array45.1%Medium0.014939586916186732https://leetcode.com/problems/find-minimum-in-rotated-sorted-array
38724Find Pivot Index44.0%Easy0.013850636933899008https://leetcode.com/problems/find-pivot-index
39120Triangle44.2%Medium0.013236460625830901https://leetcode.com/problems/triangle
40121Best Time to Buy and Sell Stock50.5%Easy0.013201163302846108https://leetcode.com/problems/best-time-to-buy-and-sell-stock
4162Unique Paths54.1%Medium0.010367562048856941https://leetcode.com/problems/unique-paths
42238Product of Array Except Self60.1%Medium0.008821856860216758https://leetcode.com/problems/product-of-array-except-self
43876Middle of the Linked List68.4%Easy0.007624893975696915https://leetcode.com/problems/middle-of-the-linked-list
441Two Sum45.6%Easy0.0073613942765888805https://leetcode.com/problems/two-sum
4519Remove Nth Node From End of List35.2%Medium0.0069087555063702365https://leetcode.com/problems/remove-nth-node-from-end-of-list
4611Container With Most Water50.8%Medium0.006889188300412141https://leetcode.com/problems/container-with-most-water
4776Minimum Window Substring34.6%Hard0.006231520398723243https://leetcode.com/problems/minimum-window-substring
48206Reverse Linked List62.5%Easy0.005257021452801617https://leetcode.com/problems/reverse-linked-list
49237Delete Node in a Linked List63.8%Easy0.005144705881237697https://leetcode.com/problems/delete-node-in-a-linked-list
5053Maximum Subarray46.5%Easy0.004869349014182134https://leetcode.com/problems/maximum-subarray
51155Min Stack44.5%Easy0.00474891074128171https://leetcode.com/problems/min-stack
5217Letter Combinations of a Phone Number46.8%Medium0.0044018999217624675https://leetcode.com/problems/letter-combinations-of-a-phone-number
53242Valid Anagram56.9%Easy0.004154123743115972https://leetcode.com/problems/valid-anagram
54141Linked List Cycle41.1%Easy0.0034937584669245472https://leetcode.com/problems/linked-list-cycle
5556Merge Intervals39.3%Medium0.0034728286335985107https://leetcode.com/problems/merge-intervals
56122Best Time to Buy and Sell Stock II57.0%Easy0.0033545821461532107https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii
5733Search in Rotated Sorted Array34.5%Medium0.003229976968332634https://leetcode.com/problems/search-in-rotated-sorted-array
5820Valid Parentheses39.0%Easy0.0023005704055949323https://leetcode.com/problems/valid-parentheses
593Longest Substring Without Repeating Characters30.4%Medium0.0015556336509412823https://leetcode.com/problems/longest-substring-without-repeating-characters