Month: May 2021

Method Overriding vs Overloading in Python [+Video]

Method overriding vs overloading in Python—what’s the difference? If you’re short on time—here it is: Method overloading: creating a method that can be called with different arguments such as m() and m(1, 2, 3). Method overriding: overwriting the functionality of a method defined in a parent class. In method overloading, methods in a given class …

Method Overriding vs Overloading in Python [+Video] Read More »

[Google Interview] Find the k Closest Numbers in a Sorted Array

🏢 This is one of the Google interview questions and reported by programmers across the globe as one of the commonly asked questions during interviews. So, can you give the optimal solution to this problem? Problem Formulation Given an integer array or Python list nums, an integer value x and k. Find and return the …

[Google Interview] Find the k Closest Numbers in a Sorted Array Read More »

Kata Recursive Replication – Python Solution Video

Problem Formulation The following problem formulation is taken from this Kata. Design a recursive function called replicate(times, number) that returns an array of repetitions of the number argument. For example, replicate(3, 5) should return the list [5, 5, 5]. If the times argument is negative, return an empty array. Do not use loops to solve …

Kata Recursive Replication – Python Solution Video Read More »

Are Energy Costs and CapEx Invested in Bitcoin Worth It?

Bitcoin capital expenditure and energy overhead are often criticized to be unsustainably high. But are they worth it in relation to the value provided by the Bitcoin network? TLDR; Capex and energy costs are estimated using the USD value of the transaction fees paid by the Bitcoin traders. The value of the Bitcoin monetary system …

Are Energy Costs and CapEx Invested in Bitcoin Worth It? Read More »

How to Get All Transactions for a BTC Address in Python?

Problem Formulation Given a single Bitcoin address in the form of a stream of characters such as the address of the first “Genesis” block ever created on the Bitcoin blockchain: 12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX How to get all transactions for this BTC address in a Python script? Solution To get all transactions of a given Bitcoin address, import …

How to Get All Transactions for a BTC Address in Python? Read More »