c++
Water Jugs Problem
Suppose you are given n red and n blue water jugs, all of different shapes and sizes. All red jugs hold different amounts of water, as do the blue ones. Moreover, there is a blue Read more…
Suppose you are given n red and n blue water jugs, all of different shapes and sizes. All red jugs hold different amounts of water, as do the blue ones. Moreover, there is a blue Read more…
Given an m-ary tree, write an efficient algorithm to convert the tree to its mirror. An m-ary tree (aka k-ary tree) is a tree in which each node has no more than m children. Each Read more…
Hi. I wonder if the .NET platform is such a jack of trades, master of none. The backend is ruled by Java, on the Javascript front, in mobile Kotlin, in games and low-level things C++ Read more…
Given an array of integers, trim it such that its maximum element becomes less than twice the minimum, return the minimum number of removals required for the conversion. For example, The idea is straightforward and Read more…
Hi, I have inherited 0.5 mio C# LOC across 180 projects written by complete lunatics. Everything is public, ReSharper has more warnings than LOC and even the unit test project itself has less than 10% Read more…
Given an undirected graph, check whether it has an Eulerian path or not. In other words, check if it is possible to construct a path that visits each edge exactly once. An Eulerian trail is Read more…
Given an array of integers, find the next greater element for every element in the array. The next greater element of a number x is the first greater number to the right of x in Read more…
This is indeed a nice read, but I’m not sure it fully convinces me that record types are actually important (unless you intend to use with). It sets up a problem, solves it with “conventional” Read more…
Is there a way to convert strings (given by the user via the console) to integers (more specifically- strings like these: 5 * 4 + 3 or 3 + 6). What is the simplest way Read more…
I applied to a PHP job and the interviewer sent me a test as following: “Write a CRUD application connecting to PostgreSQL, but please don’t use full-stack frameworks like Laravel, Symfony or Code Igniter, also Read more…