Python List

How to Return Dictionary Keys as a List in Python?

Short answer: use the expression list(dict.keys()). Problem Formulation Given a dictionary that maps keys to values. Return the keys as a list. For example: Given dictionary {‘Alice’: 18, ‘Bob’, 21, ‘Carl’: 24} Return the keys as a list [‘Alice’, ‘Bob’, ‘Carl’] Solution The dict.keys() method returns a list of all keys in Python 2. The …

How to Return Dictionary Keys as a List in Python? Read More »

[Google Interview] Find the k-th Largest Element in an Unsorted Array

Do you train for your upcoming coding interview? This question was asked by Google as reported in multiple occasions by programmers all around the world. Can you solve it optimally? Let’s dive into the problem first. Problem Formulation Given an integer array or Python list nums and an integer value k. Find and return the …

[Google Interview] Find the k-th Largest Element in an Unsorted Array Read More »

16 PDF Cheat Sheets for Programmers

A couple of years ago, I fell into the habit of creating cheat sheets when exploring certain areas in the programming space. Over time, hundreds of thousands of Finxters have downloaded and used them in their own learning journeys. However, the cheat sheets are largely scattered around many different locations on the Finxter ecosystem. And …

16 PDF Cheat Sheets for Programmers Read More »