Fatos Morina

Software engineering and personal development

Page 14 of 55

How to Quickly Find the Largest and Smallest Element in a List in Python

eyeglasses with black frames on white desk
Photo by Temple Cerulean on Unsplash

One of the first algorithms that we are usually taught is finding either the smallest or the largest element in a list of elements by iterating through every element in a list.

Let’s assume that we are trying to find the smallest element in a list.

The algorithm is quite straightforward and intuitive even for a 5-year-old: You assume that the first element is the smallest and save its value in a variable.

Continue reading

8 Great YouTube Channels That Help You Understand AI and Machine Learning Papers

laptop on table near cup
Photo by Andrew Neel on Unsplash

With the new quick advancements of machine learning and AI in general, we are witness to an increasing challenge of keeping up with the pace as the field processes at a faster rate than we may be able to keep up with.

Add to this the fact that a new paper is usually built on top of other previously published work and they may not give you the details about it which you then also need to go and read for that particular paper.

This chain of papers that you need to look up to and understand before you understand a paper that you are just about to read is getting longer.

Continue reading

How to Remove Duplicate Elements in a List in Python

MacBook Pro, white ceramic mug,and black smartphone on table
Photo by Andrew Neel on Unsplash

Lists are part of typically every project that you work on these days. You have lists of people, a list of products, a list of activities, and the list of lists goes on.

There can be times when you want to only have unique elements in that list, for example, if someone has liked multiple posts and you want to get all the people who have liked one of your posts. You do not want to include that same person multiple times in that list.

Continue reading

How to Check Whether 2 Strings Are Anagrams in Python Using Counter

A MacBook with lines of code on its screen on a busy desk
Photo by Christopher Gower on Unsplash

Checking whether a word is an anagram of another one can be a question that is quite common in coding interviews.

If you don’t know what an anagram is, here is a definition:

An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. For example, the word anagram itself can be rearranged into nag a ram, also the word binary into brainy and the word adobe into abode. 

Continue reading
« Older posts Newer posts »

© 2024 Fatos Morina

Theme by Anders NorenUp ↑