Skip to main content
Phanuphat (Oad) Srisukhawasu
Computer Science Undergraduate @ NUS
View all authors

Minimum Fuel Cost to Report to the Capital

· 4 min read
Phanuphat (Oad) Srisukhawasu
Computer Science Undergraduate @ NUS

In this problem, we are given a tree structure of a city plan. By that, it means that we have a graph of nn nodes that consists of exactly n1n-1 edges. The graph is also connected, i.e., it is possible to travel from one city to any other one. The setting is that the capital city is marked at node 0, and every other city has one representative that needs to come to the capital. They can travel together in a car, which has a limited number of seats. The problem asks us to find the minimum number of fuels used, considering that moving from one to another city takes exactly 1 liter of fuel.

Remove Duplicate Letters

· 5 min read
Phanuphat (Oad) Srisukhawasu
Computer Science Undergraduate @ NUS

Consider a string of lowercase characters. This problem asks us to remove the duplicate characters from the string and return the result string that has the lowest lexicographical order among the possible outcomes. Indeed, this problem is the same as finding the subsequence of unique characters (that has the lowest lexicographical order).

Critical Connections in a Network

· 7 min read
Phanuphat (Oad) Srisukhawasu
Computer Science Undergraduate @ NUS

Consider a network of servers represented by a graph (V,E)(V, E) where e={u,v}Ee=\{u,v\}\in E if and only if there is a direct connection between server uu and vv. Some servers are connected indirectly through intermediate nodes, i.e., there exists a path between them. This problem considers the critical edges where removing them destroys the connections between the servers.