Algorithm {Triangle}

Hey, next problem from leetcode will be Triangle. Task description: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ [2], [3,4], [6,5,7], [4,1,8,3] ] The minimum path sum from top to bottom is 11 (i.e., 2 + 3 + 5 + 1 = 11). Note: Bonus point if you are able to do this using only O(n) extra space, where n is the total number of rows in the…

"Algorithm {Triangle}"

Reverse Words in a String Algorithm

Today we will try to solve “Reverse Words in a String” task for leetcode. Task description: Given an input string, reverse the string word by word. For example, Given s = “the sky is blue“, return “blue is sky the“. Clarification: What constitutes a word? A sequence of non-space characters constitutes a word. Could the input string contain leading or trailing spaces? Yes. However, your reversed string should not contain leading or trailing spaces. How about…

"Reverse Words in a String Algorithm"

Algorithm {Max Points on a Line}

Today we will try to solve next problem from leetcode. The problem is Max Points on a Line. Problem description: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. So, that is short desciption…. Try Stop and Think … What do we have, we have input array/list of points and should return max number of the points on one line. We can try to remember school math course…

"Algorithm {Max Points on a Line}"

VitualBox VMs increase disk size

I am using VirtualBox as VM platform for different OS’. Last time I’ve investigated kafka messaging system I’ve created simple VM based on the ubuntu OS. Disk was created by default with size amount 8 Gb. During investigation I’ve found that kafka stores a lot of files (related to configuration) and free space on my disk is very low, I’ve decided to extend it, but did not found standart ( on menu ) option to…

"VitualBox VMs increase disk size"

Reverse LinkedList {Loop implementation}

In the first part I’ve described how to reverse single LinkedList using recursion. Today we will to do the same using one loop. The structure of linked list will be the same, look to the Node class. OK, What we should understand? The first implementation used next steps: Go throughout all nodes and set next to null { after these steps we have n-null pointed LinkedLists.} Read from end and change direction of linking. Current…

"Reverse LinkedList {Loop implementation}"