Files
LeetCode-Questions-CompanyWise/yandex_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.0 KiB

1IDTitleAcceptanceDifficultyFrequencyLeetcode Question Link
2281Zigzag Iterator58.4%Medium0.15115252496881726https://leetcode.com/problems/zigzag-iterator
3283Move Zeroes57.8%Easy0.12694900267046355https://leetcode.com/problems/move-zeroes
4487Max Consecutive Ones II48.5%Medium0.10973238837921641https://leetcode.com/problems/max-consecutive-ones-ii
5125Valid Palindrome36.7%Easy0.10894995631198279https://leetcode.com/problems/valid-palindrome
649Group Anagrams56.9%Medium0.10449532583131008https://leetcode.com/problems/group-anagrams
7146LRU Cache33.2%Medium0.10391400347187969https://leetcode.com/problems/lru-cache
8206Reverse Linked List62.5%Easy0.10389040804168274https://leetcode.com/problems/reverse-linked-list
922Generate Parentheses62.7%Medium0.09896331569600633https://leetcode.com/problems/generate-parentheses
10380Insert Delete GetRandom O(1)47.5%Medium0.08108897817576358https://leetcode.com/problems/insert-delete-getrandom-o1
111004Max Consecutive Ones III59.1%Medium0.0689037012162606https://leetcode.com/problems/max-consecutive-ones-iii
12933Number of Recent Calls71.9%Easy0.04470017891790688https://leetcode.com/problems/number-of-recent-calls
1398Validate Binary Search Tree27.8%Medium0.044002423962183804https://leetcode.com/problems/validate-binary-search-tree
1456Merge Intervals39.3%Medium0.03984590854719967https://leetcode.com/problems/merge-intervals
1520Valid Parentheses39.0%Easy0.034596174971291214https://leetcode.com/problems/valid-parentheses
1621Merge Two Sorted Lists53.5%Easy0.03398256378703629https://leetcode.com/problems/merge-two-sorted-lists
1759Spiral Matrix II53.9%Medium0.03377431711860405https://leetcode.com/problems/spiral-matrix-ii
18974Subarray Sums Divisible by K48.9%Medium0.03213127818279325https://leetcode.com/problems/subarray-sums-divisible-by-k
19567Permutation in String44.4%Medium0.03164821095078173https://leetcode.com/problems/permutation-in-string
20228Summary Ranges39.5%Medium0.030145462786142038https://leetcode.com/problems/summary-ranges
21332Reconstruct Itinerary36.7%Medium0.029251354313115097https://leetcode.com/problems/reconstruct-itinerary
221Two Sum45.6%Easy0.02790770628260985https://leetcode.com/problems/two-sum
2388Merge Sorted Array39.4%Easy0.025675351340230267https://leetcode.com/problems/merge-sorted-array
24560Subarray Sum Equals K43.9%Medium0.025210571842543487https://leetcode.com/problems/subarray-sum-equals-k
2523Merge k Sorted Lists40.2%Hard0.023981964686485415https://leetcode.com/problems/merge-k-sorted-lists
26449Serialize and Deserialize BST52.0%Medium0.021540951371383166https://leetcode.com/problems/serialize-and-deserialize-bst
272Add Two Numbers33.9%Medium0.019661976799320476https://leetcode.com/problems/add-two-numbers
2871Simplify Path32.6%Medium0.015486178630494266https://leetcode.com/problems/simplify-path
29150Evaluate Reverse Polish Notation36.3%Medium0.01355493475171521https://leetcode.com/problems/evaluate-reverse-polish-notation
30443String Compression41.3%Easy0.013342426083839913https://leetcode.com/problems/string-compression
31101Symmetric Tree46.8%Easy0.013003027580387157https://leetcode.com/problems/symmetric-tree
3248Rotate Image56.7%Medium0.010933053508947611https://leetcode.com/problems/rotate-image
33232Implement Queue using Stacks49.6%Easy0.010770163342482653https://leetcode.com/problems/implement-queue-using-stacks
3442Trapping Rain Water48.9%Hard0.009245058144051103https://leetcode.com/problems/trapping-rain-water
35279Perfect Squares47.4%Medium0.008781615160384712https://leetcode.com/problems/perfect-squares
36153Sum26.8%Medium0.008298802814695094https://leetcode.com/problems/3sum
37163Sum Closest46.0%Medium0.00714416326666986https://leetcode.com/problems/3sum-closest
3833Search in Rotated Sorted Array34.5%Medium0.006961661779487692https://leetcode.com/problems/search-in-rotated-sorted-array
39204Count Primes31.5%Easy0.006761350978043845https://leetcode.com/problems/count-primes
4019Remove Nth Node From End of List35.2%Medium0.006639640769898835https://leetcode.com/problems/remove-nth-node-from-end-of-list
413Longest Substring Without Repeating Characters30.4%Medium0.005927699633275225https://leetcode.com/problems/longest-substring-without-repeating-characters
42350Intersection of Two Arrays II51.4%Easy0.004988163479138952https://leetcode.com/problems/intersection-of-two-arrays-ii
435Longest Palindromic Substring29.5%Medium0.0048918458243339055https://leetcode.com/problems/longest-palindromic-substring
4434Find First and Last Position of Element in Sorted Array36.2%Medium0.004079140879524679https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array
4528Implement strStr()34.5%Easy0.0037760830292959675https://leetcode.com/problems/implement-strstr
464Median of Two Sorted Arrays29.6%Hard0.00371713094107092https://leetcode.com/problems/median-of-two-sorted-arrays