Coding Exercise Posts - page 41 of 43

Recent posts

City Blocks

1 minute read

You are given a two-dimensional matrix of unique strings representing city blocks, and a list of strings blocks to visit. Given that you are sitting at block...

Check Power of Two

less than 1 minute read

Given an integer n greater than or equal to 0, return whether it is a power of two.

Check Palindrome

less than 1 minute read

Given a string s, return whether it is a palindrome.

Changing Directions

1 minute read

Given a list of integers nums, return the number of times that the list changes from positive-to-negative or negative-to-positive slope.

Cell Fusion

1 minute read

You are given a list of integers cells, representing sizes of different cells. In each iteration, the two largest cells a and b interact according to these r...

Buying Cars

less than 1 minute read

Given a list of integers prices representing prices of cars for sale, and a budget k, return the maximum number of cars you can buy.

Binary Tree to Linked List

less than 1 minute read

Given a binary tree root, convert it to a singly linked list using an inorder traversal.

Binary Search Tree Validation

less than 1 minute read

Given a binary tree root, return whether it’s a binary search tree. A binary tree node is a binary search tree if :

Big Numbers

less than 1 minute read

Given a two-dimensional integer matrix, return the total number of integers whose value is the largest in its row and in its column.

Beer Bottles

less than 1 minute read

You are given an integer n representing n full beer bottles. Given that you can exchange 3 empty beer bottles for 1 full beer bottle, return the number of be...