У нас вы можете посмотреть бесплатно 4 Top 50 Leetcode | 1148 Article Views I | SQL | Cognizant | или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
🔥 LeetCode SQL 1148 – Article Views I | Full Explanation + Best SQL Solution 🔥 👉 Solve this real interview question in under 2 minutes! 🔗 LeetCode Problem Link: https://leetcode.com/problems/article... 🔗 For Notes Visit PadhoIndia: https://padho-india.vercel.app/ 🧠 Problem Description You are given a table named Views with the following columns: article_id – ID of the article author_id – ID of who wrote it viewer_id – ID of who viewed it view_date – date of view Each row shows someone viewing an article. Your task is to find all authors who have viewed at least one of their own articles — i.e., where the author and the viewer are the same person — and return the list sorted by id in ascending order. 💡 Best SQL Algorithm (with Explanation) Here’s the most concise, efficient SQL solution: SELECT DISTINCT author_id AS id FROM Views WHERE author_id = viewer_id ORDER BY id ASC; ✔ What this does: 1️⃣ WHERE author_id = viewer_id → Filters rows where the author viewed their own article. 2️⃣ SELECT DISTINCT author_id → Ensures each author appears only once. 3️⃣ ORDER BY id ASC → Sorts the result by author ID. 📊 Time & Space Complexity 🕒 Time: O(n) — scanning all rows once 🧠 Space: O(k) — storing unique authors where k ≤ n 🚀 Why This Works Self-views are when an author looks at their own article. Using DISTINCT removes duplicates. Straightforward SQL makes this interview-friendly. 💥 Keywords / #Tags (Make It Viral) #LeetCode #SQL #SQL50 #Database #InterviewPrep #TechInterview #MySQL #ArticleViews #LearnSQL #CodingChallenge #DataAnalyst #PadhoIndia#SQL #LeetCode #LeetCodeSQL #BigCountries #Top50LeetCode #SQLInterview #SQLQueries #Cognizant #Infosys #TCS #Wipro #Accenture #DBMS #Database #TechInterviewPrep #CampusPlacement #FreshersJobs #padhoindia #InterviewPreparation #PlacementPreparation #CodingInterview #SQLForFreshers #LearnSQL #TechPlacement #ITJobs #OffCampusDrive #CampusHiring #MNCJobs #FAANGInterview #DataEngineer #DataAnalytics #BackendDeveloper #ProgrammingCommunity #StudyMotivation #2025Placements #EdTech #ViralVideo #YoutubeShorts #LearnWithMe #SkillIndia #ComptetitiveProgramming #TechSkills #databasemanagement #SQL #LeetCode #BigCountries #SQLInterview #InterviewPreparation #PlacementPreparation #CodingInterview #TechInterviewPrep #CampusPlacement #FreshersJobs #Database #DBMS #StudyMotivation #LearnSQL #EdTech