Skip to content

Instantly share code, notes, and snippets.

View georgebullock's full-sized avatar
📈
Always leveling up

George Bullock georgebullock

📈
Always leveling up
View GitHub Profile
@georgebullock
georgebullock / window_sliding_in_javascript.js
Created January 28, 2023 12:14 — forked from scaryguy/window_sliding_in_javascript.js
Window Sliding Technique in JavaScript
// This gist is for my YouTube video which I tried to explain Window Sliding Technique.
// You can watch it from here: https://youtu.be/ZlnZkfEcbxs
//
// Given an array of integers of size ‘n’. Calculate the maximum sum possible
// for ‘k’ consecutive elements in the array.
//
// Input : [10, 20, 30, 40, 50, 60, 70]
//
// k = 3
// Output : 180
@georgebullock
georgebullock / two_pointers.js
Created January 28, 2023 12:13 — forked from scaryguy/two_pointers.js
Two Pointers Technique (in JavaScript)
// This gist is for my YouTube video which I tried to explain Window Sliding Technique.
// You can watch it from here: https://youtu.be/guDU5HnLqAs
// Given a sorted array A (sorted in ascending order), having N integers,
// find if there exists any pair of elements (A[i], A[j]) such that
// their sum is equal to X.
//
// Input: A = [2,3,4,5,6,7,8,9], k= 10
// Output: true
// NOTE: We slightly changed the question and the output in the video. We're returning pair indexes as an array.
@georgebullock
georgebullock / clean_code.md
Created November 11, 2020 07:18 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules