Hedwig Explains

A healthy mind is an inquisitive mind

Merge Sorted Array

DSA Solving and practicing

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 import "sort" func merge(nums1 []int, m int, nums2 []int, n int) { if m == 0 && n == 1{ nums1[0] = nums2[0] } ...

Intersection of Two Arrays II

DSA Solving and practicing

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 func intersect(nums1 []int, nums2 []int) []int { intersection1 := []int{} mapforone := make(map[int]int) for i := 0; i < len(num...

Two Sum

DSA Solving and practicing

1 2 3 4 5 6 7 8 9 10 11 12 13 func twoSum(nums []int, target int) []int { indexMap := make(map[int]int) for currIndex, currNum := range nums { if requiredIdx, isPresent := indexMap[target-curr...

Maximum Subarray

DSA Solving and practicing

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 func maxSubArray(nums []int) int { currSum := 0 maxSum := -99999 for idx, _ := range nums { currSum += nums[idx] i...

Contains Duplicate

DSA Solving and practicing

My First Try : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 import "sort" func containsDuplicate(nums []int) bool { sort.Slice(nums, func(i, j int) bool { return nums[i] < nums...

[Ch-2] The Element of Computing System - Solution

Solving and practicing

Chapter 2 - Boolean Arithmetic 1 2 Counting is the religion of this generation, its hope and salvation. ~ Gertrude Stein Implementations : Half Adder : 1...

Blockchain prerequisites (PART 1)

Glimpsing the world of blockchain

Blockchain prerequisites (PART 1) : Public Key Cryptography : If you stumbled on the term for the first time. You have my sympathy ~ Lol no. Kidding. So without anymore pain lets get started. In ...

A Concept and Code Beginner's Guide to CRC

Understanding and implmenting CRC code

Why CRC ? CRC stands for Cyclic Redundancy Check. When sending a sequence of bits from point A -> point B. We use CRC to check weather it arrived with or without error in any possible case. CRC...

[Go] A tutorial on go-rpi-rgb-led-matrix

Going through an excellent github repo

Brief : In this blog, we will be diving in an excellent github repo. Which allows us to control RGB LED display. I will explain, how to setup the environment and code on your machine. Basically, a...

[Book] Atomic Habits (Chapter One) : The Surpise Power of Atomic Habits

Atomic Habits Chapter 1 Summary

Brief : Author in the first chapter of the book discuss alot key points. He starts by sharing his life experience, near death life experience. Where he was critically injured and on the process of...