Leetcode 177 - Nth Highest Salary - Python Solution | FAANG Interviews

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024
  • 📚 Resources:
    - Question: leetcode.com/p...
    - Leetcode SQL Playlist: • Leetcode SQL
    - Leetcode SQL solution: • LeetCode Medium 177 "N...
    - Pandas Schema:
    data = [[1, 100], [2, 200], [3, 300]]
    employee = pd.DataFrame(data, columns=['Id', 'Salary']).astype({'Id':'Int64', 'Salary':'Int64'})
    In this exciting video, we dive headfirst into the world of FAANG interviews, armed with Python and the powerful Pandas library for data science! 🚀
    Join me on this thrilling journey as we tackle some of the most challenging and sought-after interview questions asked by FAANG companies like Facebook, Apple, Amazon, Netflix, and Google. Whether you're a seasoned data scientist or just getting started, this video has something for everyone.
    🧠 What You'll Learn:
    - Step-by-step solutions to real FAANG interview questions.
    - Python and Pandas techniques tailored for data science.
    - Insider tips and strategies to ace your FAANG interview.
    📈 Boost Your Career: Mastering these questions not only prepares you for FAANG interviews but also equips you with valuable skills for your data science career. Plus, you'll be better equipped to excel in technical interviews across the tech industry.
    🔥 Why Watch? This video is your one-stop-shop for conquering FAANG interviews with Python and Pandas. We break down complex problems into easy-to-understand solutions, so you can build confidence and excel in your next technical interview.
    🚨 Don't Miss Out!
    Hit that "Subscribe" button and ring the notification bell to stay updated with our latest content. Like, share, and comment to let us know which FAANG interview questions you'd like us to cover next.
    👨‍💻 Let's Connect: Follow me on social media to stay connected and join our growing community of tech enthusiasts. / everydaydatascience
    Ready to conquer FAANG interviews with Python and Pandas? Let's get started! 💪🐍📊 #FAANGinterviews #datascience #leetcode #TechInterviews #CareerSuccess #Python #Pandas

ความคิดเห็น • 1

  • @nothuman8989
    @nothuman8989 3 หลายเดือนก่อน

    import pandas as pd
    def nth_highest_salary(employee: pd.DataFrame, N: int) -> pd.DataFrame:
    employee.sort_values(by='salary',ascending=True,inplace=True)
    employee['rank'] = employee['salary'].rank(method='dense',ascending=False)
    df = employee.drop_duplicates(subset='rank',keep='first')
    df1 = df[df['rank']==N]
    return pd.DataFrame({'getNthHighestSalary({})'.format(N):[None if len(df1)==0 else df1['salary'].iloc[0]]})