Coding Exercise Posts - page 18 of 43

Recent posts

Kth Last Node of a Linked List

less than 1 minute read

Given a singly linked list node, return the value of the kth last node (0-indexed). k is guaranteed not to be larger than the size of the linked list.

Friend Groups

less than 1 minute read

You are given an undirected graph friends as an adjacency list, where friends[i] is a list of people i is friends with. Friendships are two-way. Two people a...

Decode Message

1 minute read

Given the mapping "a" = 1, "b" = 2, … "z" = 26, and an encoded message message (as a string), count the number of ways it can be decoded.

Central Linked List

less than 1 minute read

Given a singly linked list node, return the value of the middle node. If there’s two middle nodes, then return the second one.

Parse Boolean Expression

less than 1 minute read

Given a string s representing a boolean expression containing operators "and" and "or", evaluate it and return the result. The expression may have parenthese...

Movie Theatres

1 minute read

Given a list of time exclusive intervals for different movie showings (possibly overlapping), find the minimum number of theatres required to be able to show...

Look and Say

1 minute read

The “look and say” sequence is defined as follows: beginning with the term 1, each subsequent term visually describes the digits appearing in the previous te...

Flight Itinerary

1 minute read

You are given a list of flights that were taken, represented as origin to destination airport pairs. Given that this list was shuffled, find all the airports...

Bubble Swap

1 minute read

Given two lists of integers lst0 and lst1, each of length n and where each value is unique to its array and between 0 to n - 1, return the minimum number of ...

Zero Matrix

1 minute read

Given a two-dimensional matrix of integers, for each zero in the original matrix, replace all values in its row and column with zero, and return the resultin...

Word Machine

1 minute read

You are given a list of strings ops where each element is either: