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

5.8 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2635Design Log Storage System58.6%Medium2.2981349041046517https://leetcode.com/problems/design-log-storage-system
3256Paint House52.1%Easy1.5313678227960323https://leetcode.com/problems/paint-house
4780Reaching Points29.4%Hard1.3793349295510802https://leetcode.com/problems/reaching-points
557Insert Interval33.5%Hard0.6125678482424609https://leetcode.com/problems/insert-interval
6920Number of Music Playlists46.5%Hard0.2876820724517809https://leetcode.com/problems/number-of-music-playlists
71326Minimum Number of Taps to Open to Water a Garden43.6%Hard0.2786048543006643https://leetcode.com/problems/minimum-number-of-taps-to-open-to-water-a-garden
8945Minimum Increment to Make Array Unique46.3%Medium0.27427904232444056https://leetcode.com/problems/minimum-increment-to-make-array-unique
9547Friend Circles58.6%Medium0.22246660738239243https://leetcode.com/problems/friend-circles
10341Flatten Nested List Iterator52.9%Medium0.2209211036876481https://leetcode.com/problems/flatten-nested-list-iterator
11532K-diff Pairs in an Array31.6%Easy0.15718558352241233https://leetcode.com/problems/k-diff-pairs-in-an-array
1220Valid Parentheses39.0%Easy0.13750374228546985https://leetcode.com/problems/valid-parentheses
13706Design HashMap61.3%Easy0.10482987091202353https://leetcode.com/problems/design-hashmap
14200Number of Islands46.8%Medium0.09910455319823885https://leetcode.com/problems/number-of-islands
15307Range Sum Query - Mutable34.6%Medium0.08612096757681667https://leetcode.com/problems/range-sum-query-mutable
16161One Edit Distance32.3%Medium0.07982960165248484https://leetcode.com/problems/one-edit-distance
17271Encode and Decode Strings31.5%Medium0.07197349962508924https://leetcode.com/problems/encode-and-decode-strings
18647Palindromic Substrings60.6%Medium0.06329624434241725https://leetcode.com/problems/palindromic-substrings
1968Text Justification27.7%Hard0.06116036187169583https://leetcode.com/problems/text-justification
20528Random Pick with Weight43.9%Medium0.05805039128849884https://leetcode.com/problems/random-pick-with-weight
21295Find Median from Data Stream44.3%Hard0.05495888428075748https://leetcode.com/problems/find-median-from-data-stream
2256Merge Intervals39.3%Medium0.054167920212564245https://leetcode.com/problems/merge-intervals
2367924 Game46.4%Hard0.05341723749698583https://leetcode.com/problems/24-game
24767Reorganize String48.7%Medium0.05216306328458592https://leetcode.com/problems/reorganize-string
25981Time Based Key-Value Store53.1%Medium0.049406315387071284https://leetcode.com/problems/time-based-key-value-store
261041Robot Bounded In Circle49.6%Medium0.0483770263821056https://leetcode.com/problems/robot-bounded-in-circle
27239Sliding Window Maximum43.0%Hard0.0483746857022364https://leetcode.com/problems/sliding-window-maximum
28490The Maze51.4%Medium0.04287902305923364https://leetcode.com/problems/the-maze
29716Max Stack42.6%Easy0.042695919196489414https://leetcode.com/problems/max-stack
30346Moving Average from Data Stream70.9%Easy0.03932354620391436https://leetcode.com/problems/moving-average-from-data-stream
31380Insert Delete GetRandom O(1)47.5%Medium0.038717635350707984https://leetcode.com/problems/insert-delete-getrandom-o1
32133Clone Graph34.8%Medium0.03215711163453134https://leetcode.com/problems/clone-graph
33814Binary Tree Pruning74.5%Medium0.03113091859517317https://leetcode.com/problems/binary-tree-pruning
34496Next Greater Element I63.8%Easy0.029462032730316202https://leetcode.com/problems/next-greater-element-i
35482License Key Formatting43.1%Easy0.024799783060416587https://leetcode.com/problems/license-key-formatting
36540Single Element in a Sorted Array57.9%Medium0.0192128868599912https://leetcode.com/problems/single-element-in-a-sorted-array
3723Merge k Sorted Lists40.2%Hard0.016108271385328228https://leetcode.com/problems/merge-k-sorted-lists
3876Minimum Window Substring34.6%Hard0.013966707481708198https://leetcode.com/problems/minimum-window-substring
39269Alien Dictionary33.3%Hard0.012730916694039954https://leetcode.com/problems/alien-dictionary
40146LRU Cache33.2%Medium0.010321192540274932https://leetcode.com/problems/lru-cache
41208Implement Trie (Prefix Tree)49.4%Medium0.009105457856626612https://leetcode.com/problems/implement-trie-prefix-tree
4284Largest Rectangle in Histogram35.2%Hard0.00833685528906183https://leetcode.com/problems/largest-rectangle-in-histogram
43101Symmetric Tree46.8%Easy0.007646596306528098https://leetcode.com/problems/symmetric-tree
4436Valid Sudoku48.7%Medium0.007258242715805398https://leetcode.com/problems/valid-sudoku
4510Regular Expression Matching26.8%Hard0.0071865203293987245https://leetcode.com/problems/regular-expression-matching
4691Decode Ways24.7%Medium0.005968385368349129https://leetcode.com/problems/decode-ways
47105Construct Binary Tree from Preorder and Inorder Traversal48.8%Medium0.005628268691614718https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal
48124Binary Tree Maximum Path Sum34.3%Hard0.005531752454833179https://leetcode.com/problems/binary-tree-maximum-path-sum
49169Majority Element58.7%Easy0.004706444738837472https://leetcode.com/problems/majority-element
50139Word Break40.1%Medium0.003894465052690167https://leetcode.com/problems/word-break
51106Construct Binary Tree from Inorder and Postorder Traversal47.2%Medium0.00234041415121758https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal
52210Course Schedule II40.7%Medium0.0019086707135282834https://leetcode.com/problems/course-schedule-ii
531Two Sum45.6%Easy0.0008206138651873125https://leetcode.com/problems/two-sum