Tag: featured

  • is DOMRect not serializing for you?

    is DOMRect not serializing for you?

    Today I was writing a playwright test that needed to do some calculations on an element’s coordinates. No problem right? Just get the DOMRect object from getBoundingClientRect and go about your day. Easy, expect that rect was an empty object. It took me a second to figure out, but it appears that DOMRect is not…

  • Code Corner: Triangles

    Code Corner: Triangles

    For the last two weeks, I’ve had a bunch of interviews and code challenge tasks I was taking which took up a lot of my time. Add that to #DadLife and the result is two weeks with no content. The pressure is off for the moment so I’m picking it up again. So for today:…

  • Code Corner: Nested Squares

    Code Corner: Nested Squares

    Problem Draw three nested squares in html and css. My Solution Simple, you need three divs nested inside each other with a unique way of referencing them, the rest is done in CSS. I set the body to gray because reasons, there is really no need to do this. The first part is that all…

  • Code Corner: Counting Multiples

    Code Corner: Counting Multiples

    Problem We are given 3 numbers, a starting number A, an ending number B and an integer K, find the number of multiples of K there is between A and B inclusive. Source Example a = 6 b = 9 k = 2 Should return 2 My solution The ranges are irrelevant because this is…

  • Code Corner: Bracket Matching

    Code Corner: Bracket Matching

    Problem Given a string with brackets check to see if the brackets are properly nested. Source Example [] = return 1 () => 1 )( => 0 ({)} => 0 ” => 1 My Solution Classic stack problem. Didn’t need to brute first. The idea is you create a stack and loop through each character…

  • Code Corner: Max of 3

    Code Corner:  Max of 3

    Problem Given an n-length Array of integers ranging from -1000 to 1000 find the largest product of three numbers in A that you can get. Source Example [-3,2,6,4,8] => 192 My Solution There are three basic scenarios that can produce the largest product: The largest three positive numbers The largest positive number and the smallest…

  • Code Corner: 1-minute rule

    Code Corner: 1-minute rule

    So today’s task was so easy I’m going to do another one because I solved it way too fast. It’s really not that hard if you know some built-in data structures. Problem Source Given an n-length Array of numbers between -1,000,000 to 1,000,000, find the number of distinct values in the array. Example A =…

  • August Plan

    August Plan

    My first-month update post. Here I’m going to list some things going on in my life and some of my plans for the coming month. Since I haven’t been doing these at all I’ve also decided to include a bit of background where needed. Private Projects iBudget.co.zw I am almost done with the alpha version…

  • Code Corner: More Array Hijinks

    Code Corner: More Array Hijinks

    Problem We have another array operations question. This time we are given two inputs, a number n and a 2d array of operations. Each of the operations has 3 values, a start index, an end index and an increment value. Source: HackerRank The task is to implement each of those tasks on to a new…

  • Code Corner: Counting Operations

    Code Corner: Counting Operations

    Problem Codility MaxCounters We are given a number n and an array A of length m where each value in A is less than n+1 and greater than or equal to 1. We have to create a function that executes two operations using a new array of length n with initial values 0. The array…