Skip to content

Instantly share code, notes, and snippets.

@vivek781113
vivek781113 / grokking_to_leetcode.md
Created August 7, 2023 05:01 — forked from tykurtz/grokking_to_leetcode.md
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

WITH cte as
(
select *,
ROW_NUMBER() OVER(PARTITION BY CITY ORDER BY CITY)/4 + 1 RN
FROM EmpDetails
)
SELECT c.city,
STRING_AGG(c.empname, ',') WITHIN GROUP (ORDER BY c.empname),
CONCAT('Team ', ROW_NUMBER() OVER (ORDER BY c.city)) TeamId
FROM CTE c
@vivek781113
vivek781113 / Program.cs
Last active December 5, 2021 09:25
Hackerrank_Promblems_Asked
#region problem asked in vm ware :
public class TicTacToe
{
public (bool, List<(int, int)>) CheckWinner(int[][] b)
{
List<List<(int, int)>> winCombos = GetWinningOrdinates();
foreach (var wc in winCombos)
{
public string Getpath(string filename) => Path.GetRelativePath(Directory.GetCurrentDirectory(), $"Data\\Logs\\{filename}")
public void Read(string file)
{
string line;
using (var reader = new StreamReader(file))
{
line = reader.ReadLine();
while (line != null)
{
We couldn’t find that file to show.
@vivek781113
vivek781113 / SortingAlgo.cs
Last active November 12, 2021 13:22
CSharpGist
public class SortAlgorithm
{
/*
* Below for loop is alog for build heap
* FOR (N/2-1) TO 0 <= Range of internal nodes
* HEAPIFIY(arr, i)
*/
public void BuildMaxHeap(int[] arr)
{