mirror of
https://github.com/McSmog/LeetCode-Questions-CompanyWise.git
synced 2026-04-19 16:56:45 +00:00
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)
```
This commit is contained in:
committed by
GitHub
parent
0aeadbd612
commit
fb5f78b55e
@@ -1,38 +1,39 @@
|
||||
1052,Grumpy Bookstore Owner,55.4%,Medium,0.8402346949345842, https://leetcode.com/problems/grumpy-bookstore-owner
|
||||
991,Broken Calculator,45.6%,Medium,0.7270526032311205, https://leetcode.com/problems/broken-calculator
|
||||
45,Jump Game II,30.6%,Hard,0.5749144034972855, https://leetcode.com/problems/jump-game-ii
|
||||
457,Circular Array Loop,29.4%,Medium,0.4310822724784647, https://leetcode.com/problems/circular-array-loop
|
||||
403,Frog Jump,39.7%,Hard,0.2789440727446297, https://leetcode.com/problems/frog-jump
|
||||
402,Remove K Digits,28.4%,Medium,0.24067603007585034, https://leetcode.com/problems/remove-k-digits
|
||||
826,Most Profit Assigning Work,38.5%,Medium,0.09287412500644375, https://leetcode.com/problems/most-profit-assigning-work
|
||||
564,Find the Closest Palindrome,19.7%,Hard,0.0840831172105414, https://leetcode.com/problems/find-the-closest-palindrome
|
||||
316,Remove Duplicate Letters,35.8%,Hard,0.067239661116769, https://leetcode.com/problems/remove-duplicate-letters
|
||||
202,Happy Number,50.4%,Easy,0.05503451923624455, https://leetcode.com/problems/happy-number
|
||||
33,Search in Rotated Sorted Array,34.5%,Medium,0.05046797817178903, https://leetcode.com/problems/search-in-rotated-sorted-array
|
||||
273,Integer to English Words,27.1%,Hard,0.04747257415466348, https://leetcode.com/problems/integer-to-english-words
|
||||
238,Product of Array Except Self,60.1%,Medium,0.04711503937510501, https://leetcode.com/problems/product-of-array-except-self
|
||||
253,Meeting Rooms II,45.7%,Medium,0.03193246767820989, https://leetcode.com/problems/meeting-rooms-ii
|
||||
703,Kth Largest Element in a Stream,49.7%,Easy,0.031004894819414507, https://leetcode.com/problems/kth-largest-element-in-a-stream
|
||||
146,LRU Cache,33.2%,Medium,0.028411001832779885, https://leetcode.com/problems/lru-cache
|
||||
40,Combination Sum II,48.2%,Medium,0.021424290044083395, https://leetcode.com/problems/combination-sum-ii
|
||||
128,Longest Consecutive Sequence,45.1%,Hard,0.020252717433212362, https://leetcode.com/problems/longest-consecutive-sequence
|
||||
55,Jump Game,34.6%,Medium,0.01994084020351079, https://leetcode.com/problems/jump-game
|
||||
200,Number of Islands,46.8%,Medium,0.017925481766054456, https://leetcode.com/problems/number-of-islands
|
||||
239,Sliding Window Maximum,43.0%,Hard,0.01768566434627554, https://leetcode.com/problems/sliding-window-maximum
|
||||
17,Letter Combinations of a Phone Number,46.8%,Medium,0.017492519932499718, https://leetcode.com/problems/letter-combinations-of-a-phone-number
|
||||
116,Populating Next Right Pointers in Each Node,45.2%,Medium,0.016432723251567683, https://leetcode.com/problems/populating-next-right-pointers-in-each-node
|
||||
977,Squares of a Sorted Array,72.1%,Easy,0.015474196582597383, https://leetcode.com/problems/squares-of-a-sorted-array
|
||||
621,Task Scheduler,50.1%,Medium,0.014546980601820143, https://leetcode.com/problems/task-scheduler
|
||||
76,Minimum Window Substring,34.6%,Hard,0.013966707481708198, https://leetcode.com/problems/minimum-window-substring
|
||||
138,Copy List with Random Pointer,36.4%,Medium,0.013876263355766411, https://leetcode.com/problems/copy-list-with-random-pointer
|
||||
210,Course Schedule II,40.7%,Medium,0.011869857339029215, https://leetcode.com/problems/course-schedule-ii
|
||||
283,Move Zeroes,57.8%,Easy,0.01149190266804209, https://leetcode.com/problems/move-zeroes
|
||||
207,Course Schedule,43.1%,Medium,0.01113459480911671, https://leetcode.com/problems/course-schedule
|
||||
234,Palindrome Linked List,39.3%,Easy,0.010171877938733932, https://leetcode.com/problems/palindrome-linked-list
|
||||
22,Generate Parentheses,62.7%,Medium,0.009785877810632554, https://leetcode.com/problems/generate-parentheses
|
||||
208,Implement Trie (Prefix Tree),49.4%,Medium,0.009105457856626612, https://leetcode.com/problems/implement-trie-prefix-tree
|
||||
5,Longest Palindromic Substring,29.5%,Medium,0.005121212968082452, https://leetcode.com/problems/longest-palindromic-substring
|
||||
49,Group Anagrams,56.9%,Medium,0.0038040939835560453, https://leetcode.com/problems/group-anagrams
|
||||
1003,Check If Word Is Valid After Substitutions,55.3%,Medium,0, https://leetcode.com/problems/check-if-word-is-valid-after-substitutions
|
||||
1156,Swap For Longest Repeated Character Substring,49.0%,Medium,0, https://leetcode.com/problems/swap-for-longest-repeated-character-substring
|
||||
1157,Online Majority Element In Subarray,39.0%,Hard,0, https://leetcode.com/problems/online-majority-element-in-subarray
|
||||
ID,Title,Acceptance,Difficulty,Frequency,Leetcode Question Link
|
||||
1052,Grumpy Bookstore Owner,55.4%,Medium,0.8402346949345842, https://leetcode.com/problems/grumpy-bookstore-owner
|
||||
991,Broken Calculator,45.6%,Medium,0.7270526032311205, https://leetcode.com/problems/broken-calculator
|
||||
45,Jump Game II,30.6%,Hard,0.5749144034972855, https://leetcode.com/problems/jump-game-ii
|
||||
457,Circular Array Loop,29.4%,Medium,0.4310822724784647, https://leetcode.com/problems/circular-array-loop
|
||||
403,Frog Jump,39.7%,Hard,0.2789440727446297, https://leetcode.com/problems/frog-jump
|
||||
402,Remove K Digits,28.4%,Medium,0.24067603007585034, https://leetcode.com/problems/remove-k-digits
|
||||
826,Most Profit Assigning Work,38.5%,Medium,0.09287412500644375, https://leetcode.com/problems/most-profit-assigning-work
|
||||
564,Find the Closest Palindrome,19.7%,Hard,0.0840831172105414, https://leetcode.com/problems/find-the-closest-palindrome
|
||||
316,Remove Duplicate Letters,35.8%,Hard,0.067239661116769, https://leetcode.com/problems/remove-duplicate-letters
|
||||
202,Happy Number,50.4%,Easy,0.05503451923624455, https://leetcode.com/problems/happy-number
|
||||
33,Search in Rotated Sorted Array,34.5%,Medium,0.05046797817178903, https://leetcode.com/problems/search-in-rotated-sorted-array
|
||||
273,Integer to English Words,27.1%,Hard,0.04747257415466348, https://leetcode.com/problems/integer-to-english-words
|
||||
238,Product of Array Except Self,60.1%,Medium,0.04711503937510501, https://leetcode.com/problems/product-of-array-except-self
|
||||
253,Meeting Rooms II,45.7%,Medium,0.03193246767820989, https://leetcode.com/problems/meeting-rooms-ii
|
||||
703,Kth Largest Element in a Stream,49.7%,Easy,0.031004894819414507, https://leetcode.com/problems/kth-largest-element-in-a-stream
|
||||
146,LRU Cache,33.2%,Medium,0.028411001832779885, https://leetcode.com/problems/lru-cache
|
||||
40,Combination Sum II,48.2%,Medium,0.021424290044083395, https://leetcode.com/problems/combination-sum-ii
|
||||
128,Longest Consecutive Sequence,45.1%,Hard,0.020252717433212362, https://leetcode.com/problems/longest-consecutive-sequence
|
||||
55,Jump Game,34.6%,Medium,0.01994084020351079, https://leetcode.com/problems/jump-game
|
||||
200,Number of Islands,46.8%,Medium,0.017925481766054456, https://leetcode.com/problems/number-of-islands
|
||||
239,Sliding Window Maximum,43.0%,Hard,0.01768566434627554, https://leetcode.com/problems/sliding-window-maximum
|
||||
17,Letter Combinations of a Phone Number,46.8%,Medium,0.017492519932499718, https://leetcode.com/problems/letter-combinations-of-a-phone-number
|
||||
116,Populating Next Right Pointers in Each Node,45.2%,Medium,0.016432723251567683, https://leetcode.com/problems/populating-next-right-pointers-in-each-node
|
||||
977,Squares of a Sorted Array,72.1%,Easy,0.015474196582597383, https://leetcode.com/problems/squares-of-a-sorted-array
|
||||
621,Task Scheduler,50.1%,Medium,0.014546980601820143, https://leetcode.com/problems/task-scheduler
|
||||
76,Minimum Window Substring,34.6%,Hard,0.013966707481708198, https://leetcode.com/problems/minimum-window-substring
|
||||
138,Copy List with Random Pointer,36.4%,Medium,0.013876263355766411, https://leetcode.com/problems/copy-list-with-random-pointer
|
||||
210,Course Schedule II,40.7%,Medium,0.011869857339029215, https://leetcode.com/problems/course-schedule-ii
|
||||
283,Move Zeroes,57.8%,Easy,0.01149190266804209, https://leetcode.com/problems/move-zeroes
|
||||
207,Course Schedule,43.1%,Medium,0.01113459480911671, https://leetcode.com/problems/course-schedule
|
||||
234,Palindrome Linked List,39.3%,Easy,0.010171877938733932, https://leetcode.com/problems/palindrome-linked-list
|
||||
22,Generate Parentheses,62.7%,Medium,0.009785877810632554, https://leetcode.com/problems/generate-parentheses
|
||||
208,Implement Trie (Prefix Tree),49.4%,Medium,0.009105457856626612, https://leetcode.com/problems/implement-trie-prefix-tree
|
||||
5,Longest Palindromic Substring,29.5%,Medium,0.005121212968082452, https://leetcode.com/problems/longest-palindromic-substring
|
||||
49,Group Anagrams,56.9%,Medium,0.0038040939835560453, https://leetcode.com/problems/group-anagrams
|
||||
1003,Check If Word Is Valid After Substitutions,55.3%,Medium,0, https://leetcode.com/problems/check-if-word-is-valid-after-substitutions
|
||||
1156,Swap For Longest Repeated Character Substring,49.0%,Medium,0, https://leetcode.com/problems/swap-for-longest-repeated-character-substring
|
||||
1157,Online Majority Element In Subarray,39.0%,Hard,0, https://leetcode.com/problems/online-majority-element-in-subarray
|
||||
|
||||
|
Reference in New Issue
Block a user