Files
LeetCode-Questions-CompanyWise/cisco_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.5 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
21290Convert Binary Number in a Linked List to Integer80.4%Easy0.1661053170661279https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer
33Longest Substring Without Repeating Characters30.4%Medium0.14469274653374686https://leetcode.com/problems/longest-substring-without-repeating-characters
4394Decode String50.0%Medium0.1232801760013658https://leetcode.com/problems/decode-string
556Merge Intervals39.3%Medium0.11799561042069451https://leetcode.com/problems/merge-intervals
6247Strobogrammatic Number II47.6%Medium0.1040197878075301https://leetcode.com/problems/strobogrammatic-number-ii
71235Maximum Profit in Job Scheduling44.0%Hard0.08907963005368878https://leetcode.com/problems/maximum-profit-in-job-scheduling
81Two Sum45.6%Easy0.08664530282302181https://leetcode.com/problems/two-sum
9909Snakes and Ladders38.4%Medium0.08392620769993404https://leetcode.com/problems/snakes-and-ladders
10198House Robber42.0%Easy0.07346911266426392https://leetcode.com/problems/house-robber
11246Strobogrammatic Number45.0%Easy0.07180116605580686https://leetcode.com/problems/strobogrammatic-number
12146LRU Cache33.2%Medium0.07118067822062889https://leetcode.com/problems/lru-cache
135Longest Palindromic Substring29.5%Medium0.0667502613531191https://leetcode.com/problems/longest-palindromic-substring
1453Maximum Subarray46.5%Easy0.052816160704876255https://leetcode.com/problems/maximum-subarray
15206Reverse Linked List62.5%Easy0.046346967254127305https://leetcode.com/problems/reverse-linked-list
1648Rotate Image56.7%Medium0.04495138786226632https://leetcode.com/problems/rotate-image
1725Reverse Nodes in k-Group42.1%Hard0.040236757867738004https://leetcode.com/problems/reverse-nodes-in-k-group
18241Different Ways to Add Parentheses55.2%Medium0.03880215185647971https://leetcode.com/problems/different-ways-to-add-parentheses
19905Sort Array By Parity74.1%Easy0.03787434929243582https://leetcode.com/problems/sort-array-by-parity
20628Maximum Product of Three Numbers47.1%Easy0.03681397312271631https://leetcode.com/problems/maximum-product-of-three-numbers
2191Decode Ways24.7%Medium0.03673102791879485https://leetcode.com/problems/decode-ways
2220Valid Parentheses39.0%Easy0.03618871742239114https://leetcode.com/problems/valid-parentheses
23468Validate IP Address24.1%Medium0.0344861760711693https://leetcode.com/problems/validate-ip-address
242Add Two Numbers33.9%Medium0.033650830145699084https://leetcode.com/problems/add-two-numbers
25102Binary Tree Level Order Traversal54.6%Medium0.03228400889291332https://leetcode.com/problems/binary-tree-level-order-traversal
2688Merge Sorted Array39.4%Easy0.02677137871391415https://leetcode.com/problems/merge-sorted-array
2754Spiral Matrix34.1%Medium0.02611966966892215https://leetcode.com/problems/spiral-matrix
28143Reorder List37.1%Medium0.025870945598649286https://leetcode.com/problems/reorder-list
29605Can Place Flowers31.6%Easy0.02457126073050533https://leetcode.com/problems/can-place-flowers
3033Search in Rotated Sorted Array34.5%Medium0.0200182839715896https://leetcode.com/problems/search-in-rotated-sorted-array
31450Delete Node in a BST43.1%Medium0.018536211907915243https://leetcode.com/problems/delete-node-in-a-bst
32235Lowest Common Ancestor of a Binary Search Tree49.9%Easy0.018394142155974434https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree
33253Meeting Rooms II45.7%Medium0.018087309810579388https://leetcode.com/problems/meeting-rooms-ii
34200Number of Islands46.8%Medium0.017925481766054456https://leetcode.com/problems/number-of-islands
35191Number of 1 Bits49.8%Easy0.01673523624045844https://leetcode.com/problems/number-of-1-bits
36189Rotate Array34.7%Easy0.016022774188122292https://leetcode.com/problems/rotate-array
37384Shuffle an Array52.8%Medium0.015250009609723824https://leetcode.com/problems/shuffle-an-array
388String to Integer (atoi)15.4%Medium0.015084664273571906https://leetcode.com/problems/string-to-integer-atoi
3921Merge Two Sorted Lists53.5%Easy0.014012111332134735https://leetcode.com/problems/merge-two-sorted-lists
40144Binary Tree Preorder Traversal55.7%Medium0.013667638728663807https://leetcode.com/problems/binary-tree-preorder-traversal
41344Reverse String68.5%Easy0.013014662307854044https://leetcode.com/problems/reverse-string
42445Add Two Numbers II54.5%Medium0.01233061245747872https://leetcode.com/problems/add-two-numbers-ii
43234Palindrome Linked List39.3%Easy0.010171877938733932https://leetcode.com/problems/palindrome-linked-list
44739Daily Temperatures63.3%Medium0.010032690121814417https://leetcode.com/problems/daily-temperatures
45212Word Search II34.9%Hard0.009845021678804893https://leetcode.com/problems/word-search-ii
4622Generate Parentheses62.7%Medium0.009785877810632554https://leetcode.com/problems/generate-parentheses
47279Perfect Squares47.4%Medium0.009216655104924008https://leetcode.com/problems/perfect-squares
48125Valid Palindrome36.7%Easy0.008933948641551634https://leetcode.com/problems/valid-palindrome
4949Group Anagrams56.9%Medium0.008538951314232168https://leetcode.com/problems/group-anagrams
50173Binary Search Tree Iterator56.6%Medium0.008489015324911316https://leetcode.com/problems/binary-search-tree-iterator
51876Middle of the Linked List68.4%Easy0.007624893975696915https://leetcode.com/problems/middle-of-the-linked-list
5214Longest Common Prefix35.4%Easy0.00745530292090591https://leetcode.com/problems/longest-common-prefix
53412Fizz Buzz62.3%Easy0.007165921026143679https://leetcode.com/problems/fizz-buzz
54110Balanced Binary Tree43.5%Easy0.007027435807456887https://leetcode.com/problems/balanced-binary-tree
55151Reverse Words in a String21.9%Medium0.0061359296669270605https://leetcode.com/problems/reverse-words-in-a-string
56108Convert Sorted Array to Binary Search Tree57.9%Easy0.005554027051374908https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree
57237Delete Node in a Linked List63.8%Easy0.005144705881237697https://leetcode.com/problems/delete-node-in-a-linked-list
58207Course Schedule43.1%Medium0.004964021114211758https://leetcode.com/problems/course-schedule
59160Intersection of Two Linked Lists40.6%Easy0.004901369939720486https://leetcode.com/problems/intersection-of-two-linked-lists
6017Letter Combinations of a Phone Number46.8%Medium0.0044018999217624675https://leetcode.com/problems/letter-combinations-of-a-phone-number
6146Permutations63.5%Medium0.004216302230139218https://leetcode.com/problems/permutations
627Reverse Integer25.8%Easy0.00418293972984512https://leetcode.com/problems/reverse-integer
63242Valid Anagram56.9%Easy0.004154123743115972https://leetcode.com/problems/valid-anagram
6423Merge k Sorted Lists40.2%Hard0.004051459000748015https://leetcode.com/problems/merge-k-sorted-lists
65141Linked List Cycle41.1%Easy0.0034937584669245472https://leetcode.com/problems/linked-list-cycle
6619Remove Nth Node From End of List35.2%Medium0.003076452203393495https://leetcode.com/problems/remove-nth-node-from-end-of-list
67153Sum26.8%Medium0.0021990113314367685https://leetcode.com/problems/3sum
68121Best Time to Buy and Sell Stock50.5%Easy0.0021239321954525975https://leetcode.com/problems/best-time-to-buy-and-sell-stock
6926Remove Duplicates from Sorted Array45.1%Easy0.0019513153174351963https://leetcode.com/problems/remove-duplicates-from-sorted-array