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

9.9 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2364Nested List Weight Sum II62.8%Medium2.1923206790347614https://leetcode.com/problems/nested-list-weight-sum-ii
3244Shortest Word Distance II52.3%Medium1.8985208007953613https://leetcode.com/problems/shortest-word-distance-ii
4272Closest Binary Search Tree Value II50.5%Hard1.6047209225559615https://leetcode.com/problems/closest-binary-search-tree-value-ii
5716Max Stack42.6%Easy1.5967072751794937https://leetcode.com/problems/max-stack
6254Factor Combinations46.7%Medium1.4353364461874933https://leetcode.com/problems/factor-combinations
7366Find Leaves of Binary Tree70.6%Medium1.223942529959876https://leetcode.com/problems/find-leaves-of-binary-tree
8605Can Place Flowers31.6%Easy0.9524451336942912https://leetcode.com/problems/can-place-flowers
9339Nested List Weight Sum74.0%Easy0.8196573629915603https://leetcode.com/problems/nested-list-weight-sum
10156Binary Tree Upside Down55.0%Medium0.8187244879431477https://leetcode.com/problems/binary-tree-upside-down
11243Shortest Word Distance61.0%Easy0.8149687609079993https://leetcode.com/problems/shortest-word-distance
12432All O`one Data Structure32.4%Hard0.7611889165572873https://leetcode.com/problems/all-oone-data-structure
13256Paint House52.1%Easy0.4962622595780941https://leetcode.com/problems/paint-house
14150Evaluate Reverse Polish Notation36.3%Medium0.4708929134306197https://leetcode.com/problems/evaluate-reverse-polish-notation
15380Insert Delete GetRandom O(1)47.5%Medium0.4415683628848016https://leetcode.com/problems/insert-delete-getrandom-o1
16149Max Points on a Line16.9%Hard0.4117347211217598https://leetcode.com/problems/max-points-on-a-line
17297Serialize and Deserialize Binary Tree47.5%Hard0.3746934494414107https://leetcode.com/problems/serialize-and-deserialize-binary-tree
18698Partition to K Equal Sum Subsets45.0%Medium0.3589112475170129https://leetcode.com/problems/partition-to-k-equal-sum-subsets
19373Find K Pairs with Smallest Sums36.7%Medium0.3547436057206025https://leetcode.com/problems/find-k-pairs-with-smallest-sums
20671Second Minimum Node In a Binary Tree42.7%Easy0.3132532267195692https://leetcode.com/problems/second-minimum-node-in-a-binary-tree
2168Text Justification27.7%Hard0.29518712556880805https://leetcode.com/problems/text-justification
22730Count Different Palindromic Subsequences41.8%Hard0.2744368457017603https://leetcode.com/problems/count-different-palindromic-subsequences
231117Building H2O52.6%Medium0.2678623801635787https://leetcode.com/problems/building-h2o
241188Design Bounded Blocking Queue70.5%Medium0.23300728083654992https://leetcode.com/problems/design-bounded-blocking-queue
25265Paint House II44.6%Hard0.2300164306019718https://leetcode.com/problems/paint-house-ii
26261Graph Valid Tree42.2%Medium0.21068350715947268https://leetcode.com/problems/graph-valid-tree
27470Implement Rand10() Using Rand7()46.3%Medium0.15154989812720093https://leetcode.com/problems/implement-rand10-using-rand7
2857Insert Interval33.5%Hard0.14994432629434787https://leetcode.com/problems/insert-interval
2953Maximum Subarray46.5%Easy0.14560701105995025https://leetcode.com/problems/maximum-subarray
3076Minimum Window Substring34.6%Hard0.14520312778609068https://leetcode.com/problems/minimum-window-substring
31152Maximum Product Subarray31.7%Medium0.13116348974220138https://leetcode.com/problems/maximum-product-subarray
32739Daily Temperatures63.3%Medium0.11646575243222568https://leetcode.com/problems/daily-temperatures
33277Find the Celebrity41.8%Medium0.11383991212794757https://leetcode.com/problems/find-the-celebrity
34721Accounts Merge48.8%Medium0.11257939199174459https://leetcode.com/problems/accounts-merge
35215Kth Largest Element in an Array55.4%Medium0.11179140598811674https://leetcode.com/problems/kth-largest-element-in-an-array
36611Valid Triangle Number48.4%Medium0.09333193979221914https://leetcode.com/problems/valid-triangle-number
37381Insert Delete GetRandom O(1) - Duplicates allowed34.1%Hard0.09106388892287375https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed
3865Valid Number15.3%Hard0.08845542056186342https://leetcode.com/problems/valid-number
39449Serialize and Deserialize BST52.0%Medium0.08696405427235052https://leetcode.com/problems/serialize-and-deserialize-bst
40273Integer to English Words27.1%Hard0.0732177031685638https://leetcode.com/problems/integer-to-english-words
411042Flower Planting With No Adjacent48.5%Easy0.07249550203815351https://leetcode.com/problems/flower-planting-with-no-adjacent
42235Lowest Common Ancestor of a Binary Search Tree49.9%Easy0.07162965613925479https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree
43127Word Ladder29.6%Medium0.0708901210450219https://leetcode.com/problems/word-ladder
44170Two Sum III - Data structure design33.5%Easy0.06887402901251127https://leetcode.com/problems/two-sum-iii-data-structure-design
4556Merge Intervals39.3%Medium0.06807635025869622https://leetcode.com/problems/merge-intervals
4672Edit Distance44.8%Hard0.061024299119344635https://leetcode.com/problems/edit-distance
47464Can I Win28.8%Medium0.06053284922884233https://leetcode.com/problems/can-i-win
4861Rotate List30.0%Medium0.06047791896280124https://leetcode.com/problems/rotate-list
4912Integer to Roman55.1%Medium0.05217122936969127https://leetcode.com/problems/integer-to-roman
5034Find First and Last Position of Element in Sorted Array36.2%Medium0.05083027351406798https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
5133Search in Rotated Sorted Array34.5%Medium0.05046797817178903https://leetcode.com/problems/search-in-rotated-sorted-array
5246Permutations63.5%Medium0.05046375425919308https://leetcode.com/problems/permutations
53636Exclusive Time of Functions51.9%Medium0.04668897736546294https://leetcode.com/problems/exclusive-time-of-functions
54341Flatten Nested List Iterator52.9%Medium0.04440788848944038https://leetcode.com/problems/flatten-nested-list-iterator
55102Binary Tree Level Order Traversal54.6%Medium0.04369064305418892https://leetcode.com/problems/binary-tree-level-order-traversal
5613Roman to Integer55.7%Easy0.04121346863130292https://leetcode.com/problems/roman-to-integer
57101Symmetric Tree46.8%Easy0.04094139037736073https://leetcode.com/problems/symmetric-tree
5888Merge Sorted Array39.4%Easy0.0362653520190164https://leetcode.com/problems/merge-sorted-array
5920Valid Parentheses39.0%Easy0.03618871742239114https://leetcode.com/problems/valid-parentheses
60367Valid Perfect Square41.7%Easy0.03342308879149537https://leetcode.com/problems/valid-perfect-square
61460LFU Cache34.2%Hard0.030962225603966897https://leetcode.com/problems/lfu-cache
6275Sort Colors47.3%Medium0.030801991570373215https://leetcode.com/problems/sort-colors
63796Rotate String49.6%Easy0.02701041988276247https://leetcode.com/problems/rotate-string
64205Isomorphic Strings39.8%Easy0.025789394882914186https://leetcode.com/problems/isomorphic-strings
6547Permutations II46.4%Medium0.021635459295878245https://leetcode.com/problems/permutations-ii
66236Lowest Common Ancestor of a Binary Tree45.7%Medium0.018724947332324816https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
67706Design HashMap61.3%Easy0.01752893260576219https://leetcode.com/problems/design-hashmap
6850Pow(x;n)30.3%Medium0.017036779497025166https://leetcode.com/problems/powx-n
69349Intersection of Two Arrays62.5%Easy0.016239981598488416https://leetcode.com/problems/intersection-of-two-arrays
70350Intersection of Two Arrays II51.4%Easy0.01168540951877908https://leetcode.com/problems/intersection-of-two-arrays-ii
71987Vertical Order Traversal of a Binary Tree36.6%Medium0.011601058182762062https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree
7269Sqrt(x)33.9%Easy0.011443227222342794https://leetcode.com/problems/sqrtx
73785Is Graph Bipartite?47.5%Medium0.011236073266925854https://leetcode.com/problems/is-graph-bipartite
7440Combination Sum II48.2%Medium0.009578617297069781https://leetcode.com/problems/combination-sum-ii
75173Binary Search Tree Iterator56.6%Medium0.008489015324911316https://leetcode.com/problems/binary-search-tree-iterator
76200Number of Islands46.8%Medium0.006490251382779317https://leetcode.com/problems/number-of-islands
77973K Closest Points to Origin63.8%Medium0.005773688094426333https://leetcode.com/problems/k-closest-points-to-origin
7839Combination Sum56.1%Medium0.005715934396440999https://leetcode.com/problems/combination-sum
7921Merge Two Sorted Lists53.5%Easy0.005067007800877041https://leetcode.com/problems/merge-two-sorted-lists
80207Course Schedule43.1%Medium0.004964021114211758https://leetcode.com/problems/course-schedule
81160Intersection of Two Linked Lists40.6%Easy0.004901369939720486https://leetcode.com/problems/intersection-of-two-linked-lists
82146LRU Cache33.2%Medium0.004600353139061353https://leetcode.com/problems/lru-cache
83387First Unique Character in a String53.4%Easy0.00418541994270691https://leetcode.com/problems/first-unique-character-in-a-string
8423Merge k Sorted Lists40.2%Hard0.004051459000748015https://leetcode.com/problems/merge-k-sorted-lists
858String to Integer (atoi)15.4%Medium0.0037925521897059712https://leetcode.com/problems/string-to-integer-atoi
86198House Robber42.0%Easy0.0037576371128333645https://leetcode.com/problems/house-robber
871Two Sum45.6%Easy0.00184543512358731https://leetcode.com/problems/two-sum
88103Binary Tree Zigzag Level Order Traversal48.3%Medium0.0017084529846397953https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal
8970Climbing Stairs47.8%Easy0.0015084665529624085https://leetcode.com/problems/climbing-stairs