LeetCode-Questions-CompanyWise/yandex_alltime.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.1 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2146LRU Cache33.2%Medium0.46080211052317804https://leetcode.com/problems/lru-cache
3228Summary Ranges39.5%Medium0.44217848445366176https://leetcode.com/problems/summary-ranges
4206Reverse Linked List62.5%Easy0.44193222040156394https://leetcode.com/problems/reverse-linked-list
5125Valid Palindrome36.7%Easy0.3787282969631441https://leetcode.com/problems/valid-palindrome
622Generate Parentheses62.7%Medium0.37758248966083463https://leetcode.com/problems/generate-parentheses
71Two Sum45.6%Easy0.36056657949055176https://leetcode.com/problems/two-sum
8283Move Zeroes57.8%Easy0.3588135394901179https://leetcode.com/problems/move-zeroes
920Valid Parentheses39.0%Easy0.3161359429418766https://leetcode.com/problems/valid-parentheses
1049Group Anagrams56.9%Medium0.310518994932053https://leetcode.com/problems/group-anagrams
1123Merge k Sorted Lists40.2%Hard0.24731507149363313https://leetcode.com/problems/merge-k-sorted-lists
12281Zigzag Iterator58.4%Medium0.22884157242884745https://leetcode.com/problems/zigzag-iterator
13443String Compression41.3%Easy0.19466945271128616https://leetcode.com/problems/string-compression
14560Subarray Sum Equals K43.9%Medium0.1592148659754748https://leetcode.com/problems/subarray-sum-equals-k
1556Merge Intervals39.3%Medium0.1506602748874898https://leetcode.com/problems/merge-intervals
161004Max Consecutive Ones III59.1%Medium0.14885037047435706https://leetcode.com/problems/max-consecutive-ones-iii
1798Validate Binary Search Tree27.8%Medium0.14682390140626445https://leetcode.com/problems/validate-binary-search-tree
18380Insert Delete GetRandom O(1)47.5%Medium0.13990475142949543https://leetcode.com/problems/insert-delete-getrandom-o1
19232Implement Queue using Stacks49.6%Easy0.12455784498557357https://leetcode.com/problems/implement-queue-using-stacks
20567Permutation in String44.4%Medium0.12099331128663167https://leetcode.com/problems/permutation-in-string
21487Max Consecutive Ones II48.5%Medium0.10973238837921641https://leetcode.com/problems/max-consecutive-ones-ii
2221Merge Two Sorted Lists53.5%Easy0.10062341537355711https://leetcode.com/problems/merge-two-sorted-lists
2359Spiral Matrix II53.9%Medium0.09113771199852426https://leetcode.com/problems/spiral-matrix-ii
243Longest Substring Without Repeating Characters30.4%Medium0.080294208103556https://leetcode.com/problems/longest-substring-without-repeating-characters
2542Trapping Rain Water48.9%Hard0.08028083126080282https://leetcode.com/problems/trapping-rain-water
262Add Two Numbers33.9%Medium0.07642959098535268https://leetcode.com/problems/add-two-numbers
2788Merge Sorted Array39.4%Easy0.0697535511282702https://leetcode.com/problems/merge-sorted-array
28101Symmetric Tree46.8%Easy0.06415501202452933https://leetcode.com/problems/symmetric-tree
29332Reconstruct Itinerary36.7%Medium0.05142521180743711https://leetcode.com/problems/reconstruct-itinerary
30933Number of Recent Calls71.9%Easy0.04470017891790688https://leetcode.com/problems/number-of-recent-calls
314Median of Two Sorted Arrays29.6%Hard0.032966999734600134https://leetcode.com/problems/median-of-two-sorted-arrays
32974Subarray Sums Divisible by K48.9%Medium0.03213127818279325https://leetcode.com/problems/subarray-sums-divisible-by-k
33204Count Primes31.5%Easy0.026775361248112174https://leetcode.com/problems/count-primes
345Longest Palindromic Substring29.5%Medium0.02634844326401841https://leetcode.com/problems/longest-palindromic-substring
35153Sum26.8%Medium0.025200613617298306https://leetcode.com/problems/3sum
36449Serialize and Deserialize BST52.0%Medium0.021540951371383166https://leetcode.com/problems/serialize-and-deserialize-bst
3748Rotate Image56.7%Medium0.019354662474288496https://leetcode.com/problems/rotate-image
3833Search in Rotated Sorted Array34.5%Medium0.019219533793635182https://leetcode.com/problems/search-in-rotated-sorted-array
3919Remove Nth Node From End of List35.2%Medium0.018335680533090114https://leetcode.com/problems/remove-nth-node-from-end-of-list
4071Simplify Path32.6%Medium0.015486178630494266https://leetcode.com/problems/simplify-path
41150Evaluate Reverse Polish Notation36.3%Medium0.01355493475171521https://leetcode.com/problems/evaluate-reverse-polish-notation
42350Intersection of Two Arrays II51.4%Easy0.011188580169130736https://leetcode.com/problems/intersection-of-two-arrays-ii
4334Find First and Last Position of Element in Sorted Array36.2%Medium0.00915477861600125https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
44279Perfect Squares47.4%Medium0.008781615160384712https://leetcode.com/problems/perfect-squares
4528Implement strStr()34.5%Easy0.008476223285653011https://leetcode.com/problems/implement-strstr
46163Sum Closest46.0%Medium0.00714416326666986https://leetcode.com/problems/3sum-closest
471493Longest Subarray of 1's After Deleting One Element59.7%Medium0https://leetcode.com/problems/longest-subarray-of-1s-after-deleting-one-element