Posts

Longest String in a list

𝗗𝗮𝘁𝗮 𝗘𝗻𝗴𝗶𝗻𝗲𝗲𝗿𝗶𝗻𝗴 𝗝𝗼𝘂𝗿𝗻𝗲𝘆: 📢 𝗗𝗮𝘁𝗮𝗘𝗻𝗴𝗶𝗻𝗲𝗲𝗿𝗶𝗻𝗴--𝗣𝘆𝘁𝗵𝗼𝗻 🚩𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻 🚀 ''' 𝗚𝗶𝘃𝗲𝗻 𝗮 𝗹𝗶𝘀𝘁 𝗼𝗳 𝗻𝗮𝗺𝗲𝘀, 𝗱𝗶𝘀𝗽𝗹𝗮𝘆 𝘁𝗵𝗲 𝗹𝗼𝗻𝗴𝗲𝘀𝘁 𝗻𝗮𝗺𝗲. 𝗜𝗳 𝘁𝗵𝗲𝗿𝗲 𝗮𝗿𝗲 𝗺𝘂𝗹𝘁𝗶𝗽𝗹𝗲 𝗻𝗮𝗺𝗲𝘀 𝗼𝗳 𝘁𝗵𝗲 𝗹𝗼𝗻𝗴𝗲𝘀𝘁 𝘀𝗶𝘇𝗲 𝘁𝗵𝗲𝗻 𝗿𝗲𝘁𝘂𝗿𝗻 𝘁𝗵𝗲 𝗳𝗶𝗿𝘀𝘁 𝗼𝗰𝗰𝘂𝗿𝗿𝗶𝗻𝗴 𝗻𝗮𝗺𝗲 . names = { "Geek", "Geeks", "Geeksfor", "GeeksforGeek", "GeeksforGeeks" } Output: GeeksforGeeks Explanation: name "GeeksforGeeks" has maximum length among all name ''' ---------------------------------------------------------------------------- 📌𝗔𝗽𝗽𝗿𝗼𝗮𝗰𝗵 𝟭 def longest(names): # code here name_list=list(set(names)) len_ele=[] for i in name_list: len_ele.append(len(i)) name_zdict=dict(zip(len_ele,name_list)) return max(name_zdict.items()) 📌𝗔𝗽𝗽𝗿𝗼𝗮𝗰𝗵 𝟮 #Method 3: Iterat...

𝗥𝗲𝘃𝗲𝗿𝘀𝗲 𝘃𝗼𝘄𝗲𝗹𝘀 𝗶𝗻 𝗮 𝗴𝗶𝘃𝗲𝗻 𝘀𝘁𝗿𝗶𝗻𝗴

📢 𝗗𝗮𝘁𝗮𝗘𝗻𝗴𝗶𝗻𝗲𝗲𝗿𝗶𝗻𝗴--𝗣𝘆𝘁𝗵𝗼𝗻 🚩𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻-1 🚀 ''' 𝗥𝗲𝘃𝗲𝗿𝘀𝗲 𝘃𝗼𝘄𝗲𝗹𝘀 𝗶𝗻 𝗮 𝗴𝗶𝘃𝗲𝗻 𝘀𝘁𝗿𝗶𝗻𝗴 Input= "hello world". output= "holeo wlrld". ''' ---------------------------------------------------------------------------- 📌𝗔𝗽𝗽𝗿𝗼𝗮𝗰𝗵 𝟭 def isVowel(c):   return c in 'aeiouAEIOU' def reverseVowel(s):   s = list(s) # Convert string to list   i = 0   j = len(s) - 1   while i < j:     if not isVowel(s[i]):       i += 1       continue     if not isVowel(s[j]):       j -= 1       continue     s[i], s[j] = s[j], s[i]     i += 1     j -= 1   return ''.join(s) # Convert list back to string

Parquet Architecture and Internals

Image
Apache Parquet is a game-changer in the world of big data processing and analytics. Unlike traditional row-based formats like CSV or JSON, Parquet stores data in a columnar format. This means each column's values are stored together, enabling super-efficient compression, encoding, and data processing. Why Parquet? 🔹 Efficient Storage : Columnar format means better compression and reduced storage costs. 🔹 Faster Queries : Only read the columns you need, speeding up query performance. 🔹 Optimized for OLAP : Supports both projection (selecting columns) and predicates (row selection criteria), perfect for complex analytical workflows.   Minimize image Edit image Delete image We’ll delve into the intricate details of how Parquet files are structured, how metadata and data pages are organized, and why concepts like dictionary encoding and predicate pushdown play a crucial role in optimizing data storage and query performance. Structure of Parquet Files: Parquet files are organized in ...